NetworkModelListener: handling TopologyUpdates 15/93915/38
authorErrea Moreno, Javier <javier.errea_moreno@nokia.com>
Fri, 18 Dec 2020 13:45:03 +0000 (14:45 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Thu, 21 Jan 2021 11:09:26 +0000 (12:09 +0100)
- Update of service state affected by topology update
- Added state to PathDescription elements
- Update PathDescription according to topology update notification
- Fixed test_pce.py by adding state to link in tests 21 & 23

JIRA: TRNSPRTPCE-363
Change-Id: Ic7e6a2f2abdfb70361ac251e3d44dc8505910409
Signed-off-by: Javier <errea@eurecom.fr>
31 files changed:
api/src/main/yang/service_path/transportpce-pathDescription@2020-12-10.yang [moved from api/src/main/yang/service_path/transportpce-pathDescription@2020-11-26.yang with 93% similarity]
lighty/src/main/java/io/lighty/controllers/tpce/utils/TPCEUtils.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/service/FrequenciesService.java
networkmodel/src/main/java/org/opendaylight/transportpce/networkmodel/service/FrequenciesServiceImpl.java
ordmodels/device/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/syslog/rev161014/syslog/selector/log/selector/selector/facility/log/facility/LogFacilityFacilityBuilder.java [deleted file]
ordmodels/device/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/syslog/rev171215/syslog/selector/log/selector/selector/facility/log/facility/LogFacilityFacilityBuilder.java [deleted file]
pce/src/main/java/org/opendaylight/transportpce/pce/PcePathDescription.java
pce/src/main/java/org/opendaylight/transportpce/pce/PceSendingPceRPCs.java
pce/src/main/java/org/opendaylight/transportpce/pce/constraints/PceConstraintsCalc.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyServiceImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImpl.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/utils/AToZComparator.java
pce/src/main/java/org/opendaylight/transportpce/pce/gnpy/utils/ZToAComparator.java
pce/src/main/java/org/opendaylight/transportpce/pce/networkanalyzer/PceResult.java
pce/src/main/java/org/opendaylight/transportpce/pce/service/PathComputationServiceImpl.java
pce/src/test/java/org/opendaylight/transportpce/pce/gnpy/GnpyUtilitiesImplTest.java
pce/src/test/java/org/opendaylight/transportpce/pce/utils/PceTestData.java
pce/src/test/java/org/opendaylight/transportpce/pce/utils/PceTestUtils.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/ModelMappingUtils.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/RendererServiceOperationsImpl.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/ServiceDataUtils.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/ServiceDeleteDataUtils.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/NetworkModelListenerImpl.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/PceListenerImpl.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperations.java
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperationsImpl.java
servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/ModelMappingUtilsTest.java
servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/service/ServiceDataStoreOperationsImplTest.java
servicehandler/src/test/java/org/opendaylight/transportpce/servicehandler/utils/ServiceDataUtils.java
test-common/src/main/yang/path-description-stub@2020-12-11.yang
tests/transportpce_tests/1.2.1/test_pce.py

similarity index 93%
rename from api/src/main/yang/service_path/transportpce-pathDescription@2020-11-26.yang
rename to api/src/main/yang/service_path/transportpce-pathDescription@2020-12-10.yang
index b547d6aa3629a8cd568f16909f8de81b8d67893f..300906928547366f9276774fc28f0a525e4a8a1d 100644 (file)
@@ -7,6 +7,11 @@ module transportpce-pathDescription {
     revision-date 2020-05-29;
   }
 
+  import org-openroadm-common-state-types {
+    prefix org-openroadm-common-state-types;
+    revision-date 2019-11-29;
+  }
+
   organization
     "transportPCE";
   contact
@@ -42,11 +47,14 @@ module transportpce-pathDescription {
       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
       POSSIBILITY OF SUCH DAMAGE";
 
+  revision 2020-12-10 {
+        description
+          "Version 1.6.3. To add states in path description elements";
+  }
   revision 2020-11-26 {
         description
           "Version 1.6.2. To manage flexgrid";
   }
-
   revision 2020-06-29 {
     description
       "Version 1.6.1. To manage otn services";
@@ -90,6 +98,11 @@ module transportpce-pathDescription {
           }
         }
       }
+      leaf state {
+        type org-openroadm-common-state-types:state;
+        mandatory true;
+        description "Operational state of pce-resource";
+      }
     }
   }
 
