}
}
@Subscribe
public void setupTaskStatus(JobStatusChangeRequest jobStatus){
TaskState state=TaskState.UNKNOWN;
switch(jobStatus.getState()){
case ACTIVE:
state=TaskState.EXECUTING; break;
case CANCELED:
state=TaskState.CANCELED; break;
case COMPLETE:
state=TaskState.COMPLETED; break;
case FAILED:
state=TaskState.FAILED; break;
case HELD: case SUSPENDED: case QUEUED:
state=TaskState.WAITING; break;
case SETUP:
state=TaskState.PRE_PROCESSING; break;
case SUBMITTED:
state=TaskState.STARTED; break;
case UN_SUBMITTED:
state=TaskState.CANCELED; break;
case CANCELING:
state=TaskState.CANCELING; break;
default:
break;
}
logger.debug("Publishing Task Status "+state.toString());
monitorPublisher.publish(new TaskStatusChangeRequest(jobStatus.getIdentity(),state));
}