X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=servicehandler%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fservicehandler%2Fservice%2FServiceDataStoreOperationsImpl.java;h=55533fb0e96c3b44a823eefb94f896303c999ad5;hb=1e2f9a502de80450411761fd2f636e2b7ee32301;hp=c9a4990833a42b5cfada29fb7485efee519679fd;hpb=ff9991f6b14ebf5e40062f3082aec2bf8b95e67a;p=transportpce.git diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperationsImpl.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperationsImpl.java index c9a499083..55533fb0e 100644 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperationsImpl.java +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperationsImpl.java @@ -23,7 +23,7 @@ import org.opendaylight.transportpce.common.OperationResult; import org.opendaylight.transportpce.common.Timeouts; import org.opendaylight.transportpce.servicehandler.ModelMappingUtils; import org.opendaylight.transportpce.servicehandler.ServiceInput; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestOutput; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev220118.PathComputationRequestOutput; import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State; import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.AdminStates; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput; @@ -35,7 +35,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.TempSer import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.ServicesBuilder; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.ServicesKey; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.path.PathDescription; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev220118.service.path.PathDescription; import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList; import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePaths; import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsBuilder; @@ -127,8 +127,23 @@ public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperation } @Override - public Optional getTempService(String serviceName) { + public Optional getServices() { + try { + ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction(); + InstanceIdentifier iid = + InstanceIdentifier.create(ServiceList.class); + Future> future = + readTx.read(LogicalDatastoreType.OPERATIONAL, iid); + return future.get(Timeouts.DATASTORE_READ, TimeUnit.MILLISECONDS); + } catch (InterruptedException | ExecutionException | TimeoutException e) { + LOG.warn("Reading services failed:", e); + } + return Optional.empty(); + } + + @Override + public Optional + getTempService(String serviceName) { try { ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction(); InstanceIdentifier getServicePath(String serviceName) { + @Override + public Optional getServicePath(String serviceName) { LOG.debug("Retrieving service path of service {}", serviceName); try { ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction(); @@ -346,9 +362,8 @@ public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperation .setFiberSpanSrlgs(readServicePath.get().getFiberSpanSrlgs()) .setHardConstraints(readServicePath.get().getHardConstraints()) .setLatency(readServicePath.get().getLatency()) - .setLocallyProtectedLinks(readServicePath.get().isLocallyProtectedLinks()) .setPathDescription(pathDescription) - .setPceMetric(readServicePath.get().getPceMetric()) + .setPceRoutingMetric(readServicePath.get().getPceRoutingMetric()) .setSoftConstraints(readServicePath.get().getSoftConstraints()) .build();