index bae69c2560379d1d89edcebb809f07f6efafd4fc..ff76b3fb151d3f60b7c128f944a5536450d1f62c 100644 (file)
@@ -220,7 +220,7 @@ public final class TPCEUtils {
             org.opendaylight.yang.gen.v1.gnpy.path.rev200909.$YangModuleInfoImpl.getInstance(),
             org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev201012
                     .$YangModuleInfoImpl.getInstance(),
-            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126
+            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210
                     .$YangModuleInfoImpl.getInstance(),
             org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017
                     .$YangModuleInfoImpl.getInstance(),
index 8f6dd32c25a2f232786c30f12bb5f65fd5f9eb18..9494e565bf630bc34410f362eb3d4908abec2a92 100644 (file)
@@ -7,8 +7,8 @@
  */
 package org.opendaylight.transportpce.networkmodel.service;
 
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
+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.ZToADirection;
 
 public interface FrequenciesService {
 
index 645bd7f85b3336fdafe858b8ee139e2300e8fa6a..930642a981856a218649ce9b4cfad28f7321549f 100644 (file)
@@ -57,11 +57,11 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.a
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.available.freq.map.AvailFreqMapsBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.available.freq.map.AvailFreqMapsKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.xponder.rev200529.xpdr.port.connection.attributes.WavelengthBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPoint;
+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.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPoint;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
diff --git a/ordmodels/device/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/syslog/rev161014/syslog/selector/log/selector/selector/facility/log/facility/LogFacilityFacilityBuilder.java b/ordmodels/device/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/syslog/rev161014/syslog/selector/log/selector/selector/facility/log/facility/LogFacilityFacilityBuilder.java
deleted file mode 100644 (file)
index 13595d3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.opendaylight.yang.gen.v1.http.org.openroadm.syslog.rev161014.syslog.selector.log.selector.selector.facility.log.facility;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.syslog.rev161014.syslog.selector.log.selector.selector.facility.log.facility.LogFacility.Facility;
-
-/**
- * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
- * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
- *
- * The reason behind putting it under src/main/java is:
- * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
- * loss of user code.
- *
- */
-public class LogFacilityFacilityBuilder {
-
-    public static Facility getDefaultInstance(java.lang.String defaultValue) {
-        throw new java.lang.UnsupportedOperationException("Not yet implemented");
-    }
-
-}
diff --git a/ordmodels/device/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/syslog/rev171215/syslog/selector/log/selector/selector/facility/log/facility/LogFacilityFacilityBuilder.java b/ordmodels/device/src/main/java/org/opendaylight/yang/gen/v1/http/org/openroadm/syslog/rev171215/syslog/selector/log/selector/selector/facility/log/facility/LogFacilityFacilityBuilder.java
deleted file mode 100644 (file)
index 175e9a1..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.opendaylight.yang.gen.v1.http.org.openroadm.syslog.rev171215.syslog.selector.log.selector.selector.facility.log.facility;
-import java.lang.String;
-import java.lang.UnsupportedOperationException;
-
-/**
- * The purpose of generated class in src/main/java for Union types is to create new instances of unions from a string representation.
- * In some cases it is very difficult to automate it since there can be unions such as (uint32 - uint16), or (string - uint32).
- *
- * The reason behind putting it under src/main/java is:
- * This class is generated in form of a stub and needs to be finished by the user. This class is generated only once to prevent
- * loss of user code.
- *
- */
-public class LogFacilityFacilityBuilder {
-    private LogFacilityFacilityBuilder() {
-        //Exists only to defeat instantiation.
-    }
-
-    public static LogFacility.Facility getDefaultInstance(String defaultValue) {
-        throw new UnsupportedOperationException("Not yet implemented");
-    }
-
-}
index 834958ea383492cb45731cec361c13b8fcffac0d..6d11ddf2196781ac05cdc60e70a22b6996b2c877 100644 (file)
@@ -17,21 +17,22 @@ import org.opendaylight.transportpce.common.fixedflex.GridConstant;
 import org.opendaylight.transportpce.pce.networkanalyzer.PceLink;
 import org.opendaylight.transportpce.pce.networkanalyzer.PceResult;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev200529.FrequencyTHz;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.ModulationFormat;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToABuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToAKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.Resource;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.ResourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.LinkBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.NodeBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPointBuilder;
+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.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToABuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToAKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.Resource;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.ResourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.LinkBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.NodeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPointBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.LinkId;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.opendaylight.yangtools.yang.common.Uint32;
@@ -170,21 +171,21 @@ public class PcePathDescription {
                 .build();
 
         AToZKey clientKey = new AToZKey(index.toString());
-        Resource clientResource = new ResourceBuilder().setResource(stp).build();
+        Resource clientResource = new ResourceBuilder().setResource(stp).setState(State.InService).build();
         AToZ firstResource = new AToZBuilder().setId(tpName).withKey(clientKey).setResource(clientResource).build();
         atozMap.put(firstResource.key(),firstResource);
         index += 1;
         for (PceLink pcelink : path) {
             String srcName = pcelink.getSourceId().getValue();
             // Nodes
-            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce
+            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce
                 .resource.resource.resource.Node sourceNode = new NodeBuilder()
                 .setNodeId(srcName)
                 .build();
 
             // Source Resource
             AToZKey sourceKey = new AToZKey(index.toString());
-            Resource nodeResource1 = new ResourceBuilder().setResource(sourceNode).build();
+            Resource nodeResource1 = new ResourceBuilder().setResource(sourceNode).setState(State.InService).build();
             AToZ srcResource = new AToZBuilder().setId(srcName).withKey(sourceKey).setResource(nodeResource1).build();
             index += 1;
             atozMap.put(srcResource.key(),srcResource);
@@ -197,21 +198,21 @@ public class PcePathDescription {
 
             // Resource
             AToZKey srcTPKey = new AToZKey(index.toString());
-            Resource tpResource1 = new ResourceBuilder().setResource(stp).build();
+            Resource tpResource1 = new ResourceBuilder().setResource(stp).setState(State.InService).build();
             AToZ stpResource = new AToZBuilder().setId(tpName).withKey(srcTPKey).setResource(tpResource1).build();
             index += 1;
             atozMap.put(stpResource.key(),stpResource);
 
             String linkName = pcelink.getLinkId().getValue();
             // Link
-            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce
+            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce
                 .resource.resource.resource.Link atozLink = new LinkBuilder()
                 .setLinkId(linkName)
                 .build();
 
             // Link Resource
             AToZKey linkKey = new AToZKey(index.toString());
-            Resource nodeResource2 = new ResourceBuilder().setResource(atozLink).build();
+            Resource nodeResource2 = new ResourceBuilder().setResource(atozLink).setState(pcelink.getState()).build();
             AToZ linkResource = new AToZBuilder().setId(linkName).withKey(linkKey).setResource(nodeResource2).build();
             index += 1;
             atozMap.put(linkResource.key(),linkResource);
@@ -225,19 +226,19 @@ public class PcePathDescription {
 
             // Resource
             AToZKey destTPKey = new AToZKey(index.toString());
-            Resource tpResource2 = new ResourceBuilder().setResource(dtp).build();
+            Resource tpResource2 = new ResourceBuilder().setResource(dtp).setState(State.InService).build();
             AToZ ttpResource = new AToZBuilder().setId(tpName).withKey(destTPKey).setResource(tpResource2).build();
             index += 1;
             atozMap.put(ttpResource.key(),ttpResource);
 
-            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce
+            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce
                 .resource.resource.resource.Node targetNode = new NodeBuilder()
                 .setNodeId(destName)
                 .build();
 
             // Target Resource
             AToZKey targetKey = new AToZKey(index.toString());
-            Resource nodeResource3 = new ResourceBuilder().setResource(targetNode).build();
+            Resource nodeResource3 = new ResourceBuilder().setResource(targetNode).setState(State.InService).build();
             lastResource = new AToZBuilder().setId(destName).withKey(targetKey).setResource(nodeResource3).build();
 
             lastLink = pcelink;
@@ -256,7 +257,7 @@ public class PcePathDescription {
 
         index += 1;
         clientKey = new AToZKey(index.toString());
-        clientResource = new ResourceBuilder().setResource(stp).build();
+        clientResource = new ResourceBuilder().setResource(stp).setState(State.InService).build();
         lastResource = new AToZBuilder().setId(tpName).withKey(clientKey).setResource(clientResource).build();
         atozMap.put(lastResource.key(),lastResource);
 
@@ -276,7 +277,7 @@ public class PcePathDescription {
                 .build();
 
         ZToAKey clientKey = new ZToAKey(index.toString());
-        Resource clientResource = new ResourceBuilder().setResource(stp).build();
+        Resource clientResource = new ResourceBuilder().setResource(stp).setState(State.InService).build();
         ZToA firstResource = new ZToABuilder().setId(tpName).withKey(clientKey).setResource(clientResource).build();
         ztoaList.put(firstResource.key(),firstResource);
         index += 1;
@@ -290,14 +291,14 @@ public class PcePathDescription {
 
 
             // Nodes
-            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce
+            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce
                 .resource.resource.resource.Node sourceNode = new NodeBuilder()
                 .setNodeId(srcName).build();
 
 
             // Source Resource
             ZToAKey sourceKey = new ZToAKey(index.toString());
-            Resource nodeResource1 = new ResourceBuilder().setResource(sourceNode).build();
+            Resource nodeResource1 = new ResourceBuilder().setResource(sourceNode).setState(State.InService).build();
             ZToA srcResource = new ZToABuilder().setId(srcName).withKey(sourceKey).setResource(nodeResource1).build();
             index += 1;
             ztoaList.put(srcResource.key(),srcResource);
@@ -310,20 +311,20 @@ public class PcePathDescription {
 
             // Resource
             ZToAKey srcTPKey = new ZToAKey(index.toString());
-            Resource tpResource1 = new ResourceBuilder().setResource(stp).build();
+            Resource tpResource1 = new ResourceBuilder().setResource(stp).setState(State.InService).build();
             ZToA stpResource = new ZToABuilder().setId(tpName).withKey(srcTPKey).setResource(tpResource1).build();
             index += 1;
             ztoaList.put(stpResource.key(),stpResource);
 
             String linkName = pcelink.getLinkId().getValue();
             // Link
-            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce
+            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce
                 .resource.resource.resource.Link ztoaLink = new LinkBuilder()
                 .setLinkId(linkName).build();
 
             // Link Resource
             ZToAKey linkKey = new ZToAKey(index.toString());
-            Resource nodeResource2 = new ResourceBuilder().setResource(ztoaLink).build();
+            Resource nodeResource2 = new ResourceBuilder().setResource(ztoaLink).setState(State.InService).build();
             ZToA linkResource = new ZToABuilder().setId(linkName).withKey(linkKey).setResource(nodeResource2).build();
             index += 1;
             ztoaList.put(linkResource.key(),linkResource);
@@ -336,18 +337,18 @@ public class PcePathDescription {
 
             // Resource
             ZToAKey destTPKey = new ZToAKey(index.toString());
-            Resource tpResource2 = new ResourceBuilder().setResource(ttp).build();
+            Resource tpResource2 = new ResourceBuilder().setResource(ttp).setState(State.InService).build();
             ZToA ttpResource = new ZToABuilder().setId(tpName).withKey(destTPKey).setResource(tpResource2).build();
             index += 1;
             ztoaList.put(ttpResource.key(),ttpResource);
 
 
-            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce
+            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce
                 .resource.resource.resource.Node targetNode = new NodeBuilder()
                 .setNodeId(destName).build();
             // Target Resource
             ZToAKey targetKey = new ZToAKey(index.toString());
-            Resource nodeResource3 = new ResourceBuilder().setResource(targetNode).build();
+            Resource nodeResource3 = new ResourceBuilder().setResource(targetNode).setState(State.InService).build();
             lastResource = new ZToABuilder().setId(destName).withKey(targetKey).setResource(nodeResource3).build();
 
             lastLink = pcelink;
@@ -364,7 +365,7 @@ public class PcePathDescription {
 
         index += 1;
         clientKey = new ZToAKey(index.toString());
-        clientResource = new ResourceBuilder().setResource(stp).build();
+        clientResource = new ResourceBuilder().setResource(stp).setState(State.InService).build();
         lastResource = new ZToABuilder().setId(tpName).withKey(clientKey).setResource(clientResource).build();
         ztoaList.put(lastResource.key(),lastResource);
     }
index f1d84bacda6c491a4396133d999b9e72473ac176..594aa137fa78b57d5ab70ef047d5302890fb7159 100644 (file)
@@ -23,8 +23,8 @@ import org.opendaylight.transportpce.pce.networkanalyzer.PceResult;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInput;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInputBuilder;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.service.path.rpc.result.PathDescriptionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
+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.ZToADirection;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp.PceMetric;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.routing.constraints.sp.HardConstraints;
 import org.slf4j.Logger;
index e981e367454e7417ffa8317b9ad192a68f1f5f48..7ee6e437986d84f441e3b2cd1c330bb9039c8173 100644 (file)
@@ -20,10 +20,10 @@ import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.transportpce.common.Timeouts;
 import org.opendaylight.transportpce.common.network.NetworkTransactionService;
 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.rev201126.PathDescription;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.Link;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.Node;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.Link;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.Node;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp.PceMetric;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.CoRoutingOrGeneral;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.CoRouting;
index 1c4b81172a34f6334fdb7ef110f476dec12aa155..86ad662e6d30c5028a699db0e27eeaaf44126f04 100644 (file)
@@ -57,11 +57,11 @@ import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.synchronization.info.syn
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestInput;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.optical.channel.types.rev200529.FrequencyTHz;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.ModulationFormat;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.Resource;
+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.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.Resource;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
 import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
@@ -229,11 +229,11 @@ public class GnpyServiceImpl {
         Long idx = index;
         if (resource
             instanceof
-                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126
+                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210
                     .pce.resource.resource.resource.Node) {
-            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126
+            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210
                 .pce.resource.resource.resource.Node node =
-                (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126
+                (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210
                     .pce.resource.resource.resource.Node) resource;
             if (node.getNodeId() == null) {
                 throw new GnpyException("In gnpyServiceImpl: nodeId is null");
@@ -243,11 +243,11 @@ public class GnpyServiceImpl {
 
         if (resource
             instanceof
-                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126
+                org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210
                     .pce.resource.resource.resource.Link) {
-            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126
+            org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210
                 .pce.resource.resource.resource.Link link =
-                (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126
+                (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210
                     .pce.resource.resource.resource.Link) resource;
             idx = addLinkToRouteObject(link.getLinkId(),idx);
         }
index fa6ea26f77057d8e4746ec1432848a7d7e9da9c8..9a9f2d73199ca215546451655ddcd4e5039799a6 100644 (file)
@@ -24,9 +24,9 @@ import org.opendaylight.yang.gen.v1.gnpy.path.rev200909.generic.path.properties.
 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.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
+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.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.Uint32;
index f5b81231ab9ee67151befaf862c439bee90cc226..2a0ac7b4d72b699edf57025c4ab5ceb9d1d7e824 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.transportpce.pce.gnpy.utils;
 
 import java.io.Serializable;
 import java.util.Comparator;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
 
 @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
     value = "SE_NO_SERIALVERSIONID",
index bb446a96ee2abaf8734c0b3b6ba6180b80c91b36..b2dbae0fd9578316df1f295088fe349f14d71810 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.transportpce.pce.gnpy.utils;
 
 import java.io.Serializable;
 import java.util.Comparator;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToA;
 
 @edu.umd.cs.findbugs.annotations.SuppressFBWarnings(
     value = "SE_NO_SERIALVERSIONID",
index c35b94b06fdda48f105a7819e462aea2e65fd4e3..b84c95ba6429ee8f50daeab4031dca0313adb5a7 100644 (file)
@@ -14,8 +14,8 @@ import java.util.Map;
 import org.opendaylight.transportpce.common.ResponseCodes;
 import org.opendaylight.transportpce.common.fixedflex.GridConstant;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev190531.ServiceFormat;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
+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.ZToADirection;
 import org.opendaylight.yangtools.yang.common.Uint16;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 117fd9efc4ed2d4a75aab9de07a4fa21727f17b3..4e4dfcf55d1720c63477736d44d03db7a9019e02 100644 (file)
@@ -46,8 +46,8 @@ import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev20
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.service.path.rpc.result.PathDescription;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.service.path.rpc.result.PathDescriptionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.configuration.response.common.ConfigurationResponseCommonBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
+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.ZToADirection;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.RpcStatusEx;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.ServicePathNotificationTypes;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.ResponseParametersBuilder;
@@ -214,7 +214,7 @@ public class PathComputationServiceImpl implements PathComputationService {
                 AToZDirection atoz = pathDescription.getAToZDirection();
                 if ((atoz != null) && (atoz.getAToZ() != null)) {
                     LOG.debug("Impl AtoZ Notification: [{}] elements in description", atoz.getAToZ().size());
-                    for (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126
+                    for (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210
                             .path.description.atoz.direction.AToZKey key : atoz.getAToZ().keySet()) {
                         LOG.debug("Impl AtoZ Notification: [{}] {}", key, atoz.getAToZ().get(key));
                     }
@@ -222,7 +222,7 @@ public class PathComputationServiceImpl implements PathComputationService {
                 ZToADirection ztoa = pathDescription.getZToADirection();
                 if ((ztoa != null) && (ztoa.getZToA() != null)) {
                     LOG.debug("Impl ZtoA Notification: [{}] elements in description", ztoa.getZToA().size());
-                    for (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126
+                    for (org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210
                             .path.description.ztoa.direction.ZToAKey key : ztoa.getZToA().keySet()) {
                         LOG.debug("Impl ZtoA Notification: [{}] {}", key, ztoa.getZToA().get(key));
                     }
index efaf518904152f06b318776a2f621cf7a4a198dc..ed40dbe536d099fe07c2c1a6485ab9158f7115a8 100644 (file)
@@ -37,18 +37,18 @@ import org.opendaylight.transportpce.pce.constraints.PceConstraintsCalc;
 import org.opendaylight.transportpce.pce.utils.JsonUtil;
 import org.opendaylight.transportpce.pce.utils.PceTestData;
 import org.opendaylight.transportpce.test.AbstractTest;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToABuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToAKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.Resource;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.ResourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPointBuilder;
+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.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToABuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToAKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.Resource;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.ResourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPointBuilder;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NetworkId;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network;
index 1dc983b5720f2e1ae441bce1cbc2ab3f08100b03..991a6cbc306fe693dd6308dfcf8c21ec37e312d1 100644 (file)
@@ -27,10 +27,10 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev1
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev190531.ServiceFormat;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInputBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirectionBuilder;
+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.pathdescription.rev201210.path.description.ZToADirectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp.PceMetric;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.CoRoutingBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.constraints.sp.co.routing.or.general.GeneralBuilder;
index d650078cce6bae0dcfb2546bf7c71023740436a0..5274aa36cc52efa5ab68042f4205a50f4172f40d 100644 (file)
@@ -30,9 +30,9 @@ import org.opendaylight.transportpce.test.DataStoreContext;
 import org.opendaylight.transportpce.test.converter.DataObjectConverter;
 import org.opendaylight.transportpce.test.converter.XMLDataObjectConverter;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.pce.rev200128.PathComputationRequestOutput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.Node;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.Node;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.NetworkId;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.Networks;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.Network;
index 43a85629b75fe40e7b8598d96afaa6f76e118fb1..1844c5ec8af924c9cab6e7f310114dcc4cb7ea6f 100644 (file)
@@ -35,12 +35,12 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.Fr
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.FrequencyTHz;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev181019.ModulationFormat;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceDeleteInput;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.PathDescription;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.PathDescription;
+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.ZToADirection;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPoint;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.Nodes;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.NodesBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.olm.renderer.input.NodesKey;
index 90830696732014d80af9eddc9b1378ca9efcbbf5..c4941e75afdbf8986457cd825b98a4f8ae4e9b7e 100644 (file)
@@ -58,7 +58,7 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.pm.types.rev161014.PmGran
 import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceTypeEnum;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev190531.ServiceFormat;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.PathDescription;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.PathDescription;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.RpcStatusEx;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.ServicePathNotificationTypes;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.ServicePathList;
index bfa2edce1316622fd50ec0e434669b53713670f4..80b3e6b799e9689a4a44aac406ac4c75852e0078 100644 (file)
@@ -26,22 +26,23 @@ import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.ConnectionType;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.service.port.PortBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev190531.ServiceFormat;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToABuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToAKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.ResourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.Link;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.LinkBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.NodeBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPointBuilder;
+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.pathdescription.rev201210.path.description.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToABuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToAKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.ResourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.Link;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.LinkBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.Node;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.NodeBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPointBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.endpoint.sp.RxDirectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.endpoint.sp.TxDirectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.handler.header.ServiceHandlerHeaderBuilder;
@@ -115,20 +116,10 @@ public final class ServiceDataUtils {
 
     private static PathDescription createPathDescriptionInvalidResource() {
         Map<AToZKey,AToZ> atoZMap = new HashMap<>();
-        org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource
-            .resource.resource.NodeBuilder nodesBuilder = new NodeBuilder();
-        org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource
-            .resource.resource.Node node1 = nodesBuilder
-            .setNodeId("XPONDER-1-2").build();
-        org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource
-            .resource.resource.Node node2 = nodesBuilder
-            .setNodeId("XPONDER-1-2").build();
+        Node node = new NodeBuilder().setNodeId("XPONDER-1-2").build();
         AToZ atoZ = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
-            .setResource(node1).build()).build();
-        AToZ atoZ2 = new AToZBuilder().setId("1").withKey(new AToZKey("1")).setResource(new ResourceBuilder()
-            .setResource(node2).build()).build();
+            .setResource(node).build()).build();
         atoZMap.put(atoZ.key(),atoZ);
-        atoZMap.put(atoZ2.key(),atoZ2);
         AToZDirection atozDirection = new AToZDirectionBuilder()
             .setRate(Uint32.valueOf(20))
             .setAToZWavelengthNumber(Uint32.valueOf(32))
@@ -136,11 +127,8 @@ public final class ServiceDataUtils {
             .build();
         Map<ZToAKey,ZToA> ztoAMap = new HashMap<>();
         ZToA ztoA = new ZToABuilder().setId("1").withKey(new ZToAKey("1")).setResource(new ResourceBuilder()
-            .setResource(node1).build()).build();
-        ZToA ztoA2 = new ZToABuilder().setId("1").withKey(new ZToAKey("1")).setResource(new ResourceBuilder()
-            .setResource(node2).build()).build();
+            .setResource(node).build()).build();
         ztoAMap.put(ztoA.key(),ztoA);
-        ztoAMap.put(ztoA2.key(),ztoA2);
         ZToADirection ztoaDirection = new ZToADirectionBuilder()
             .setRate(Uint32.valueOf(20))
             .setZToAWavelengthNumber(Uint32.valueOf(20))
index 99903ea934666710f3f442e65dc088975e56c60e..7b19527109e9b71a2fe1377fb78f69ab60c8712b 100644 (file)
@@ -12,19 +12,19 @@ import java.util.HashMap;
 import java.util.Map;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.service.port.PortBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.format.rev190531.ServiceFormat;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZ;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.atoz.direction.AToZKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToA;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToABuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ztoa.direction.ZToAKey;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.ResourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPoint;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.pce.resource.resource.resource.TerminationPointBuilder;
+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.pathdescription.rev201210.path.description.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToABuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToAKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.ResourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPoint;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPointBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.endpoint.sp.RxDirectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.endpoint.sp.TxDirectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.service.path.PathDescription;
index 06b61aeaf68c9014298fa7bb99d4598566737cf2..be0eb888d3b59228ba353a0cd27f2bcd5758c2d6 100644 (file)
@@ -7,10 +7,40 @@
  */
 package org.opendaylight.transportpce.servicehandler.listeners;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Optional;
 import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.opendaylight.transportpce.common.OperationResult;
 import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TopologyUpdateResult;
 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.TransportpceNetworkmodelListener;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.topology.update.result.OrdTopologyChanges;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.networkmodel.rev201116.topology.update.result.OrdTopologyChangesKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev181130.State;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev181130.AdminStates;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
+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.pathdescription.rev201210.path.description.ZToADirectionBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZ;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.atoz.direction.AToZKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToA;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToABuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.path.description.ztoa.direction.ZToAKey;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.Resource;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.ResourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.Link;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.Node;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201210.pce.resource.resource.resource.TerminationPoint;
+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.rev200128.service.path.PathDescriptionBuilder;
+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.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -19,6 +49,7 @@ public class NetworkModelListenerImpl implements TransportpceNetworkmodelListene
     private static final Logger LOG = LoggerFactory.getLogger(NetworkModelListenerImpl.class);
     private final NotificationPublishService notificationPublishService; // to be used for T-API notification
     private ServiceDataStoreOperations serviceDataStoreOperations;
+    private TopologyUpdateResult topologyUpdateResult;
 
     public NetworkModelListenerImpl(NotificationPublishService notificationPublishService,
                                     ServiceDataStoreOperations serviceDataStoreOperations) {
@@ -29,6 +60,291 @@ public class NetworkModelListenerImpl implements TransportpceNetworkmodelListene
     @Override
     public void onTopologyUpdateResult(TopologyUpdateResult notification) {
         LOG.info("Topology update notification: {}", notification.toString());
+        if (compareTopologyUpdateResult(notification)) {
+            LOG.warn("TopologyUpdateResult already wired !");
+            return;
+        }
+        topologyUpdateResult = notification;
+        switch (topologyUpdateResult.getNotificationType().getIntValue()) {
+            case 1:
+                // Update service datastore and service path description
+                LOG.info("openroadm-topology update");
+                updateServicePaths(notification);
+                break;
+            case 2:
+                LOG.info("openroadm-network update");
+                break;
+            case 3:
+                LOG.info("clli-network update");
+                break;
+            case 4:
+                LOG.info("otn-topology update");
+                break;
+            default:
+                break;
+        }
+    }
+
+    /**
+     * Process topology update result.
+     * @param notification the result notification.
+     */
+    private void updateServicePaths(TopologyUpdateResult notification) {
+        Map<OrdTopologyChangesKey, OrdTopologyChanges> ordTopologyChanges = notification.getOrdTopologyChanges();
+        Optional<ServicePathList> servicePathListOptional = this.serviceDataStoreOperations.getServicePaths();
+        ServicePathList servicePathList = null;
+        if (!servicePathListOptional.isPresent()) {
+            LOG.error("Couldn't retrieve service path list");
+            return;
+        }
+        servicePathList = servicePathListOptional.get();
+        if (servicePathList.getServicePaths().isEmpty()) {
+            return;
+        }
+        for (ServicePaths servicePaths : servicePathList.getServicePaths().values()) {
+            String serviceName = servicePaths.getServicePathName();
+            PathDescription pathDescription = servicePaths.getPathDescription();
+            // update path descriptions in the datastore
+            Map<AToZKey, AToZ> updatedAtoZ = changePathElementStateAZ(ordTopologyChanges, pathDescription);
+            Map<ZToAKey, ZToA> updatedZtoA = changePathElementStateZA(ordTopologyChanges, pathDescription);
+            OperationResult operationResult = this.serviceDataStoreOperations
+                    .modifyServicePath(buildNewPathDescription(pathDescription, updatedAtoZ, updatedZtoA), serviceName);
+            if (!operationResult.isSuccess()) {
+                LOG.warn("Service Path not updated in datastore!");
+                continue;
+            }
+            // update service in the datastore. Only path description with all elements in service can have a service
+            // in service. Therefore we check if all the states of the path description resources are inService
+            Optional<Services> serviceOptional = this.serviceDataStoreOperations.getService(serviceName);
+            Services services = null;
+            if (!serviceOptional.isPresent()) {
+                LOG.error("Couldn't retrieve service");
+                continue;
+            }
+            services = serviceOptional.get();
+            OperationResult operationResult1 = null;
+            if (State.InService.equals(services.getOperationalState())
+                    && !allElementsinPathinService(updatedAtoZ, updatedZtoA)) {
+                LOG.info("Service={} needs to be updated to outOfService", serviceName);
+                operationResult1 = this.serviceDataStoreOperations.modifyService(serviceName, State.OutOfService,
+                        AdminStates.OutOfService);
+            } else if (State.OutOfService.equals(services.getOperationalState())
+                    && allElementsinPathinService(updatedAtoZ, updatedZtoA)) {
+                LOG.info("Service={} needs to be updated to inService", serviceName);
+                operationResult1 = this.serviceDataStoreOperations.modifyService(serviceName, State.InService,
+                        AdminStates.InService);
+            } else {
+                LOG.info("Service {} state doesnt need to be modified", serviceName);
+            }
+            if (operationResult1 != null && operationResult1.isSuccess()) {
+                LOG.info("Service state correctly updated in datastore");
+            }
+        }
+    }
+
+    private Map<ZToAKey, ZToA> changePathElementStateZA(Map<OrdTopologyChangesKey,
+            OrdTopologyChanges> ordTopologyChanges, PathDescription pathDescription) {
+        Map<ZToAKey, ZToA> ztoaMap = pathDescription.getZToADirection().getZToA();
+        // Needed as ztoaMap is immutable
+        Map<ZToAKey, ZToA> newztoaMap = new HashMap<ZToAKey, ZToA>();
+        for (ZToA element : ztoaMap.values()) {
+            org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State elementState
+                    = element.getResource().getState();
+            String elementType = element.getResource().getResource().implementedInterface().getSimpleName();
+            org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State updatedState = null;
+            ZToAKey elementKey = null;
+            Resource elementResource = null;
+            switch (elementType) {
+                case "TerminationPoint":
+                    TerminationPoint tp = (TerminationPoint) element.getResource().getResource();
+                    // for the tps we need to merge nodeId and tpId
+                    String tpId = tp.getTpNodeId() + "-" + tp.getTpId();
+                    if (!(ordTopologyChanges.containsKey(new OrdTopologyChangesKey(tpId))
+                            && !ordTopologyChanges.get(new OrdTopologyChangesKey(tpId)).getState()
+                            .equals(elementState))) {
+                        newztoaMap.put(element.key(), element);
+                        continue;
+                    }
+                    updatedState = ordTopologyChanges.get(new OrdTopologyChangesKey(tpId)).getState();
+                    LOG.info("Updating path element {} to {}", tpId, updatedState.getName());
+                    // Create new resource element and replace on map
+                    elementKey = new ZToAKey(element.getId());
+                    elementResource = new ResourceBuilder().setResource(tp).setState(updatedState).build();
+                    ZToA tpResource = new ZToABuilder().setId(tp.getTpId()).withKey(elementKey)
+                            .setResource(elementResource).build();
+                    newztoaMap.put(elementKey, tpResource);
+                    break;
+                case "Link":
+                    Link link = (Link) element.getResource().getResource();
+                    if (!(ordTopologyChanges.containsKey(new OrdTopologyChangesKey(link.getLinkId()))
+                            && !ordTopologyChanges.get(new OrdTopologyChangesKey(link.getLinkId())).getState()
+                            .equals(elementState))) {
+                        newztoaMap.put(element.key(), element);
+                        continue;
+                    }
+                    updatedState = ordTopologyChanges.get(new OrdTopologyChangesKey(link.getLinkId())).getState();
+                    LOG.info("Updating path element {} to {}", link.getLinkId(), updatedState.getName());
+                    // Create new resource element and replace on map
+                    elementKey = new ZToAKey(element.getId());
+                    elementResource = new ResourceBuilder().setResource(link).setState(updatedState).build();
+                    ZToA linkResource = new ZToABuilder().setId(link.getLinkId()).withKey(elementKey)
+                            .setResource(elementResource).build();
+                    newztoaMap.put(elementKey, linkResource);
+                    break;
+                case "Node":
+                    Node node = (Node) element.getResource().getResource();
+                    if (!(ordTopologyChanges.containsKey(new OrdTopologyChangesKey(node.getNodeId()))
+                            && !ordTopologyChanges.get(new OrdTopologyChangesKey(node.getNodeId())).getState()
+                            .equals(elementState))) {
+                        newztoaMap.put(element.key(), element);
+                        continue;
+                    }
+                    updatedState = ordTopologyChanges.get(new OrdTopologyChangesKey(node.getNodeId())).getState();
+                    LOG.info("Updating path element {} to {}", node.getNodeId(), updatedState.getName());
+                    // Create new resource element and replace on map
+                    elementKey = new ZToAKey(element.getId());
+                    elementResource = new ResourceBuilder().setResource(node).setState(updatedState).build();
+                    ZToA nodeResource = new ZToABuilder().setId(node.getNodeId()).withKey(elementKey)
+                            .setResource(elementResource).build();
+                    newztoaMap.put(elementKey, nodeResource);
+                    break;
+                default:
+                    LOG.warn("Element type {} not recognized", elementType);
+                    break;
+            }
+        }
+        return newztoaMap;
+    }
+
+    private Map<AToZKey, AToZ> changePathElementStateAZ(Map<OrdTopologyChangesKey,
+            OrdTopologyChanges> ordTopologyChanges, PathDescription pathDescription) {
+        Map<AToZKey, AToZ> atozMap = pathDescription.getAToZDirection().getAToZ();
+        // Needed as atozMap is immutable
+        Map<AToZKey, AToZ> newatozMap = new HashMap<AToZKey, AToZ>();
+        for (AToZ element : atozMap.values()) {
+            org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State elementState
+                = element.getResource().getState();
+            String elementType = element.getResource().getResource().implementedInterface().getSimpleName();
+            org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State updatedState = null;
+            AToZKey elementKey = null;
+            Resource elementResource = null;
+            switch (elementType) {
+                case "TerminationPoint":
+                    TerminationPoint tp = (TerminationPoint) element.getResource().getResource();
+                    // for the tps we need to merge nodeId and tpId
+                    String tpId = tp.getTpNodeId() + "-" + tp.getTpId();
+                    if (!(ordTopologyChanges.containsKey(new OrdTopologyChangesKey(tpId))
+                            && !ordTopologyChanges.get(new OrdTopologyChangesKey(tpId)).getState()
+                            .equals(elementState))) {
+                        newatozMap.put(element.key(), element);
+                        continue;
+                    }
+                    updatedState = ordTopologyChanges.get(new OrdTopologyChangesKey(tpId)).getState();
+                    LOG.info("Updating path element {} to {}", tpId, updatedState.getName());
+                    // Create new resource element and replace on map
+                    elementKey = new AToZKey(element.getId());
+                    elementResource = new ResourceBuilder().setResource(tp).setState(updatedState).build();
+                    AToZ tpResource = new AToZBuilder().setId(tp.getTpId()).withKey(elementKey)
+                            .setResource(elementResource).build();
+                    newatozMap.put(elementKey, tpResource);
+                    break;
+                case "Link":
+                    Link link = (Link) element.getResource().getResource();
+                    if (!(ordTopologyChanges.containsKey(new OrdTopologyChangesKey(link.getLinkId()))
+                            && !ordTopologyChanges.get(new OrdTopologyChangesKey(link.getLinkId())).getState()
+                            .equals(elementState))) {
+                        newatozMap.put(element.key(), element);
+                        continue;
+                    }
+                    updatedState = ordTopologyChanges.get(new OrdTopologyChangesKey(link.getLinkId()))
+                            .getState();
+                    LOG.info("Updating path element {} to {}", link.getLinkId(), updatedState.getName());
+                    // Create new resource element and replace on map
+                    elementKey = new AToZKey(element.getId());
+                    elementResource = new ResourceBuilder().setResource(link).setState(updatedState).build();
+                    AToZ linkResource = new AToZBuilder().setId(link.getLinkId()).withKey(elementKey)
+                            .setResource(elementResource).build();
+                    newatozMap.put(elementKey, linkResource);
+                    break;
+                case "Node":
+                    Node node = (Node) element.getResource().getResource();
+                    if (!(ordTopologyChanges.containsKey(new OrdTopologyChangesKey(node.getNodeId()))
+                            && !ordTopologyChanges.get(new OrdTopologyChangesKey(node.getNodeId())).getState()
+                            .equals(elementState))) {
+                        newatozMap.put(element.key(), element);
+                        continue;
+                    }
+                    updatedState = ordTopologyChanges.get(new OrdTopologyChangesKey(node.getNodeId())).getState();
+                    LOG.info("Updating path element {} to {}", node.getNodeId(), updatedState.getName());
+                    // Create new resource element and replace on map
+                    elementKey = new AToZKey(element.getId());
+                    elementResource = new ResourceBuilder().setResource(node).setState(updatedState).build();
+                    AToZ nodeResource = new AToZBuilder().setId(node.getNodeId()).withKey(elementKey)
+                            .setResource(elementResource).build();
+                    newatozMap.put(elementKey, nodeResource);
+                    break;
+                default:
+                    LOG.warn("Element type {} not recognized", elementType);
+                    break;
+            }
+        }
+        return newatozMap;
+    }
+
+    private PathDescription buildNewPathDescription(PathDescription pathDescription, Map<AToZKey, AToZ> updatedAtoZ,
+                                                    Map<ZToAKey, ZToA> updatedZtoA) {
+        // A to Z
+        AToZDirection atozDir = new AToZDirectionBuilder()
+                .setAToZ(updatedAtoZ)
+                .setAToZWavelengthNumber(pathDescription.getAToZDirection().getAToZWavelengthNumber())
+                .setModulationFormat(pathDescription.getAToZDirection().getModulationFormat())
+                .setRate(pathDescription.getAToZDirection().getRate())
+                .setTribPortNumber(pathDescription.getAToZDirection().getTribPortNumber())
+                .setTribSlotNumber(pathDescription.getAToZDirection().getTribSlotNumber())
+                .build();
+        // Z to A
+        ZToADirection ztoaDir = new ZToADirectionBuilder()
+                .setZToA(updatedZtoA)
+                .setZToAWavelengthNumber(pathDescription.getZToADirection().getZToAWavelengthNumber())
+                .setModulationFormat(pathDescription.getZToADirection().getModulationFormat())
+                .setRate(pathDescription.getAToZDirection().getRate())
+                .setTribPortNumber(pathDescription.getAToZDirection().getTribPortNumber())
+                .setTribSlotNumber(pathDescription.getAToZDirection().getTribSlotNumber())
+                .build();
+        return new PathDescriptionBuilder().setAToZDirection(atozDir).setZToADirection(ztoaDir).build();
+    }
+
+    private boolean allElementsinPathinService(Map<AToZKey, AToZ> updatedAtoZ, Map<ZToAKey, ZToA> updatedZtoA) {
+        boolean allEleminService = true;
+        Iterator<AToZ> i1 = updatedAtoZ.values().iterator();
+        Iterator<ZToA> i2 = updatedZtoA.values().iterator();
+        // TODO: both directions have same length?
+        while (i1.hasNext() && i2.hasNext()) {
+            if (State.OutOfService.getIntValue() == i1.next().getResource().getState().getIntValue()
+                    || State.OutOfService.getIntValue() == i2.next().getResource().getState().getIntValue()) {
+                allEleminService = false;
+                break;
+            }
+        }
+
+        return allEleminService;
+    }
+
+    @SuppressFBWarnings(
+            value = "ES_COMPARING_STRINGS_WITH_EQ",
+            justification = "false positives, not strings but real object references comparisons")
+    private boolean compareTopologyUpdateResult(TopologyUpdateResult notification) {
+        if (topologyUpdateResult == null) {
+            return false;
+        }
+        if (topologyUpdateResult.getNotificationType() != notification.getNotificationType()) {
+            return false;
+        }
+        if (topologyUpdateResult.getOrdTopologyChanges().values()
+                .equals(notification.getOrdTopologyChanges().values())) {
+            return false;
+        }
+        return true;
     }
 
     public void setserviceDataStoreOperations(ServiceDataStoreOperations serviceData) {
index 1f147942cb6ca1d872b14720ccb087855efb8f35..43668620bc88b6c8e23e37eeb4d043ba2829ac5f 100644 (file)
@@ -56,22 +56,22 @@ public class PceListenerImpl implements TransportpcePceListener {
 
     @Override
     public void onServicePathRpcResult(ServicePathRpcResult notification) {
-        if (!compareServicePathRpcResult(notification)) {
-            servicePathRpcResult = notification;
-            switch (servicePathRpcResult.getNotificationType().getIntValue()) {
-                /* path-computation-request. */
-                case 1:
-                    onPathComputationResult(notification);
-                    break;
-                /* cancel-resource-reserve. */
-                case 2:
-                    onCancelResourceResult();
-                    break;
-                default:
-                    break;
-            }
-        } else {
+        if (compareServicePathRpcResult(notification)) {
             LOG.warn("ServicePathRpcResult already wired !");
+            return;
+        }
+        servicePathRpcResult = notification;
+        switch (servicePathRpcResult.getNotificationType().getIntValue()) {
+            /* path-computation-request. */
+            case 1:
+                onPathComputationResult(notification);
+                break;
+            /* cancel-resource-reserve. */
+            case 2:
+                onCancelResourceResult();
+                break;
+            default:
+                break;
         }
     }
 
index 86e36ac09db38c0873955a72d446b98832a436e6..3d6966d7c4ab078cfc3e2c4308a8e1d20ae0a38c 100644 (file)
@@ -16,6 +16,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.re
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.TempServiceCreateInput;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
+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.servicepath.rev171017.ServicePathList;
 
 /**
  * OpenROADM Service operations API providing basic operations on services.
@@ -115,6 +117,10 @@ public interface ServiceDataStoreOperations {
      */
     OperationResult createTempService(TempServiceCreateInput tempServiceCreateInput);
 
+    Optional<ServicePathList> getServicePaths();
+
+    OperationResult modifyServicePath(PathDescription pathDescription, String serviceName);
+
     /**
      * deleteServicePath by name.
      *
index 96ef8cbffe75934bec960e4513c5269612f92b52..e88436fde864b4ce049ac6d689c05f3763a4a242 100644 (file)
@@ -35,8 +35,10 @@ 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.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;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.servicepath.rev171017.service.path.list.ServicePathsKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
@@ -53,11 +55,13 @@ public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperation
 
         public static final String SUCCESSFUL_MESSAGE;
         public static final String SERVICE_NOT_FOUND;
+        public static final String SERVICE_PATH_NOT_FOUND;
 
         // Static blocks are generated once and spare memory.
         static {
             SUCCESSFUL_MESSAGE = "Successful";
             SERVICE_NOT_FOUND = "Service not found";
+            SERVICE_PATH_NOT_FOUND = "Service path not found";
         }
 
         public static String failedTo(String action, String serviceName) {
@@ -270,6 +274,36 @@ public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperation
         }
     }
 
+    @Override
+    public Optional<ServicePathList> getServicePaths() {
+        LOG.debug("Retrieving list of ServicePath...");
+        try {
+            ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction();
+            InstanceIdentifier<ServicePathList> servicePathListIID = InstanceIdentifier.create(ServicePathList.class);
+            Future<java.util.Optional<ServicePathList>> future = readTx.read(LogicalDatastoreType.OPERATIONAL,
+                    servicePathListIID);
+            return future.get(Timeouts.DATASTORE_READ, TimeUnit.MILLISECONDS);
+        } catch (InterruptedException | ExecutionException | TimeoutException e) {
+            LOG.error("Reading service path list failed. Error={}", e.getMessage());
+        }
+        return Optional.empty();
+    }
+
+    private Optional<ServicePaths> getServicePath(String serviceName) {
+        LOG.debug("Retrieving service path of service {}", serviceName);
+        try {
+            ReadTransaction readTx = this.dataBroker.newReadOnlyTransaction();
+            InstanceIdentifier<ServicePaths> servicePathsIID = InstanceIdentifier.create(ServicePathList.class)
+                    .child(ServicePaths.class, new ServicePathsKey(serviceName));
+            Future<java.util.Optional<ServicePaths>> future = readTx.read(LogicalDatastoreType.OPERATIONAL,
+                    servicePathsIID);
+            return future.get(Timeouts.DATASTORE_READ, TimeUnit.MILLISECONDS);
+        } catch (InterruptedException | ExecutionException | TimeoutException e) {
+            LOG.error("Reading service path failed. Error={}", e.getMessage());
+        }
+        return Optional.empty();
+    }
+
     @Override
     public OperationResult createServicePath(ServiceInput serviceInput, PathComputationRequestOutput outputFromPce) {
         LOG.debug("Writing '{}' ServicePath ", serviceInput.getServiceName());
@@ -288,6 +322,43 @@ public class ServiceDataStoreOperationsImpl implements ServiceDataStoreOperation
         }
     }
 
+    @Override
+    public OperationResult modifyServicePath(PathDescription pathDescription, String serviceName) {
+        LOG.debug("Updating servicePath because of a change in the openroadm-topology");
+        Optional<ServicePaths> readServicePath = getServicePath(serviceName);
+        if (!readServicePath.isPresent()) {
+            LOG.warn("modifyServicePath: {}", LogMessages.SERVICE_PATH_NOT_FOUND);
+            return OperationResult.failed(LogMessages.SERVICE_PATH_NOT_FOUND);
+        }
+        try {
+            WriteTransaction writeTx = this.dataBroker.newWriteOnlyTransaction();
+            InstanceIdentifier<ServicePaths> iid = InstanceIdentifier.create(ServicePathList.class)
+                    .child(ServicePaths.class, new ServicePathsKey(serviceName));
+            ServicePaths servicePaths = new ServicePathsBuilder()
+                    .setServiceAEnd(readServicePath.get().getServiceAEnd())
+                    .setServiceHandlerHeader(readServicePath.get().getServiceHandlerHeader())
+                    .setServicePathName(readServicePath.get().getServicePathName())
+                    .setServiceZEnd(readServicePath.get().getServiceZEnd())
+                    .setSupportingServiceName(readServicePath.get().getSupportingServiceName())
+                    .setEquipmentSrgs(readServicePath.get().getEquipmentSrgs())
+                    .setFiberSpanSrlgs(readServicePath.get().getFiberSpanSrlgs())
+                    .setHardConstraints(readServicePath.get().getHardConstraints())
+                    .setLatency(readServicePath.get().getLatency())
+                    .setLocallyProtectedLinks(readServicePath.get().isLocallyProtectedLinks())
+                    .setPathDescription(pathDescription)
+                    .setPceMetric(readServicePath.get().getPceMetric())
+                    .setSoftConstraints(readServicePath.get().getSoftConstraints())
+                    .build();
+
+            writeTx.merge(LogicalDatastoreType.OPERATIONAL, iid, servicePaths);
+            writeTx.commit().get(Timeouts.DATASTORE_WRITE, TimeUnit.MILLISECONDS);
+            return OperationResult.ok(LogMessages.SUCCESSFUL_MESSAGE);
+        } catch (TimeoutException | InterruptedException | ExecutionException e) {
+            LOG.warn("modifyServicePath : {}", LogMessages.failedTo("modify service path", serviceName), e);
+            return OperationResult.failed(LogMessages.failedTo("modify service path", serviceName));
+        }
+    }
+
     @Override
     public OperationResult deleteServicePath(String serviceName) {
         InstanceIdentifier<ServicePaths> servicePathsIID = InstanceIdentifier.create(ServicePathList.class)
index c3d0c9e456c827d301be0f416c7cae24068df1d8..ea142d72254043b20a24765bf6f768914552e001 100644 (file)
@@ -56,8 +56,8 @@ 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.pathdescription.rev201126.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirectionBuilder;
+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.ZToADirectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.ResponseParameters;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.ResponseParametersBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.response.parameters.PathDescriptionBuilder;
index b65f0a48517b51347a695978850e5a510e26fd17..9b4848c2481b2ae0fdd56687fb65e0afa3bbede2 100644 (file)
@@ -28,8 +28,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.re
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.ServiceCreateInput;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.TempServiceCreateInput;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirectionBuilder;
+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.ZToADirectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.ResponseParameters;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.ResponseParametersBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.response.parameters.sp.response.parameters.PathDescriptionBuilder;
index e1f97864ec8b4ea5a74f172d55b64abcf44ab013..267be8794b39fc527559d4e90548a7e026f65c91 100644 (file)
@@ -63,10 +63,10 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.feasibility.check.inputs.ServiceAEndBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.feasibility.check.inputs.ServiceZEnd;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.feasibility.check.inputs.ServiceZEndBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.AToZDirectionBuilder;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirection;
-import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.pathdescription.rev201126.path.description.ZToADirectionBuilder;
+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.pathdescription.rev201210.path.description.ZToADirectionBuilder;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.routing.constraints.rev171017.RoutingConstraintsSp.PceMetric;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.RpcStatusEx;
 import org.opendaylight.yang.gen.v1.http.org.transportpce.b.c._interface.service.types.rev200128.ServicePathNotificationTypes;
index 60cad83b4cace641de63512b8a6c469dbb40eb20..e4a229acb8b9cc9390b838d98436a91b58cbceb1 100644 (file)
@@ -5,7 +5,7 @@ module pathdescription-stub {
 
   import transportpce-pathDescription {
     prefix transportpce-pathDescription;
-       revision-date 2020-11-26;
+    revision-date 2020-12-10;
   }
 
   description
index 60b0be41780350dd3b5c4294cbcf0648882b5d9d..d8447847b087d91ec99082d7f5c0763e3f077c81 100644 (file)
@@ -353,7 +353,7 @@ class TransportPCEtesting(unittest.TestCase):
         nbElmPath = len(res['output']['response-parameters']['path-description']
                         ['aToZ-direction']['aToZ'])
         self.assertEqual(31, nbElmPath)
-        link = {"link-id": "OpenROADM-1-3-DEG2-to-OpenROADM-1-2-DEG2"}
+        link = {"link-id": "OpenROADM-1-3-DEG2-to-OpenROADM-1-2-DEG2", "state":"inService"}
         find = False
         for i in range(0, nbElmPath):
             resource_i = (res['output']['response-parameters']['path-description']['aToZ-direction']['aToZ'][i]
@@ -383,7 +383,7 @@ class TransportPCEtesting(unittest.TestCase):
         nbElmPath = len(res['output']['response-parameters']['path-description']
                         ['aToZ-direction']['aToZ'])
         self.assertEqual(47, nbElmPath)
-        link = {"link-id": "OpenROADM-1-3-DEG2-to-OpenROADM-1-2-DEG2"}
+        link = {"link-id": "OpenROADM-1-3-DEG2-to-OpenROADM-1-2-DEG2", "state":"inService"}
         find = False
         for i in range(0, nbElmPath):
             resource_i = (res['output']['response-parameters']['path-description']['aToZ-direction']['aToZ'][i]