Aspera Developer Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Manager Class Referenceabstract

A class to manage FASP jobs. More...

Public Member Functions

virtual FASP_MANAGER_API char
const * 
LaunchJob (JobOrder *order, Functor *fnctr)=0
 
virtual FASP_MANAGER_API void ControlJob (mgr_ctrl_t ctrl, UpdateParams *up_prms, char const *jobid)=0
 
virtual FASP_MANAGER_API void AddSourcePath (char const *jobid, char const *src_path, char const *dst_path, u_int64_t start=0, u_int64_t end=0)=0
 
virtual FASP_MANAGER_API void CancelJob (char const *jobid)=0
 
virtual FASP_MANAGER_API void StopPersistentJob (char const *jobid)=0
 
virtual FASP_MANAGER_API void LockPersistentJob (char const *jobid)=0
 
virtual FASP_MANAGER_API void RemoveJob (char const *jobid)=0
 
virtual FASP_MANAGER_API void AddCallback (char const *jobid, Functor *fnctr)=0
 
virtual FASP_MANAGER_API void AddGlobalCallback (Functor *fnctr)=0
 
virtual FASP_MANAGER_API void RemoveGlobalCallback (Functor *fnctr)=0
 
virtual FASP_MANAGER_API char
const *const * 
GetJobIdList ()=0
 
virtual FASP_MANAGER_API JobStats GetJobStats (char const *jobid)=0
 
virtual FASP_MANAGER_API bool ListenForServerSessions (bool On)=0
 
virtual FASP_MANAGER_API void SetDebugLevel (int level)=0
 

Static Public Member Functions

static FASP_MANAGER_API ManagerGetInstance (bool owns_log=true)
 
static FASP_MANAGER_API void Destroy ()
 Stops and destructs a singleton reference to a FASP Manager.
 

Protected Member Functions

FASP_MANAGER_API Manager ()
 Constructs this FASP Manager.
 
virtual FASP_MANAGER_API ~Manager ()
 Destructs this FASP Manager.
 

Detailed Description

A class to manage FASP jobs.

A FASP Manager is responsible for controlling (i.e., launching, pausing, resuming, updating, cancelling) FASP Jobs. The manager is also charged with gathering statistics on each of these jobs. In this context, a FASP Job is a file, directory, or combination thereof to be transfered.

Member Function Documentation

virtual FASP_MANAGER_API void AddCallback ( char const *  jobid,
Functor fnctr 
)
pure virtual

Adds a global callback that gets notified for events on job with the specified id.

Parameters
jobidthe job id associated with the FASP Job to add a callback
fnctrthe FASP functor acting as the callback
Exceptions
JobNotFoundExceptionon job ids that cannot be mapped to FASP Jobs
virtual FASP_MANAGER_API void AddGlobalCallback ( Functor fnctr)
pure virtual

Adds a global callback that gets notified for events on all active transfers

Parameters
fnctrthe FASP functor acting as the callback
virtual FASP_MANAGER_API void AddSourcePath ( char const *  jobid,
char const *  src_path,
char const *  dst_path,
u_int64_t  start = 0,
u_int64_t  end = 0 
)
pure virtual

Adds a source path to a persistent transfer session.

Parameters
jobidid of the job to which the source path is to be added
src_paththe new source path to be added (must be a file if using ranges)
dst_paththe destination path for the source
startthe start byte of source file. 0 indicates beginning of the file
endthe end byte of source file. 0 indicates end of the file
Exceptions
Job_not_found_exceptionon job ids that cannot be mapped to FASP Jobs
fasp_state_exceptionon Jobs that are either completed or not persistent
fasp_send_exceptionon errors relating to the sending of management messages
virtual FASP_MANAGER_API void CancelJob ( char const *  jobid)
pure virtual

Cancels a transfer job and aborts the transfer, if still running. Results in SESSION_ERROR notification.

Parameters
jobidid of the job to which source path is to be added
Exceptions
JobNotFoundExceptionon job ids that cannot be mapped to FASP Jobs
StateExceptionon Jobs that are either completed or not persistent
SendExceptionon errors relating to the sending of management messages
virtual FASP_MANAGER_API void ControlJob ( mgr_ctrl_t  ctrl,
UpdateParams up_prms,
char const *  jobid 
)
pure virtual

