- SlcExecutionRequest msg = (SlcExecutionRequest) requestObject;
- SlcExecution slcExecution = msg.getSlcExecution();
-
- if (slcExecutionDao.getSlcExecution(slcExecution.getUuid()) == null) {
- slcExecutionDao.create(slcExecution);
-
- if (log.isDebugEnabled())
- log.debug("Created SlcExecution with uuid "
- + slcExecution.getUuid());
- } else {
+ if (requestObject instanceof SlcExecutionRequest) {
+
+ SlcExecutionRequest msg = (SlcExecutionRequest) requestObject;
+ SlcExecution slcExecution = msg.getSlcExecution();
+
+ if (slcExecutionDao.getSlcExecution(slcExecution.getUuid()) == null) {
+ if (log.isDebugEnabled())
+ log.debug("Creating SLC execution #"
+ + slcExecution.getUuid());
+
+ slcExecutionDao.create(slcExecution);
+ } else {
+ if (log.isDebugEnabled())
+ log.debug("Updating SLC execution #"
+ + slcExecution.getUuid());
+
+ slcExecutionDao.update(slcExecution);
+ }
+ return null;
+
+ } else if (requestObject instanceof SlcExecutionStatusRequest) {
+ SlcExecutionStatusRequest msg = (SlcExecutionStatusRequest) requestObject;
+ SlcExecution slcExecution = slcExecutionDao.getSlcExecution(msg
+ .getSlcExecutionUuid());
+ if (slcExecution == null)
+ throw new SlcException("Could not find SLC execution #"
+ + msg.getSlcExecutionUuid());
+
+ slcExecution.setStatus(msg.getNewStatus());