X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.ws.client%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fws%2Fprocess%2FWebServiceSlcExecutionNotifier.java;h=133033bd1bc6bc16fb86136bf937f4dad15b054a;hb=5fcacdb600e4c9e765cb93b46132932662832c1b;hp=21bcf978a5c8c4c71d4d67e2c8af26ed6f97223d;hpb=2ba4a8dd1553afe92ccf67a75f7b503f7d239204;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/process/WebServiceSlcExecutionNotifier.java b/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/process/WebServiceSlcExecutionNotifier.java index 21bcf978a..133033bd1 100644 --- a/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/process/WebServiceSlcExecutionNotifier.java +++ b/runtime/org.argeo.slc.support.ws.client/src/main/java/org/argeo/slc/ws/process/WebServiceSlcExecutionNotifier.java @@ -1,15 +1,33 @@ +/* + * Copyright (C) 2010 Mathieu Baudier + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.argeo.slc.ws.process; import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.argeo.slc.core.process.SlcExecution; -import org.argeo.slc.core.process.SlcExecutionNotifier; -import org.argeo.slc.core.process.SlcExecutionStep; import org.argeo.slc.msg.process.SlcExecutionRequest; import org.argeo.slc.msg.process.SlcExecutionStatusRequest; import org.argeo.slc.msg.process.SlcExecutionStepsRequest; +import org.argeo.slc.execution.ExecutionStep; +import org.argeo.slc.execution.ExecutionProcess; +import org.argeo.slc.process.SlcExecution; +import org.argeo.slc.process.SlcExecutionNotifier; +import org.argeo.slc.process.SlcExecutionStep; import org.argeo.slc.ws.client.WebServiceUtils; import org.springframework.ws.client.WebServiceIOException; import org.springframework.ws.client.core.WebServiceTemplate; @@ -22,7 +40,8 @@ public class WebServiceSlcExecutionNotifier implements SlcExecutionNotifier { private Boolean cannotConnect = false; - public void newExecution(SlcExecution slcExecution) { + public void newExecution(ExecutionProcess process) { + SlcExecution slcExecution = (SlcExecution) process; if (cannotConnect) return; @@ -58,8 +77,9 @@ public class WebServiceSlcExecutionNotifier implements SlcExecutionNotifier { } } - public void updateStatus(SlcExecution slcExecution, String oldStatus, + public void updateStatus(ExecutionProcess process, String oldStatus, String newStatus) { + SlcExecution slcExecution = (SlcExecution) process; if (cannotConnect) return; @@ -77,20 +97,14 @@ public class WebServiceSlcExecutionNotifier implements SlcExecutionNotifier { } } - public void addSteps(SlcExecution slcExecution, - List additionalSteps) { + public void addSteps(ExecutionProcess process, + List additionalSteps) { + SlcExecution slcExecution = (SlcExecution) process; if (cannotConnect) return; - SlcExecutionStepsRequest req = new SlcExecutionStepsRequest(); - req.setSlcExecutionUuid(slcExecution.getUuid()); - req.setSteps(additionalSteps); - if (log.isTraceEnabled()) { - for (SlcExecutionStep step : additionalSteps) { - log.trace("Step " + step.getUuid() + ": " + step.logAsString()); - } - } - + SlcExecutionStepsRequest req = new SlcExecutionStepsRequest( + slcExecution.getUuid(), additionalSteps); try { WebServiceUtils.marshalSendAndReceive(template, req); if (log.isTraceEnabled())