Back to index

nordugrid-arc-nox  1.1.0~rc6
job_status.cpp
Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include <config.h>
00003 #endif
00004 
00005 #include "job_status.h"
00006 
00007 namespace Arc
00008 {
00009 
00010 std::string sched_status_to_string(SchedJobStatus l)
00011 {
00012     if (l == JOB_STATUS_SCHED_NEW) {
00013         return "NEW";
00014     } else if (l == JOB_STATUS_SCHED_STARTING) {
00015         return "STARTING";
00016     } else if (l == JOB_STATUS_SCHED_RUNNING) {
00017         return "RUNNING";
00018     } else if (l == JOB_STATUS_SCHED_CANCELLED) {
00019         return "CANCELLED";
00020     } else if (l == JOB_STATUS_SCHED_FAILED) {
00021         return "FAILED";
00022     } else if (l == JOB_STATUS_SCHED_FINISHED) {
00023         return "FINISHED";
00024     } else if (l == JOB_STATUS_SCHED_KILLED) {
00025         return "KILLED";
00026     } else if (l == JOB_STATUS_SCHED_KILLING) {
00027         return "KILLING";
00028     } else if (l == JOB_STATUS_SCHED_RESCHEDULED) {
00029         return "RESCHEDULED";
00030     }
00031 
00032     return "UNKNOWN";
00033 }
00034 
00035 SchedJobStatus sched_status_from_string(const std::string &s)
00036 {
00037     if (s == "NEW") { 
00038         return JOB_STATUS_SCHED_NEW;
00039     } else if (s == "STARTING") {
00040         return JOB_STATUS_SCHED_STARTING;
00041     } else if (s == "RUNNING") {
00042         return JOB_STATUS_SCHED_RUNNING;
00043     } else if (s == "CANCELLED") {
00044         return JOB_STATUS_SCHED_CANCELLED;
00045     } else if (s == "FAILED") { 
00046         return JOB_STATUS_SCHED_FAILED;
00047     } else if (s == "FINISHED") {
00048         return JOB_STATUS_SCHED_FINISHED;
00049     } else if (s == "KILLED") {
00050         return JOB_STATUS_SCHED_KILLED;
00051     } else if (s == "KILLING")  {
00052         return JOB_STATUS_SCHED_KILLING;
00053     } else if (s == "RESCHEDULED") {
00054         return JOB_STATUS_SCHED_RESCHEDULED;
00055     }
00056 
00057     return JOB_STATUS_SCHED_UNKNOWN;
00058 }
00059 
00060 ARexJobStatus arex_status_from_string(const std::string&)
00061 {
00062     return JOB_STATUS_AREX_UNKNOWN;
00063 }
00064 
00065 PaulJobStatus paul_status_from_string(const std::string&)
00066 {
00067     return JOB_STATUS_PAUL_UNKNOWN;
00068 }
00069 
00070 } // namespace Arc