package org.opendaylight.transportpce.pce.gnpy;
import java.util.List;
-
import org.opendaylight.transportpce.common.network.NetworkTransactionService;
import org.opendaylight.transportpce.pce.constraints.PceConstraints;
import org.opendaylight.yang.gen.v1.gnpy.gnpy.api.rev190103.GnpyApi;
import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.service.PathRequest;
import org.opendaylight.yang.gen.v1.gnpy.path.rev200202.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.rev171017.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev171017.path.description.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev200629.path.description.AToZDirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev200629.path.description.AToZDirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev200629.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.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.Uint32;
public class GnpyUtilitiesImpl {
- private static final Logger LOG = LoggerFactory.getLogger(GnpyResult.class);
+ private static final Logger LOG = LoggerFactory.getLogger(GnpyUtilitiesImpl.class);
private NetworkTransactionService networkTransaction;
private PathComputationRequestInput input;
private GnpyTopoImpl gnpyTopo = null;
synchronizationList);
// Analyze the response
if (gnpyResponse == null) {
- throw new GnpyException("In GnpyUtilities: no respnse from GNPy server");
+ throw new GnpyException("In GnpyUtilities: no response from GNPy server");
}
GnpyResult result = new GnpyResult(gnpyResponse, gnpyTopo);
result.analyzeResult();
return result;
}
- public HardConstraints askNewPathFromGnpy(HardConstraints gnpyPathAsHC, PceConstraints pceHardConstraints)
+ public HardConstraints askNewPathFromGnpy(PceConstraints pceHardConstraints)
throws GnpyException, Exception {
AToZDirection atoztmp = new AToZDirectionBuilder()
GnpyResult result = gnpyResponseOneDirection(gnpySvc);
if (result == null) {
- throw new GnpyException("In GnpyUtilities: no response from the GNPy server");
+ throw new GnpyException("In GnpyUtilities: no result from the GNPy server");
}
if (!result.getPathFeasibility()) {
return null;
}
List<PathRouteObjects> pathRouteObjectList = result.analyzeResult();
- gnpyPathAsHC = result.computeHardConstraintsFromGnpyPath(pathRouteObjectList);
-
- return gnpyPathAsHC;
+ return result.computeHardConstraintsFromGnpyPath(pathRouteObjectList);
}
public String getGnpyResponse(List<Elements> elementsList, List<Connections> connectionsList,
.replace("gnpy-path-computation-simplified:", "")
.replace("gnpy-network-topology:", "");
- String gnpyResponse = connect.gnpyCnx(gnpyJsonModified);
- return gnpyResponse;
+ return connect.returnGnpyResponse(gnpyJsonModified);
}
public GnpyResult getGnpyAtoZ() {