Back to index

nordugrid-arc-nox  1.1.0~rc6
job.h
Go to the documentation of this file.
00001 #ifndef SCHED_JOB
00002 #define SCHED_JOB
00003 
00004 #include <string>
00005 
00006 #include <arc/ByteArray.h>
00007 
00008 #include "job_request.h"
00009 #include "job_sched_meta.h"
00010 #include "job_status.h"
00011 
00012 namespace Arc {
00013 
00014 class Job {
00015 
00016     private:
00017         std::string id_;
00018         JobRequest *request_;
00019         JobSchedMetaData *sched_meta_;
00020         SchedJobStatus status_;
00021         // for serialization
00022         ByteArray buffer_;
00023     public:
00024         Job(void);
00025         Job(JobRequest &d, JobSchedMetaData &m);
00026         Job(ByteArray &buf); // unserialize
00027         ByteArray &serialize(void);
00028         ~Job(void);
00029         const std::string &getID(void) { return id_; };
00030         void setFailure(const std::string &f) { sched_meta_->setFailure(f); }
00031         const std::string &getFailure(void) { return sched_meta_->getFailure(); };
00032         void setStatus(SchedJobStatus s) { status_ = s; };
00033         SchedJobStatus getStatus(void) { return status_; };
00034         Arc::XMLNode &getJSDL(void) { return request_->getJSDL(); };
00035         JobSchedMetaData *getJobSchedMetaData(void) { return sched_meta_; };
00036         operator bool(void) { return (id_.empty() ? false : true ); };
00037         bool operator!(void) { return (id_.empty() ? true : false ); };
00038         operator std::string(void) const;
00039 };
00040 
00041 } // namespace Arc
00042 
00043 #endif // SCHED_JOB