Back to index

nordugrid-arc-nox  1.1.0~rc6
JobStateBES.cpp
Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #include <config.h>
00003 #endif
00004 
00005 #include <arc/StringConv.h>
00006 
00007 #include "JobStateBES.h"
00008 
00009 namespace Arc {
00010 
00011   JobState::StateType JobStateBES::StateMap(const std::string& state) {
00012     std::string state_ = Arc::lower(state);
00013     if (state_ == "pending")
00014       return JobState::ACCEPTED;
00015     else if (state_ == "running")
00016       return JobState::RUNNING;
00017     else if (state_ == "finished")
00018       return JobState::FINISHED;
00019     else if (state_ == "cancelled")
00020       return JobState::KILLED;
00021     else if (state_ == "failed")
00022       return JobState::FAILED;
00023     else
00024       return JobState::UNDEFINED;
00025   }
00026 
00027 }