00001 #ifndef __EDG_WORKLOAD_LOGGING_CLIENT_JOBSTATUS_HPP__
00002 #define __EDG_WORKLOAD_LOGGING_CLIENT_JOBSTATUS_HPP__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <sys/time.h>
00014 #include <string>
00015 #include <utility>
00016 #include <vector>
00017
00018 #include "glite/wmsutils/jobid/JobId.h"
00019
00020 #include "glite/lb/jobstat.h"
00021 #include "glite/lb/CountRef.h"
00022
00023 EWL_BEGIN_NAMESPACE;
00024
00037 class JobStatus {
00038 friend class Job;
00039 friend class CountRef<JobStatus>;
00040 public:
00041
00043 enum Code {
00044 UNDEF = 0,
00045 SUBMITTED,
00046 WAITING,
00047 READY,
00048 SCHEDULED,
00049 RUNNING,
00050 DONE,
00051 CLEARED,
00052 ABORTED,
00053 CANCELLED,
00054 UNKNOWN,
00055 PURGED,
00056 CODE_MAX
00057 };
00058
00064 enum Attr {
00066 ACL,
00068 CANCEL_REASON,
00070 CANCELLING,
00072 CE_NODE,
00074 CHILDREN,
00076 CHILDREN_HIST,
00078 CHILDREN_NUM,
00080 CHILDREN_STATES,
00082 CONDOR_ID,
00084 CONDOR_JDL,
00086 CONDOR_JOB_EXIT_STATUS,
00088 CONDOR_NOTIFICATION,
00090 CONDOR_OWNER,
00092 CONDOR_PID,
00094 CONDOR_SHADOW_EXIT_STATUS,
00096 CONDOR_STARTER_EXIT_STATUS,
00098 CONDOR_STATUS,
00100 CONDOR_UNIVERSE,
00102 CPU_TIME,
00104 DESTINATION,
00106 DONE_CODE,
00108 EXIT_CODE,
00110 EXPECT_FROM,
00112 EXPECT_UPDATE,
00114 GLOBUS_ID,
00116 JDL,
00118 JOB_ID,
00120 JOBTYPE,
00122 LAST_UPDATE_TIME,
00124 LOCAL_ID,
00126 LOCATION,
00128 MATCHED_JDL,
00130 NETWORK_SERVER,
00132 OWNER,
00134 PARENT_JOB,
00136 PAYLOAD_RUNNING,
00138 PBS_DEST_HOST,
00140 PBS_ERROR_DESC,
00142 PBS_EXIT_STATUS,
00144 PBS_NAME,
00146 PBS_OWNER,
00148 PBS_PID,
00150 PBS_QUEUE,
00152 PBS_REASON,
00154 PBS_RESOURCE_USAGE,
00156 PBS_SCHEDULER,
00158 PBS_STATE,
00160 POSSIBLE_CE_NODES,
00162 POSSIBLE_DESTINATIONS,
00164 REASON,
00166 RESUBMITTED,
00168 RSL,
00170 SEED,
00172 STATE_ENTER_TIME,
00174 STATE_ENTER_TIMES,
00176 SUBJOB_FAILED,
00178 SUSPEND_REASON,
00180 SUSPENDED,
00182 USER_TAGS,
00183 ATTR_MAX
00184 };
00185
00186 enum {
00187 DONE_CODE_OK,
00188 DONE_CODE_FAILED,
00189 DONE_CODE_CANCELLED,
00190 };
00191 enum {
00192 JOBTYPE_SIMPLE,
00193 JOBTYPE_DAG,
00194 JOBTYPE_COLLECTION,
00195 JOBTYPE_PBS,
00196 JOBTYPE_CONDOR,
00197 };
00203 enum AttrType { INT_T,
00204 STRING_T,
00205 TIMEVAL_T,
00206 BOOL_T,
00207 JOBID_T,
00208 INTLIST_T,
00209 STRLIST_T,
00210 TAGLIST_T,
00211 STSLIST_T
00212 };
00213
00219 Code status;
00220
00225 const std::string & name(void) const;
00226
00234 int getValInt(Attr name) const;
00235
00243 std::string getValString(Attr name) const;
00244
00252 struct timeval getValTime(Attr name) const;
00253
00261 const glite::wmsutils::jobid::JobId getValJobId(Attr name) const;
00262
00270 bool getValBool(Attr name) const;
00271
00279 const std::vector<int> getValIntList(Attr name) const;
00280
00288 const std::vector<std::string> getValStringList(Attr name) const;
00289
00297 const std::vector<std::pair<std::string,std::string> > getValTagList(Attr name) const;
00298
00306 const std::vector<JobStatus> getValJobStatusList(Attr name) const;
00307
00315 static const std::string& getAttrName(Attr name);
00316
00324 const std::vector<std::pair<Attr,AttrType> >& getAttrs(void) const;
00325
00334 static const std::string &getStateName(Code state);
00335
00340 JobStatus(void);
00341
00349 JobStatus(const JobStatus &orig);
00350
00358 JobStatus & operator=(const JobStatus &orig);
00359
00365 JobStatus(const edg_wll_JobStat &src);
00366
00372 JobStatus & operator=(const edg_wll_JobStat& src);
00373
00378 virtual ~JobStatus();
00379
00380 protected:
00381 edg_wll_JobStat *c_ptr(void);
00382
00383 private:
00384 static void destroyFlesh(void *);
00385 CountRef<JobStatus> *flesh;
00386 };
00387
00388 EWL_END_NAMESPACE;
00389
00390 #endif
00391