Adapt TransportPCE code to Sulfur
[transportpce.git] / renderer / src / main / java / org / opendaylight / transportpce / renderer / provisiondevice / tasks / OlmPowerSetupTask.java
index aaf54a9a7a62b3d17884c619f6294f564a3e603d..37e17cbfc177b55be11a65d4832019d38143f363 100644 (file)
@@ -9,11 +9,11 @@ package org.opendaylight.transportpce.renderer.provisiondevice.tasks;
 
 import java.util.concurrent.Callable;
 import java.util.concurrent.Future;
-
+import org.opendaylight.transportpce.common.ResponseCodes;
 import org.opendaylight.transportpce.renderer.provisiondevice.OLMRenderingResult;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.OlmService;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.olm.rev170418.ServicePowerSetupOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerSetupInput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerSetupOutput;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.olm.rev210618.TransportpceOlmService;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -22,10 +22,10 @@ public class OlmPowerSetupTask implements Callable<OLMRenderingResult> {
 
     private static final Logger LOG = LoggerFactory.getLogger(OlmPowerSetupTask.class);
 
-    private final OlmService olmService;
+    private final TransportpceOlmService olmService;
     private final ServicePowerSetupInput input;
 
-    public OlmPowerSetupTask(OlmService olmService, ServicePowerSetupInput input) {
+    public OlmPowerSetupTask(TransportpceOlmService olmService, ServicePowerSetupInput input) {
         this.olmService = olmService;
         this.input = input;
     }
@@ -40,7 +40,7 @@ public class OlmPowerSetupTask implements Callable<OLMRenderingResult> {
         }
 
         LOG.debug("Result: {}", result.getResult());
-        if (result.isSuccessful()) {
+        if (ResponseCodes.SUCCESS_RESULT.equals(result.getResult().getResult())) {
             LOG.info("OLM power setup finished successfully");
             return OLMRenderingResult.ok();
         } else {