X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pce%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fpce%2Fgnpy%2FGnpyUtilitiesImpl.java;h=9ae44120c060c63cb3a6702951564bf43db9e254;hb=6ae7f17afc50195ff2449043e65341e28c1056e3;hp=a51f3495eb007da233e2fdb788e61fdd5e5ed2c0;hpb=952583aa9f0de2de04f230291a5989413591a7b7;p=transportpce.git diff --git a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImpl.java b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImpl.java index a51f3495e..9ae44120c 100644 --- a/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImpl.java +++ b/pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImpl.java @@ -14,21 +14,20 @@ import java.util.stream.Collectors; import org.opendaylight.transportpce.common.network.NetworkTransactionService; import org.opendaylight.transportpce.pce.constraints.PceConstraints; import org.opendaylight.transportpce.pce.gnpy.consumer.GnpyConsumer; -import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev190103.GnpyApi; -import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev190103.GnpyApiBuilder; -import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev190103.gnpy.api.ServiceFileBuilder; -import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev190103.gnpy.api.TopologyFileBuilder; -import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.Connections; -import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.topo.Elements; -import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.Result; -import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.generic.path.properties.path.properties.PathRouteObjects; -import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.service.PathRequest; -import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.synchronization.info.Synchronization; -import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInput; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.AToZDirection; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.AToZDirectionBuilder; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ZToADirection; -import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.HardConstraints; +import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev220221.RequestBuilder; +import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev220221.request.ServiceBuilder; +import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev220221.request.TopologyBuilder; +import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev220615.topo.Connections; +import org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev220615.topo.Elements; +import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.Result; +import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.generic.path.properties.path.properties.PathRouteObjects; +import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.service.PathRequest; +import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.synchronization.info.Synchronization; +import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev240205.PathComputationRequestInput; +import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.routing.constraints.HardConstraints; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.AToZDirection; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.AToZDirectionBuilder; +import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev230501.path.description.ZToADirection; import org.opendaylight.yangtools.yang.common.Uint32; /** @@ -75,7 +74,6 @@ public class GnpyUtilitiesImpl { return isPcePathFeasible; } - @SuppressWarnings("checkstyle:illegalcatch") public GnpyResult gnpyResponseOneDirection(GnpyServiceImpl gnpySvc) throws GnpyException { requestId = Uint32.valueOf((requestId.toJava()) + 1); List pathRequestList = new ArrayList<>(gnpySvc.getPathRequest().values()); @@ -115,19 +113,19 @@ public class GnpyUtilitiesImpl { } public Result getGnpyResponse(List elementsList, List connectionsList, - List pathRequestList, List synchronizationList) { - GnpyApi gnpyApi = new GnpyApiBuilder() - .setTopologyFile( - new TopologyFileBuilder() + List pathRequestList, List synchronizationList) { + + return gnpyConsumer.computePaths(new RequestBuilder() + .setTopology( + new TopologyBuilder() .setElements(elementsList.stream().collect(Collectors.toMap(Elements::key, element -> element))) .setConnections(connectionsList).build()) - .setServiceFile( - new ServiceFileBuilder() + .setService( + new ServiceBuilder() .setPathRequest(pathRequestList.stream() .collect(Collectors.toMap(PathRequest::key, pathRequest -> pathRequest))) .build()) - .build(); - return gnpyConsumer.computePaths(gnpyApi); + .build()); } public GnpyResult getGnpyAtoZ() {