FaspManager.h
Go to the documentation of this file.
1 
7 #ifndef __FASP_MANAGER_H__
8 #define __FASP_MANAGER_H__
9 
58 
59 /* Other includes, for the sole purpose of making this a master include file */
60 #include "Environment.h"
61 #include "FaspManagerLocation.h"
62 #include "FaspManagerFunctor.h"
63 #include "FaspManagerException.h"
64 #include "FaspManagerTypes.h"
65 #include "FaspManagerCommon.h"
66 
68 namespace Aspera
69 {
71 namespace FaspManager
72 {
73 
74 /* Forward declarations */
75 class Job;
76 
77 /* FASP Manager states */
79 #define FASP_MGR_IDLE 0x01
80 #define FASP_MGR_STARTED 0x02
82 #define FASP_MGR_STOPPED 0x03
84 #define FASP_MGR_ERROR 0x04
86 
87 /* Globals */
88 
90 typedef enum mgr_ctrl_t
91 {
92  CTRL_NONE = 0,
93  CTRL_PAUSE = 0x01,
94  CTRL_RESUME = 0x02,
95  CTRL_CANCEL = 0x04,
96  CTRL_UPDATE_RATE = 0x08,
97  CTRL_UPDATE_MIN = 0x10,
98  CTRL_UPDATE_POLICY = 0x20,
99  CTRL_UPDATE = CTRL_UPDATE_RATE | CTRL_UPDATE_MIN | CTRL_UPDATE_POLICY,
100 } mgr_ctrl_t;
101 
102 inline mgr_ctrl_t operator|(mgr_ctrl_t a, mgr_ctrl_t b)
103  { return (mgr_ctrl_t)((int)a | (int)b); }
104 inline mgr_ctrl_t& operator|=(mgr_ctrl_t& a, mgr_ctrl_t b)
105  { return (a = (a | b)); }
106 inline mgr_ctrl_t operator&(mgr_ctrl_t a, mgr_ctrl_t b)
107  { return (mgr_ctrl_t)((int)a & (int)b); }
108 
115 class Manager
116 {
117 
118  public:
119 
123  FASP_MANAGER_API static Manager *GetInstance( bool owns_log = true );
124 
126  FASP_MANAGER_API static void Destroy( );
127 
137  FASP_MANAGER_API virtual char const* LaunchJob( JobOrder *order, Functor *fnctr ) = 0;
138 
150  FASP_MANAGER_API virtual void ControlJob( mgr_ctrl_t ctrl, UpdateParams *up_prms, char const* jobid ) = 0;
151 
163  FASP_MANAGER_API virtual void AddSourcePath( char const* jobid, char const* src_path, char const* dst_path, u_int64_t start=0, u_int64_t end=0 ) = 0;
164 
172  FASP_MANAGER_API virtual void CancelJob( char const* jobid ) = 0;
173 
184  FASP_MANAGER_API virtual void StopPersistentJob( char const* jobid ) = 0;
185 
195  FASP_MANAGER_API virtual void LockPersistentJob( char const* jobid ) = 0;
196 
204  FASP_MANAGER_API virtual void RemoveJob( char const* jobid ) = 0;
205 
217  FASP_MANAGER_API virtual void AddCallback( char const* jobid, Functor *fnctr ) = 0;
218 
228  FASP_MANAGER_API virtual void AddGlobalCallback( Functor *fnctr ) = 0;
229 
230 
234  FASP_MANAGER_API virtual void RemoveGlobalCallback( Functor *fnctr ) = 0;
235 
241  FASP_MANAGER_API virtual char const* const* GetJobIdList( ) = 0;
242 
248  FASP_MANAGER_API virtual JobStats GetJobStats( char const* jobid )= 0;
249 
256 
259  FASP_MANAGER_API virtual bool ListenForServerSessions(bool On) = 0;
260 
263  FASP_MANAGER_API virtual void SetDebugLevel(int level) = 0;
264 
265  protected:
266 
268  FASP_MANAGER_API Manager( );
269 
271  FASP_MANAGER_API virtual ~Manager( );
272 };
273 
274 } /* namespace FaspManager */
275 } /* namespace Aspera */
276 
277 #endif /* __FASP_MANAGER_H__ */
virtual FASP_MANAGER_API void SetDebugLevel(int level)=0
A class providing an abstract base for FASP functors.
Definition: FaspManagerFunctor.h:23
virtual FASP_MANAGER_API void RemoveGlobalCallback(Functor *fnctr)=0
virtual FASP_MANAGER_API void RemoveJob(char const *jobid)=0
A structure of update parameters.
Definition: FaspManagerTypes.h:347
A structure of FASP Job job level statistics.
Definition: FaspManagerTypes.h:358
virtual FASP_MANAGER_API void AddGlobalCallback(Functor *fnctr)=0
virtual FASP_MANAGER_API void LockPersistentJob(char const *jobid)=0
virtual FASP_MANAGER_API ~Manager()
Destructs this FASP Manager.
virtual FASP_MANAGER_API bool ListenForServerSessions(bool On)=0
A structure of the components that define a FASP Job transfer.
Definition: FaspManagerTypes.h:227
virtual FASP_MANAGER_API void CancelJob(char const *jobid)=0
virtual FASP_MANAGER_API void StopPersistentJob(char const *jobid)=0
virtual FASP_MANAGER_API char const * LaunchJob(JobOrder *order, Functor *fnctr)=0
C++ namespace for Aspera, Inc.
Definition: Environment.h:10
A class to manage FASP jobs.
Definition: FaspManager.h:115
static FASP_MANAGER_API void Destroy()
Stops and destructs a singleton reference to a FASP Manager.
static FASP_MANAGER_API Manager * GetInstance(bool owns_log=true)
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
FASP_MANAGER_API Manager()
Constructs this FASP Manager.
virtual FASP_MANAGER_API void AddCallback(char const *jobid, Functor *fnctr)=0
virtual FASP_MANAGER_API void ControlJob(mgr_ctrl_t ctrl, UpdateParams *up_prms, char const *jobid)=0
mgr_ctrl_t
An enumeration of FASP Manager control types.
Definition: FaspManager.h:90
virtual FASP_MANAGER_API char const *const * GetJobIdList()=0
virtual FASP_MANAGER_API JobStats GetJobStats(char const *jobid)=0

Copyright © 2005 - 2016 Aspera, an IBM company. | asperasoft.com