This class provides an abstract interface for the Delivery layer. More...
#include <DataDeliveryComm.h>
Data Structures | |
struct | Status |
Plain C struct to pass information from executing process back to main thread. More... | |
Public Types | |
enum | CommStatusType { CommInit, CommNoError, CommTimeout, CommClosed, CommExited, CommFailed } |
Public Member Functions | |
virtual | ~DataDeliveryComm () |
Status | GetStatus () const |
std::string | GetError () const |
virtual | operator bool () const =0 |
virtual bool | operator! () const =0 |
Static Public Member Functions | |
static DataDeliveryComm * | CreateInstance (DTR_ptr dtr, const TransferParameters ¶ms) |
static bool | CheckComm (DTR_ptr dtr, std::vector< std::string > &allowed_dirs) |
Protected Member Functions | |
virtual void | PullStatus ()=0 |
DataDeliveryComm (DTR_ptr dtr, const TransferParameters ¶ms) | |
Protected Attributes | |
Status | status_ |
Status | status_buf_ |
unsigned int | status_pos_ |
Glib::Mutex | lock_ |
DataDeliveryCommHandler * | handler_ |
std::string | dtr_id |
TransferParameters | transfer_params |
Arc::Time | start_ |
DTRLogger | logger_ |
This class provides an abstract interface for the Delivery layer.
Different implementations provide different ways of providing Delivery functionality. DataDeliveryLocalComm launches a local process to perform the transfer and DataDeliveryRemoteComm contacts a remote service which performs the transfer. The implementation is chosen depending on what is set in the DTR, which the Scheduler should set based on various factors.
CreateInstance() should be used to get a pointer to the instantiated object. This also starts the transfer. Deleting this object stops the transfer and cleans up any used resources. A singleton instance of DataDeliveryCommHandler regularly polls all active transfers using PullStatus() and fills the Status object with current information, which can be obtained through GetStatus().
Communication status with transfer.
DataStaging::DataDeliveryComm::DataDeliveryComm | ( | DTR_ptr | dtr, | |
const TransferParameters & | params | |||
) | [protected] |
Start transfer with parameters taken from DTR and supplied transfer limits.
Constructor should not be used directly, CreateInstance() should be used instead.
static bool DataStaging::DataDeliveryComm::CheckComm | ( | DTR_ptr | dtr, | |
std::vector< std::string > & | allowed_dirs | |||
) | [static] |
Check the delivery is available. Calls CheckComm of the appropriate subclass.
dtr | DTR from which credentials are used | |
allowed_dirs | List of dirs that this comm is allowed to read/write |
Reimplemented in DataStaging::DataDeliveryLocalComm, and DataStaging::DataDeliveryRemoteComm.
virtual void DataStaging::DataDeliveryComm::PullStatus | ( | ) | [protected, pure virtual] |
Check for new state and fill state accordingly.
This method is periodically called by the comm handler to obtain status info. It detects communication and delivery failures and delivery termination.
Implemented in DataStaging::DataDeliveryLocalComm, and DataStaging::DataDeliveryRemoteComm.