Bump upstream dependencies to Ca
[transportpce.git] / renderer / src / main / java / org / opendaylight / transportpce / renderer / provisiondevice / tasks / OlmPowerSetupTask.java
index 37e17cbfc177b55be11a65d4832019d38143f363..1f1badc54b7785c96d2f926989bf7cb3520b50b5 100644 (file)
@@ -7,13 +7,15 @@
  */
 package org.opendaylight.transportpce.renderer.provisiondevice.tasks;
 
+import static java.util.Objects.requireNonNull;
+
 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.http.org.opendaylight.transportpce.olm.rev210618.ServicePowerSetup;
 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,17 +24,17 @@ public class OlmPowerSetupTask implements Callable<OLMRenderingResult> {
 
     private static final Logger LOG = LoggerFactory.getLogger(OlmPowerSetupTask.class);
 
-    private final TransportpceOlmService olmService;
+    private final ServicePowerSetup servicePowerSetup;
     private final ServicePowerSetupInput input;
 
-    public OlmPowerSetupTask(TransportpceOlmService olmService, ServicePowerSetupInput input) {
-        this.olmService = olmService;
+    public OlmPowerSetupTask(ServicePowerSetup servicePowerSetup, ServicePowerSetupInput input) {
+        this.servicePowerSetup = requireNonNull(servicePowerSetup);
         this.input = input;
     }
 
     @Override
     public OLMRenderingResult call() throws Exception {
-        Future<RpcResult<ServicePowerSetupOutput>> fr = this.olmService.servicePowerSetup(this.input);
+        Future<RpcResult<ServicePowerSetupOutput>> fr = servicePowerSetup.invoke(this.input);
         RpcResult<ServicePowerSetupOutput> result = fr.get();
         if (result == null) {
             LOG.warn("Result is NULL");