]> git.argeo.org Git - gpl/argeo-slc.git/blob - org.argeo.slc.server/src/main/java/org/argeo/slc/ws/process/SlcExecutionStepsRequestEp.java
Prepare for release candidate
[gpl/argeo-slc.git] / org.argeo.slc.server / src / main / java / org / argeo / slc / ws / process / SlcExecutionStepsRequestEp.java
1 package org.argeo.slc.ws.process;
2
3 import org.apache.commons.logging.Log;
4 import org.apache.commons.logging.LogFactory;
5 import org.argeo.slc.core.process.SlcExecutionStep;
6 import org.argeo.slc.dao.process.SlcExecutionDao;
7 import org.argeo.slc.msg.process.SlcExecutionStepsRequest;
8 import org.springframework.ws.server.endpoint.AbstractMarshallingPayloadEndpoint;
9
10 public class SlcExecutionStepsRequestEp extends
11 AbstractMarshallingPayloadEndpoint {
12
13 private Log log = LogFactory.getLog(getClass());
14
15 private final SlcExecutionDao slcExecutionDao;
16
17 public SlcExecutionStepsRequestEp(SlcExecutionDao slcExecutionDao) {
18 this.slcExecutionDao = slcExecutionDao;
19 }
20
21 @Override
22 protected Object invokeInternal(Object requestObject) throws Exception {
23 String uuid = null;
24 try {
25 SlcExecutionStepsRequest msg = (SlcExecutionStepsRequest) requestObject;
26 uuid = msg.getSlcExecutionUuid();
27 if (log.isTraceEnabled()) {
28 log.trace("Trying to add additional steps to SLC execution #"
29 + uuid + ":");
30 for (SlcExecutionStep step : msg.getSteps()) {
31 log.trace("Step " + step.getUuid() + " (in SLC execution #"
32 + uuid + ")");
33 }
34 log.trace("Adding " + msg.getSteps().size()
35 + " steps to SLC execution #" + uuid);
36 }
37
38 slcExecutionDao.addSteps(uuid, msg.getSteps());
39 return null;
40 } catch (Exception e) {
41 log.error("Could not update SLC execution #" + uuid
42 + " with additional steps", e);
43 throw e;
44 }
45 }
46
47 }