1 package org
.argeo
.slc
.core
.process
;
5 import org
.springframework
.ws
.client
.core
.WebServiceTemplate
;
6 import org
.springframework
.ws
.soap
.client
.SoapFaultClientException
;
8 import org
.apache
.commons
.logging
.Log
;
9 import org
.apache
.commons
.logging
.LogFactory
;
11 import org
.argeo
.slc
.msg
.process
.SlcExecutionRequest
;
12 import org
.argeo
.slc
.msg
.process
.SlcExecutionStepsRequest
;
13 import org
.argeo
.slc
.ws
.client
.WebServiceUtils
;
15 public class WebServiceSlcExecutionNotifier
implements SlcExecutionNotifier
{
16 private WebServiceTemplate template
;
18 private Log log
= LogFactory
.getLog(getClass());
20 public void newExecution(SlcExecution slcExecution
) {
21 SlcExecutionRequest req
= new SlcExecutionRequest();
22 req
.setSlcExecution(slcExecution
);
24 WebServiceUtils
.marshalSendAndReceive(template
, req
);
25 if (log
.isTraceEnabled())
26 log
.trace("Notified creation of slc execution "
27 + slcExecution
.getUuid());
28 } catch (SoapFaultClientException e
) {
29 WebServiceUtils
.manageSoapException(e
);
33 public void updateExecution(SlcExecution slcExecution
) {
34 SlcExecutionRequest req
= new SlcExecutionRequest();
35 req
.setSlcExecution(slcExecution
);
37 WebServiceUtils
.marshalSendAndReceive(template
, req
);
38 if (log
.isTraceEnabled())
39 log
.trace("Notified update of slc execution "
40 + slcExecution
.getUuid());
41 } catch (SoapFaultClientException e
) {
42 WebServiceUtils
.manageSoapException(e
);
46 public void addSteps(SlcExecution slcExecution
,
47 List
<SlcExecutionStep
> additionalSteps
) {
48 SlcExecutionStepsRequest req
= new SlcExecutionStepsRequest();
49 req
.setSlcExecutionUuid(slcExecution
.getUuid());
50 req
.setSteps(additionalSteps
);
51 if (log
.isTraceEnabled()) {
52 for (SlcExecutionStep step
: additionalSteps
) {
53 log
.trace("Step " + step
.getUuid() + ": " + step
.logAsString());
58 WebServiceUtils
.marshalSendAndReceive(template
, req
);
59 if (log
.isTraceEnabled())
60 log
.trace("Added steps to slc execution "
61 + slcExecution
.getUuid());
62 } catch (SoapFaultClientException e
) {
63 WebServiceUtils
.manageSoapException(e
);
67 public void setTemplate(WebServiceTemplate template
) {
68 this.template
= template
;