Controls a FASP Job. Possible controls are Pause, Resume, and Cancel.

Parameters
ctrlthe control type
up_prmsthe rate and/or policy change, if applicable
jobidthe job id associated with the FASP Job to control
Exceptions
Job_not_found_exceptionon job ids that cannot be mapped to FASP Jobs
fasp_state_exceptionon Jobs that cannot be removed in their current state
fasp_send_exceptionon errors relating to the sending of management messages
static FASP_MANAGER_API Manager* GetInstance ( bool  owns_log = true)
static

Gets a singleton reference to a FASP Manager.

Returns
a reference to a FASP Manager
virtual FASP_MANAGER_API char const* const* GetJobIdList ( )
pure virtual

Gets a list of FASP Jobs. This list comprises a snapshot of the jobs running at the time of this call.

Returns
pointer to a null terminated array of strings (char *'s)
virtual FASP_MANAGER_API JobStats GetJobStats ( char const *  jobid)
pure virtual

Gets FASP Job job level stats.

Parameters
jobidthe job id associated with the FASP Job
Returns
the FASP Job stats
Exceptions
JobNotFoundExceptionon job ids that cannot be mapped to FASP Jobs
virtual FASP_MANAGER_API char const* LaunchJob ( JobOrder order,
Functor fnctr 
)
pure virtual

Launches a FASP Job.

Parameters
orderthe transfer definition of the FASP Job
fnctrthe functor used in statistic notification callbacks, NULL if there is no callback functor to register
Returns
the job id associated with the launched FASP Job
Exceptions
XferExceptionon transfer related errors
ValidationExceptionif paths are not correctly set in the job order
virtual FASP_MANAGER_API bool ListenForServerSessions ( bool  On)
pure virtual

Once this is turned on, you can use a global callback to receive notifications for sessions intiated outside FaspManager. This feature can be used to monitor transfers on an Aspera server. NOTE: This must be turned on at the time an external transfer is started. Fasp Manager cannot send notifications for transfers already running at the time this feature is turned on.

Parameters
Onthe boolean parameter to enable/disable external session monitoring.
Returns
true if the request to start (or to stop) listening succeeded
virtual FASP_MANAGER_API void LockPersistentJob ( char const *  jobid)
pure virtual

Locks a persistent transfer job and prevents it from accepting paths further. Once locked, a persistent job will terminate when it completes transferring all paths already submitted to it, just like a regular job.

Parameters
jobidid of the job to which source path is to be added
Exceptions
JobNotFoundExceptionon job ids that cannot be mapped to FASP Jobs
StateExceptionon Jobs that are either completed or not persistent
SendExceptionon errors relating to the sending of management messages
virtual FASP_MANAGER_API void RemoveGlobalCallback ( Functor fnctr)
pure virtual

Removes a global callback

Parameters
fnctrthe FASP functor acting as the callback
virtual FASP_MANAGER_API void RemoveJob ( char const *  jobid)
pure virtual

Removes a FASP Job from the FASP Manager.

Parameters
jobidthe job id associated with the FASP Job to remove
Exceptions
JobNotFoundExceptionon job ids that cannot be mapped to FASP Jobs
StateExceptionon Jobs that cannot be removed in their current state
virtual FASP_MANAGER_API void SetDebugLevel ( int  level)
pure virtual

Set the debug logging level for this Fasp Manager

Parameters
levelthe logging level 0 to 2
virtual FASP_MANAGER_API void StopPersistentJob ( char const *  jobid)
pure virtual

Stops a persistent transfer job and aborts the transfer, if still running. Normally, jobs are automatically terminated once all sources are transferrred (or failed). The only exception is Persistent jobs which persist until you invoke this function. This is treated as normal termination of a persistent job and no errors are raised.

Parameters
jobidid of the job to which source path is to be added
Exceptions
JobNotFoundExceptionon job ids that cannot be mapped to FASP Jobs
StateExceptionon Jobs that are either completed or not persistent
SendExceptionon errors relating to the sending of management messages

Copyright © 2005 - 2008 Aspera, Inc. | asperasoft.com