Add customer name to pathComputationRequest input
[transportpce.git] / pce / src / main / java / org / opendaylight / transportpce / pce / gnpy / GnpyResult.java
index 70d1a46f4c456070af1bbe33b5b1cfc297360fd0..bfe3acc6850fb175bdffcad8f86ddd4f1f3495de 100644 (file)
@@ -8,24 +8,22 @@
 
 package org.opendaylight.transportpce.pce.gnpy;
 
-import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.Result;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.explicit.route.hop.type.NumUnnumHop;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.generic.path.properties.path.properties.PathMetric;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.generic.path.properties.path.properties.PathRouteObjects;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.result.Response;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.result.response.response.type.NoPathCase;
-import org.opendaylight.yang.gen.v1.gnpy.path.rev220221.result.response.response.type.PathCase;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev181130.NodeIdType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.General;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.GeneralBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.general.Include;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.constraints.co.routing.or.general.general.IncludeBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.HardConstraints;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constrains.rev190329.routing.constraints.HardConstraintsBuilder;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.Result;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.explicit.route.hop.type.NumUnnumHop;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.generic.path.properties.path.properties.PathMetric;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.generic.path.properties.path.properties.PathRouteObjects;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.result.Response;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.result.response.response.type.NoPathCase;
+import org.opendaylight.yang.gen.v1.gnpy.path.rev220615.result.response.response.type.PathCase;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.node.types.rev210528.NodeIdType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.constraints.Include;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.constraints.IncludeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.routing.constraints.HardConstraints;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.routing.constraints.rev221209.routing.constraints.HardConstraintsBuilder;
+import org.opendaylight.yangtools.yang.common.Decimal64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -50,7 +48,6 @@ public class GnpyResult {
         }
         LOG.info("The response id is {}; ", responses.get(0).getResponseId());
         this.response = responses.get(0);
-        analyzeResult();
     }
 
     public boolean getPathFeasibility() {
@@ -80,8 +77,8 @@ public class GnpyResult {
                             .getPathProperties().nonnullPathMetric().values();
                     LOG.info("GNPy : path is not feasible : {}", noPathType);
                     for (PathMetric pathMetric : pathMetricList) {
-                        String metricType = pathMetric.getMetricType().getSimpleName();
-                        BigDecimal accumulativeValue = pathMetric.getAccumulativeValue();
+                        String metricType = pathMetric.getMetricType().toString();
+                        Decimal64 accumulativeValue = pathMetric.getAccumulativeValue();
                         LOG.info("Metric type {} // AccumulatriveValue {}", metricType, accumulativeValue);
                     }
                 }
@@ -92,8 +89,8 @@ public class GnpyResult {
                         .getPathProperties().nonnullPathMetric().values();
                 // Path metrics
                 for (PathMetric pathMetric : pathMetricList) {
-                    String metricType = pathMetric.getMetricType().getSimpleName();
-                    BigDecimal accumulativeValue = pathMetric.getAccumulativeValue();
+                    String metricType = pathMetric.getMetricType().toString();
+                    Decimal64 accumulativeValue = pathMetric.getAccumulativeValue();
                     LOG.info("Metric type {} // AccumulatriveValue {}", metricType, accumulativeValue);
                 }
                 // Path route objects
@@ -120,8 +117,7 @@ public class GnpyResult {
         }
 
         Include include = new IncludeBuilder().setNodeId(nodeIdList).build();
-        General general = new GeneralBuilder().setInclude(include).build();
-        hardConstraints = new HardConstraintsBuilder().setCoRoutingOrGeneral(general).build();
+        hardConstraints = new HardConstraintsBuilder().setInclude(include).build();
         return hardConstraints;
     }