// logger.debug("insertCommand: id = "+ cmd.getId() + " name = " +
// cmd.getName()+ " category = " + cmd.getCategory() +
// " failureReason = " + cmd.getFailureReason() + " description = " +
// cmd.getDescription());
EventCREAMStore event = new EventCREAMStore();
switch (phase) {
case START:
event.setResult(EventCREAMStore.Result.START);
break;
case OK:
event.setResult(EventCREAMStore.Result.OK);
break;
case FAILED:
event.setResult(EventCREAMStore.Result.FAILED);
event.setReason(reason.getMessage());
break;
}
event.setCmdid(""+cmd.getId());
if (JobCommandConstant.JOB_START.equals(cmd.getName())) {
event.setCommand(EventCREAMStore.Command.CMDSTART);
} else if(JobCommandConstant.JOB_CANCEL.equals(cmd.getName())) {
event.setCommand(EventCREAMStore.Command.CMDCANCEL);
} else if(JobCommandConstant.JOB_PURGE.equals(cmd.getName())) {
event.setCommand(EventCREAMStore.Command.CMDPURGE);
} else if(JobCommandConstant.JOB_SUSPEND.equals(cmd.getName())) {
event.setCommand(EventCREAMStore.Command.CMDSUSPEND);
} else if(JobCommandConstant.JOB_RESUME.equals(cmd.getName())) {
event.setCommand(EventCREAMStore.Command.CMDRESUME);
} else {
throw new LBException("LBLogger.insertCommand(): not handled " + cmd.getName());
}
ctx.log(event);