ARC Graphical Clients: /home/jonas/Development/arc-gui-clients/src/arcstorage-ui/filetransfer.h Source File

- Main Page
- Classes
- Files

- File List

# /home/jonas/Development/arc-gui-clients/src/arcstorage-ui/filetransfer.h

    00001 #ifndef FILETRANSFER_H
    00002 #define FILETRANSFER_H
    00003
    00004 #include <iostream>
    00005 #include <string>
    00006
    00007 #include "arc-gui-config.h"
    00008 #include <arc/Thread.h>
    00009
    00010 #include <arc/ArcLocation.h>
    00011 #include <arc/GUID.h>
    00012 #include <arc/Logger.h>
    00013 #include <arc/StringConv.h>
    00014 #include <arc/URL.h>
    00015 #include <arc/User.h>
    00016 #include <arc/UserConfig.h>
    00017 #include <arc/credential/Credential.h>
    00018 #include <arc/data/FileCache.h>
    00019 #include <arc/data/DataHandle.h>
    00020 #include <arc/data/DataMover.h>
    00021 #include <arc/data/URLMap.h>
    00022 #include <arc/OptionParser.h>
    00023
    00024 #include <QObject>
    00025 #include <QString>
    00026
    00028 enum TTransferState { TS_IDLE,
    00029                       TS_EXECUTED,
    00030                       TS_FAILED,
    00031                       TS_COMPLETED
    00032                     };
    00033
    00035 class FileTransfer : public QObject
    00036 {
    00037     Q_OBJECT
    00038 private:
    00039     std::string m_id;
    00040     TTransferState m_transferState;
    00041     int m_timeout;
    00042     int m_retries;
    00043     bool m_secure;
    00044     bool m_passive;
    00045     bool m_notpassive;
    00046     bool m_force;
    00047     bool m_verbose;
    00048     bool m_nocopy;
    00049     int m_recursion;
    00050     bool m_completed;
    00051     unsigned long m_transferred;
    00052     unsigned long m_totalSize;
    00053
    00054     Arc::URL m_sourceUrl;
    00055     Arc::URL m_destUrl;
    00056     Arc::DataHandle m_sourceHandle;
    00057     Arc::DataHandle m_destHandle;
    00058     Arc::DataMover* m_mover;
    00059     Arc::FileCache* m_cache;
    00060     Arc::URLMap* m_urlMap;
    00061     Arc::UserConfig* m_config;
    00062     Arc::DataStatus m_status;
    00063     Arc::SimpleCondition m_cond;
    00064 public:
    00066
    00074     FileTransfer(const std::string& source_str, const std::string& destination_str, Arc::UserConfig& usercfg);
    00075     virtual ~FileTransfer();
    00076
    00078     TTransferState transferState();
    00079
    00081     bool execute();
    00082
    00084     void wait();
    00085
    00087     Arc::DataStatus status();
    00088
    00090
    00094     void completed(Arc::DataStatus res, std::string error);
    00095
    00097
    00101     void cancel();
    00102
    00104     bool isCompleted();
    00105
    00107     QString id();
    00108
    00110     QString sourceUrl();
    00111
    00113     QString destUrl();
    00114
    00116
    00120     void updateTransferStatus(unsigned long transferred, unsigned long totalSize);
    00121
    00123     void getTransferStatus(unsigned long& transferred, unsigned long& totalSize);
    00124
    00125 Q_SIGNALS:
    00126
    00128
    00135     void onProgress(FileTransfer* fileTransfer, unsigned long long bytesTransferred, unsigned long long bytesTotal);
    00136     void onCompleted(FileTransfer* fileTransfer, bool success, QString error);
    00137 };
    00138
    00139 #endif // FILETRANSFER_H

All Classes Functions Variables