Aspera Developer Documentation

Manager Class Reference

List of all members.


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.

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.


Member Function Documentation

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* LaunchJob ( JobOrder order,
Functor fnctr 
) [pure virtual]

Launches a FASP Job.

Parameters:
order the transfer definition of the FASP Job
fnctr the 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:
XferException on transfer related errors
ValidationException if paths are not correctly set in the job order

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:
ctrl the control type
up_prms the rate and/or policy change, if applicable
jobid the job id associated with the FASP Job to control
Exceptions:
Job_not_found_exception on job ids that cannot be mapped to FASP Jobs
fasp_state_exception on Jobs that cannot be removed in their current state
fasp_send_exception on errors relating to the sending of management messages

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:
jobid id of the job to which the source path is to be added
src_path the new source path to be added (must be a file if using ranges)
dst_path the destination path for the source
start the start byte of source file. 0 indicates beginning of the file
end the end byte of source file. 0 indicates end of the file
Exceptions:
Job_not_found_exception on job ids that cannot be mapped to FASP Jobs
fasp_state_exception on Jobs that are either completed or not persistent
fasp_send_exception on 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:
jobid id of the job to which source path is to be added
Exceptions:
JobNotFoundException on job ids that cannot be mapped to FASP Jobs
StateException on Jobs that are either completed or not persistent
SendException on errors relating to the sending of management messages

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:
jobid id of the job to which source path is to be added
Exceptions:
JobNotFoundException on job ids that cannot be mapped to FASP Jobs
StateException on Jobs that are either completed or not persistent
SendException on errors relating to the sending of management messages

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:
jobid id of the job to which source path is to be added
Exceptions:
JobNotFoundException on job ids that cannot be mapped to FASP Jobs
StateException on Jobs that are either completed or not persistent
SendException on errors relating to the sending of management messages

virtual FASP_MANAGER_API void RemoveJob ( char const *  jobid  )  [pure virtual]

Removes a FASP Job from the FASP Manager.

Parameters:
jobid the job id associated with the FASP Job to remove
Exceptions:
JobNotFoundException on job ids that cannot be mapped to FASP Jobs
StateException on Jobs that cannot be removed in their current state

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:
jobid the job id associated with the FASP Job to add a callback
fnctr the FASP functor acting as the callback
Exceptions:
JobNotFoundException on 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:
fnctr the FASP functor acting as the callback

virtual FASP_MANAGER_API void RemoveGlobalCallback ( Functor fnctr  )  [pure virtual]

Removes a global callback

Parameters:
fnctr the FASP functor acting as the callback

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:
jobid the job id associated with the FASP Job
Returns:
the FASP Job stats
Exceptions:
JobNotFoundException on job ids that cannot be mapped to FASP Jobs

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:
On the 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 SetDebugLevel ( int  level  )  [pure virtual]

Set the debug logging level for this Fasp Manager

Parameters:
level the logging level 0 to 2


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