Aspera Developer Documentation
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 
81 #define FASP_MGR_STARTED 0x02
82 
83 #define FASP_MGR_STOPPED 0x03
84 
85 #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 
136  FASP_MANAGER_API virtual char const* LaunchJob( JobOrder *order, Functor *fnctr ) = 0;
137 
149  FASP_MANAGER_API virtual void ControlJob( mgr_ctrl_t ctrl, UpdateParams *up_prms, char const* jobid ) = 0;
150 
162  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;
163 
171  FASP_MANAGER_API virtual void CancelJob( char const* jobid ) = 0;
172 
183  FASP_MANAGER_API virtual void StopPersistentJob( char const* jobid ) = 0;
184 
194  FASP_MANAGER_API virtual void LockPersistentJob( char const* jobid ) = 0;
195 
203  FASP_MANAGER_API virtual void RemoveJob( char const* jobid ) = 0;
204 
211  FASP_MANAGER_API virtual void AddCallback( char const* jobid, Functor *fnctr ) = 0;
212 
217  FASP_MANAGER_API virtual void AddGlobalCallback( Functor *fnctr ) = 0;
218 
219 
223  FASP_MANAGER_API virtual void RemoveGlobalCallback( Functor *fnctr ) = 0;
224 
230  FASP_MANAGER_API virtual char const* const* GetJobIdList( ) = 0;
231 
237  FASP_MANAGER_API virtual JobStats GetJobStats( char const* jobid )= 0;
238 
245 
248  FASP_MANAGER_API virtual bool ListenForServerSessions(bool On) = 0;
249 
252  FASP_MANAGER_API virtual void SetDebugLevel(int level) = 0;
253 
254  protected:
255 
257  FASP_MANAGER_API Manager( );
258 
260  FASP_MANAGER_API virtual ~Manager( );
261 };
262 
263 } /* namespace FaspManager */
264 } /* namespace Aspera */
265 
266 #endif /* __FASP_MANAGER_H__ */

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