unsigned int i;
for (i=0; i<sizeof(cream_statNames)/sizeof(cream_statNames[0]); i++)
- if (strcasecmp(cream_statNames[i],name) == 0) return (enum edg_wll_StatCream_state) i;
+ if (strcasecmp(cream_statNames[i]+strlen("CREAM_"),name) == 0) return (enum edg_wll_StatCream_state) i;
return (enum edg_wll_StatCream_state) -1;
}
char *edg_wll_CreamStatToString(enum edg_wll_StatCream_state statCode)
{
if ((int)statCode < 0 || statCode >= sizeof(cream_statNames)/sizeof(cream_statNames[0])) return (char *) NULL;
- return strdup(cream_statNames[statCode]);
+ return strdup(cream_statNames[statCode]+strlen("CREAM_"));
}
static const char * const vm_statNames[] = {
case EDG_WLL_CREAMSTORE_CMDSTART:
if (e->CREAMStore.result == EDG_WLL_CREAMSTORE_OK) {
js->pub.state = EDG_WLL_JOB_WAITING;
- js->pub.cream_state = EDG_WLL_STAT_PENDING;
+ js->pub.cream_state = EDG_WLL_STAT_CREAM_PENDING;
}
break;
case EDG_WLL_CREAMSTORE_CMDSUSPEND:
if (USABLE(res, strict)) {
// BLAH -> LRMS
js->pub.state = EDG_WLL_JOB_SCHEDULED;
- js->pub.cream_state = EDG_WLL_STAT_IDLE;
+ js->pub.cream_state = EDG_WLL_STAT_CREAM_IDLE;
rep_cond(js->pub.cream_reason, e->CREAMCall.reason);
rep_cond(js->pub.reason, e->CREAMCall.reason);
}
if (USABLE(res, strict)) {
if (e->CREAMCancel.status_code == EDG_WLL_CANCEL_DONE) {
js->pub.state = EDG_WLL_JOB_CANCELLED;
- js->pub.cream_state = EDG_WLL_STAT_ABORTED;
+ js->pub.cream_state = EDG_WLL_STAT_CREAM_ABORTED;
}
rep(js->pub.cream_reason, e->CREAMCancel.reason);
rep(js->pub.reason, e->CREAMCancel.reason);
case EDG_WLL_EVENT_CREAMABORT:
if (USABLE(res, strict)) {
js->pub.state = EDG_WLL_JOB_ABORTED;
- js->pub.cream_state = EDG_WLL_STAT_ABORTED;
+ js->pub.cream_state = EDG_WLL_STAT_CREAM_ABORTED;
rep(js->pub.cream_reason, e->CREAMAbort.reason);
rep(js->pub.reason, e->CREAMAbort.reason);
}
{
switch (js->pub.cream_state = edg_wll_StringToCreamStat(e->CREAMStatus.new_state))
{
- case EDG_WLL_STAT_REGISTERED:
+ case EDG_WLL_STAT_CREAM_REGISTERED:
case EDG_WLL_NUMBER_OF_CREAM_STATES:
break;
- case EDG_WLL_STAT_PENDING: js->pub.state = EDG_WLL_JOB_WAITING; break;
- case EDG_WLL_STAT_IDLE: js->pub.state = EDG_WLL_JOB_SCHEDULED; break;
- case EDG_WLL_STAT_RUNNING:
+ case EDG_WLL_STAT_CREAM_PENDING: js->pub.state = EDG_WLL_JOB_WAITING; break;
+ case EDG_WLL_STAT_CREAM_IDLE: js->pub.state = EDG_WLL_JOB_SCHEDULED; break;
+ case EDG_WLL_STAT_CREAM_RUNNING:
js->pub.state = EDG_WLL_JOB_RUNNING;
js->pub.jw_status = EDG_WLL_STAT_WRAPPER_RUNNING;
break;
- case EDG_WLL_STAT_REALLY_RUNNING:
+ case EDG_WLL_STAT_CREAM_REALLY_RUNNING:
js->pub.state = EDG_WLL_JOB_RUNNING;
js->pub.jw_status = EDG_WLL_STAT_PAYLOAD_RUNNING;
break;
- case EDG_WLL_STAT_HELD: /* TODO */ break;
- case EDG_WLL_STAT_DONE_OK:
+ case EDG_WLL_STAT_CREAM_HELD: /* TODO */ break;
+ case EDG_WLL_STAT_CREAM_DONE_OK:
js->pub.state = EDG_WLL_JOB_DONE;
js->pub.done_code = EDG_WLL_STAT_OK;
js->pub.cream_done_code = EDG_WLL_STAT_OK;
break;
- case EDG_WLL_STAT_DONE_FAILED:
+ case EDG_WLL_STAT_CREAM_DONE_FAILED:
js->pub.state = EDG_WLL_JOB_DONE;
js->pub.done_code = EDG_WLL_STAT_FAILED;
js->pub.cream_done_code = EDG_WLL_STAT_FAILED;
break;
- case EDG_WLL_STAT_ABORTED: js->pub.state = EDG_WLL_JOB_ABORTED; break;
+ case EDG_WLL_STAT_CREAM_ABORTED: js->pub.state = EDG_WLL_JOB_ABORTED; break;
+ case EDG_WLL_STAT_CREAM_CANCELLED: js->pub.state = EDG_WLL_JOB_CANCELLED; break;
+ case EDG_WLL_STAT_CREAM_PURGED: js->pub.state = EDG_WLL_JOB_CLEARED; break;
}
}
break;
case EDG_WLL_EVENT_REGJOB:
if (USABLE(res)) {
js->pub.state = EDG_WLL_JOB_SUBMITTED;
- js->pub.cream_state = EDG_WLL_STAT_REGISTERED;
+ js->pub.cream_state = EDG_WLL_STAT_CREAM_REGISTERED;
}
break;
case EDG_WLL_EVENT_CREAMSTART:
case EDG_WLL_CREAMSTORE_CMDSTART:
if (e->CREAMStore.result == EDG_WLL_CREAMSTORE_OK) {
js->pub.state = EDG_WLL_JOB_WAITING;
- js->pub.cream_state = EDG_WLL_STAT_PENDING;
+ js->pub.cream_state = EDG_WLL_STAT_CREAM_PENDING;
}
break;
case EDG_WLL_CREAMSTORE_CMDSUSPEND:
if (USABLE(res)) {
// BLAH -> LRMS
js->pub.state = EDG_WLL_JOB_SCHEDULED;
- js->pub.cream_state = EDG_WLL_STAT_IDLE;
+ js->pub.cream_state = EDG_WLL_STAT_CREAM_IDLE;
rep_cond(js->pub.cream_reason, e->CREAMCall.reason);
rep_cond(js->pub.reason, e->CREAMCall.reason);
}
rep_cond(js->pub.cream_reason, e->CREAMCall.reason);
rep_cond(js->pub.reason, e->CREAMCall.reason);
}
+ if (e->CREAMCall.command == EDG_WLL_CREAMCALL_CMDPURGE &&
+ e->CREAMCall.result == EDG_WLL_CREAMCALL_OK)
+ {
+ if (USABLE(res)){
+ js->pub.state = EDG_WLL_JOB_CLEARED;
+ js->pub.cream_state = EDG_WLL_STAT_CREAM_PURGED;
+ }
+ rep_cond(js->pub.cream_reason, e->CREAMCall.reason);
+ rep_cond(js->pub.reason, e->CREAMCall.reason);
+ }
break;
case EDG_WLL_EVENT_CREAMCANCEL:
if (USABLE(res)) {
if (e->CREAMCancel.status_code == EDG_WLL_CANCEL_DONE) {
js->pub.state = EDG_WLL_JOB_CANCELLED;
- js->pub.cream_state = EDG_WLL_STAT_ABORTED;
+ js->pub.cream_state = EDG_WLL_STAT_CREAM_ABORTED;
}
}
if (USABLE_DATA(res)) {
case EDG_WLL_EVENT_CREAMABORT:
if (USABLE(res)) {
js->pub.state = EDG_WLL_JOB_ABORTED;
- js->pub.cream_state = EDG_WLL_STAT_ABORTED;
+ js->pub.cream_state = EDG_WLL_STAT_CREAM_ABORTED;
}
if (USABLE_DATA(res)) {
rep(js->pub.cream_reason, e->CREAMAbort.reason);
switch (js->pub.cream_state = edg_wll_StringToCreamStat(e->CREAMStatus.new_state))
{
/* XXX: should not arrive */
- case EDG_WLL_STAT_REGISTERED:
+ case EDG_WLL_STAT_CREAM_REGISTERED:
case EDG_WLL_NUMBER_OF_CREAM_STATES:
break;
- case EDG_WLL_STAT_PENDING: js->pub.state = EDG_WLL_JOB_WAITING; break;
- case EDG_WLL_STAT_IDLE: js->pub.state = EDG_WLL_JOB_SCHEDULED; break;
- case EDG_WLL_STAT_RUNNING:
+ case EDG_WLL_STAT_CREAM_PENDING: js->pub.state = EDG_WLL_JOB_WAITING; break;
+ case EDG_WLL_STAT_CREAM_IDLE: js->pub.state = EDG_WLL_JOB_SCHEDULED; break;
+ case EDG_WLL_STAT_CREAM_RUNNING:
js->pub.state = EDG_WLL_JOB_RUNNING;
js->pub.jw_status = EDG_WLL_STAT_WRAPPER_RUNNING;
break;
- case EDG_WLL_STAT_REALLY_RUNNING:
+ case EDG_WLL_STAT_CREAM_REALLY_RUNNING:
js->pub.state = EDG_WLL_JOB_RUNNING;
js->pub.jw_status = EDG_WLL_STAT_PAYLOAD_RUNNING;
break;
- case EDG_WLL_STAT_HELD: /* TODO */ break;
- case EDG_WLL_STAT_DONE_OK:
+ case EDG_WLL_STAT_CREAM_HELD: /* TODO */ break;
+ case EDG_WLL_STAT_CREAM_DONE_OK:
js->pub.state = EDG_WLL_JOB_DONE;
js->pub.done_code = EDG_WLL_STAT_OK;
js->pub.cream_done_code = EDG_WLL_STAT_OK;
break;
- case EDG_WLL_STAT_DONE_FAILED:
+ case EDG_WLL_STAT_CREAM_DONE_FAILED:
js->pub.state = EDG_WLL_JOB_DONE;
js->pub.done_code = EDG_WLL_STAT_FAILED;
js->pub.cream_done_code = EDG_WLL_STAT_FAILED;
break;
- case EDG_WLL_STAT_ABORTED: js->pub.state = EDG_WLL_JOB_ABORTED; break;
+ case EDG_WLL_STAT_CREAM_CANCELLED: js->pub.state = EDG_WLL_JOB_CANCELLED; break;
+ case EDG_WLL_STAT_CREAM_ABORTED: js->pub.state = EDG_WLL_JOB_ABORTED; break;
+ case EDG_WLL_STAT_CREAM_PURGED: js->pub.state = EDG_WLL_JOB_CLEARED; break;
}
}
break;
int cream_state CREAM job state
_null_ -1
- _code_ REGISTERED registered
- _code_ PENDING pending
- _code_ IDLE idle
- _code_ RUNNING running
- _code_ REALLY-RUNNING really-running
- _code_ HELD held
- _code_ DONE-OK done-ok
- _code_ DONE-FAILED done-failed
- _code_ ABORTED aborted
+ _code_ CREAM_REGISTERED registered
+ _code_ CREAM_PENDING pending
+ _code_ CREAM_IDLE idle
+ _code_ CREAM_RUNNING running
+ _code_ CREAM_REALLY-RUNNING really-running
+ _code_ CREAM_HELD held
+ _code_ CREAM_DONE-OK done-ok
+ _code_ CREAM_DONE-FAILED done-failed
+ _code_ CREAM_ABORTED aborted
+ _code_ CREAM_CANCELLED cancelled
+ _code_ CREAM_PURGED purged
string cream_id CREAM local job id
string cream_owner Job owner