*/
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;
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");