FileTransfer Class Reference

Represents a single data transfer from one url to another. More...

#include <filetransfer.h>

List of all members.

Signals

void onProgress (FileTransfer *fileTransfer, unsigned long long bytesTransferred, unsigned long long bytesTotal)
 Signal for updating transfer status.
void onCompleted (FileTransfer *fileTransfer, bool success, QString error)

Public Member Functions

 FileTransfer (const std::string &source_str, const std::string &destination_str, Arc::UserConfig &usercfg)
 Create a file transfer object.
TTransferState transferState ()
 Return the current transfer state.
bool execute ()
 Start the actual file transfer.
void wait ()
 Wait for the file transfer to complete.
Arc::DataStatus status ()
 Return the ARC transfer status.
void completed (Arc::DataStatus res, std::string error)
 Routine called by the ARC callbacks to indicate a failed/completed file transfer.
void cancel ()
 Cancel the transfer.
bool isCompleted ()
 Returns true if transfer is completed.
QString id ()
 Return current transfer id.
QString sourceUrl ()
 Return source URL.
QString destUrl ()
 Return destination URL.
void updateTransferStatus (unsigned long transferred, unsigned long totalSize)
 Updated the current transfer statistics.
void getTransferStatus (unsigned long &transferred, unsigned long &totalSize)
 Return current transfer statistics.

Detailed Description

Represents a single data transfer from one url to another.


Constructor & Destructor Documentation

FileTransfer::FileTransfer ( const std::string &  source_str,
const std::string &  destination_str,
Arc::UserConfig &  usercfg 
)

Create a file transfer object.

Creates a file transfer object used for handling a file transfer using the ARC API:s. The transfer object is by default idle and will not start any transfers until the execute method is called.

Parameters:
source_str is the source URL of a file to be transferred.
destination_str is the destination URL of the file to transferred.
usercfg is the current ARC configuration object.

Member Function Documentation

void FileTransfer::cancel (  ) 

Cancel the transfer.

Currently only destroys the ARC data mover object. Graceful cancellation is currently not supported due to restrictions in the ARC API.

void FileTransfer::completed ( Arc::DataStatus  res,
std::string  error 
)

Routine called by the ARC callbacks to indicate a failed/completed file transfer.

This routine should not be called directly. It is public so that the static callback can access the routine.

void FileTransfer::onProgress ( FileTransfer fileTransfer,
unsigned long long  bytesTransferred,
unsigned long long  bytesTotal 
) [signal]

Signal for updating transfer status.

This signal is called whenever the ARC callback is called to convey the current transfer statistics on the ongoing file transfer.

Parameters:
fileTransfer file transfer object that initiated the signal.
bytesTransferred currently transfers bytes
bytesTotal total of bytes to be transferred.
void FileTransfer::updateTransferStatus ( unsigned long  transferred,
unsigned long  totalSize 
)

Updated the current transfer statistics.

This routine should not be called directly. It is public so that the static callback can accces the routine.


The documentation for this class was generated from the following files:
 All Classes Functions Variables

Generated on 19 Feb 2013 for ARC Graphical Clients by  doxygen 1.6.1