00001 #ifndef __EDG_WORKLOAD_LOGGING_JOBSTATUS__
00002 #define __EDG_WORKLOAD_LOGGING_JOBSTATUS__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "edg/workload/logging/client/CountRef.h"
00014 #include "edg/workload/common/jobid/JobId.h"
00015
00016 #include "edg/workload/common/jobid/jobid.h"
00017 #include <sys/time.h>
00018 #include "edg/workload/logging/client/jobstat.h"
00019
00020 #include <string>
00021 #include <utility>
00022 #include <vector>
00023
00024 EWL_BEGIN_NAMESPACE;
00025
00032 class JobStatus {
00033 friend class Job;
00034 friend class CountRef<JobStatus>;
00035 public:
00036 enum Code {
00037 UNDEF = 0,
00038 SUBMITTED,
00039 WAITING,
00040 READY,
00041 SCHEDULED,
00042 RUNNING,
00043 DONE,
00044 CLEARED,
00045 ABORTED,
00046 CANCELLED,
00047 UNKNOWN,
00048 PURGED,
00049 CODE_MAX
00050 };
00051
00052 enum Attr {
00054 ACL,
00056 CANCEL_REASON,
00058 CANCELLING,
00060 CE_NODE,
00062 CHILDREN,
00064 CHILDREN_HIST,
00066 CHILDREN_NUM,
00068 CHILDREN_STATES,
00070 CONDOR_ID,
00072 CONDOR_JDL,
00074 CPU_TIME,
00076 DESTINATION,
00078 DONE_CODE,
00080 EXIT_CODE,
00082 EXPECT_FROM,
00084 EXPECT_UPDATE,
00086 GLOBUS_ID,
00088 JDL,
00090 JOB_ID,
00092 JOBTYPE,
00094 LAST_UPDATE_TIME,
00096 LOCAL_ID,
00098 LOCATION,
00100 MATCHED_JDL,
00102 NETWORK_SERVER,
00104 OWNER,
00106 PARENT_JOB,
00108 REASON,
00110 RESUBMITTED,
00112 RSL,
00114 SEED,
00116 STATE_ENTER_TIME,
00118 STATE_ENTER_TIMES,
00120 SUBJOB_FAILED,
00122 USER_TAGS,
00123 ATTR_MAX
00124 };
00125
00126 enum {
00127 DONE_CODE_OK,
00128 DONE_CODE_FAILED,
00129 DONE_CODE_CANCELLED,
00130 };
00131 enum {
00132 JOBTYPE_SIMPLE,
00133 JOBTYPE_DAG,
00134 };
00135 enum AttrType { INT_T,
00136 STRING_T,
00137 TIMEVAL_T,
00138 BOOL_T,
00139 JOBID_T,
00140 INTLIST_T,
00141 STRLIST_T,
00142 TAGLIST_T,
00143 STSLIST_T
00144 };
00145
00147 Code status;
00148
00150 const std::string & name(void) const;
00151
00153 int getValInt(Attr) const;
00154
00156 std::string getValString(Attr) const;
00157
00159 struct timeval getValTime(Attr) const;
00160
00162 const edg::workload::common::jobid::JobId getValJobId(Attr) const;
00163
00165 bool getValBool(Attr) const;
00166
00168 const std::vector<int> getValIntList(Attr) const;
00169
00171 const std::vector<std::string> getValStringList(Attr) const;
00172
00174 const std::vector<std::pair<std::string,std::string> > getValTagList(Attr) const;
00175
00177 const std::vector<JobStatus> getValJobStatusList(Attr) const;
00178
00180 const std::string& getAttrName(Attr) const;
00181
00183 const std::vector<std::pair<Attr,AttrType> >& getAttrs(void) const;
00184
00185 JobStatus(void);
00186 JobStatus(const JobStatus &);
00187 JobStatus & operator=(const JobStatus &);
00188 JobStatus(const edg_wll_JobStat &);
00189 JobStatus & operator=(const edg_wll_JobStat&);
00190 virtual ~JobStatus();
00191
00192 protected:
00193 edg_wll_JobStat *c_ptr(void);
00194
00195 private:
00196 static void destroyFlesh(void *);
00197 CountRef<JobStatus> *flesh;
00198 };
00199
00200 EWL_END_NAMESPACE;
00201
00202 #endif
00203