- if (response != null) {
- Long responseId = response.getResponseId();
- LOG.info("Response-Id {}", responseId);
- if (response.getResponseType() instanceof NoPathCase) {
- NoPathCase noPathCase = (NoPathCase) response.getResponseType();
- LOG.info("No path feasible {}", noPathCase.toString());
- } else if (response.getResponseType() instanceof PathCase) {
- PathCase pathCase = (PathCase) response.getResponseType();
- List<PathMetric> pathMetricList = pathCase.getPathProperties().getPathMetric();
- for (PathMetric pathMetric : pathMetricList) {
- String metricType = pathMetric.getMetricType().getSimpleName();
- BigDecimal accumulativeValue = pathMetric.getAccumulativeValue();
- LOG.info("Metric type {} // AccumulatriveValue {}", metricType, accumulativeValue);
- }
-
- // Includes the list of nodes in the GNPy computed path as constraints for the PCE
- List<OrderedHops> orderedHopsList = null;
- List<PathRouteObjects> pathRouteObjectList = pathCase.getPathProperties().getPathRouteObjects();
- int counter = 0;
- for (PathRouteObjects pathRouteObjects : pathRouteObjectList) {
- if (pathRouteObjects.getPathRouteObject().getType() instanceof NumUnnumHop) {
- NumUnnumHop numUnnumHop = (NumUnnumHop) pathRouteObjects.getPathRouteObject().getType();
- String nodeId = numUnnumHop.getNodeId();
+ // Includes the list of nodes in the GNPy computed path as constraints
+ // for the PCE
+ List<OrderedHops> orderedHopsList = new ArrayList<>();
+ int counter = 0;
+ for (PathRouteObjects pathRouteObjects : pathRouteObjectList) {
+ if (pathRouteObjects.getPathRouteObject().getType() instanceof NumUnnumHop) {
+ NumUnnumHop numUnnumHop = (org.opendaylight.yang.gen.v1.gnpy.path.rev200909.explicit.route.hop.type
+ .NumUnnumHop) pathRouteObjects.getPathRouteObject().getType();
+ String nodeIp = numUnnumHop.getNumUnnumHop().getNodeId();
+ try {
+ IpAddress nodeIpAddress = new IpAddress(new Ipv4Address(nodeIp));
+ // find the corresponding node-id (in ord-ntw) corresponding to nodeId (in gnpy response)
+ String nodeId = findOrdNetworkNodeId(nodeIpAddress);
+ if (nodeId != null) {