* static methods to retrieve status and event names
authorMichal Voců <michal@ruk.cuni.cz>
Mon, 16 Apr 2007 10:30:00 +0000 (10:30 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Mon, 16 Apr 2007 10:30:00 +0000 (10:30 +0000)
org.glite.lb.client/src/Event.cpp.T
org.glite.lb.client/src/JobStatus.cpp.T

index 0402a80..cef4016 100644 (file)
@@ -328,6 +328,17 @@ std::vector<std::pair<Event::Attr,Event::AttrType> > const & Event::getAttrs(voi
 }
 
 
+const std::string Event::getEventName(Type type)
+{
+       if(type < 0 || type >= TYPE_MAX) {
+               STACK_ADD;
+               throw(Exception(EXCEPTION_MANDATORY, EINVAL, "invalid event type"));
+       }
+
+       return std::string(edg_wll_EventToString(edg_wll_EventCode(type)));
+}
+
+
 void 
 Event::destroyFlesh(void *in) 
 {
index 62559e0..fe09bce 100644 (file)
@@ -468,6 +468,19 @@ JobStatus::getAttrs(void) const
   return attrs;
 }
 
+const std::string &
+JobStatus::getStateName(Code state)
+{
+  if (state<0 || state>=CODE_MAX) {
+    STACK_ADD;
+    throw(Exception(EXCEPTION_MANDATORY, 
+                   EINVAL,
+                   "status code invalid"));
+  }
+  return names[state];
+}
+
+
 void 
 JobStatus::destroyFlesh(void *p)
 {