Back to index

nordugrid-arc-nox  1.1.0~rc6
plugins.h
Go to the documentation of this file.
00001 #ifndef __ARC_GM_PLUGINS_H__
00002 #define __ARC_GM_PLUGINS_H__
00003 
00004 #include <string>
00005 
00006 class ContinuationPlugins {
00007  public:
00008   typedef enum {
00009     act_fail,
00010     act_pass,
00011     act_log,
00012     act_undefined
00013   } action_t;
00014   class result_t {
00015    public:
00016     action_t action;
00017     int result;
00018     std::string response;
00019     result_t(action_t act,int res,const std::string& resp):
00020                            action(act),result(res),response(resp) { };
00021     result_t(action_t act):
00022                            action(act),result(0) { };
00023   };
00024  private:
00025   class command_t {
00026    public:
00027     std::string cmd;
00028     unsigned int to;
00029     action_t onsuccess;
00030     action_t onfailure;
00031     action_t ontimeout;
00032   };
00033   std::list<command_t> commands[JOB_STATE_NUM];
00034  public:
00035   ContinuationPlugins(void); 
00036   ~ContinuationPlugins(void); 
00037   bool add(job_state_t state,unsigned int timeout,const char* command);
00038   bool add(const char* state,unsigned int timeout,const char* command);
00039   bool add(job_state_t state,const char* options,const char* command);
00040   bool add(const char* state,const char* options,const char* command);
00041   void run(const JobDescription &job,const JobUser& user,std::list<result_t>& results);
00042 };
00043 
00044 #endif