Add new method in PortMapping interface
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / mapping / PortMapping.java
index 3d8345db919cda6007b195e80f4c982e1dcb6886..4342590e968ff87c8162ffc3286d2fc1930159a6 100644 (file)
@@ -8,12 +8,24 @@
 
 package org.opendaylight.transportpce.common.mapping;
 
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210310.network.Nodes;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210310.network.nodes.Mapping;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210310.network.nodes.McCapabilities;
+
+import java.util.List;
+import java.util.Map;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mapping.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.mc.capabilities.McCapabilities;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev220316.network.Nodes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.OduSwitchingPools;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.odu.switching.pools.non.blocking.list.PortList;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.common.Uint16;
+
 
 public interface PortMapping {
 
+    PortMappingVersion221 getPortMappingVersion221();
+
+    PortMappingVersion710 getPortMappingVersion710();
+
     /**
      * This method creates logical to physical port mapping for a given device.
      * Instead of parsing all the circuit packs/ports in the device, this methods
@@ -48,13 +60,13 @@ public interface PortMapping {
     boolean createMappingData(String nodeId, String nodeVersion);
 
     /**
-     * This method removes mapping data from the datastore after disconnecting ODL
-     * from a Netconf device.
+     * This method removes all mapping data of a given node from the datastore
+     * after disconnecting ODL from a Netconf device.
      *
      * @param nodeId
      *            node ID
      */
-    void deleteMappingData(String nodeId);
+    void deletePortMappingNode(String nodeId);
 
     /**
      * This method for a given node's termination point returns the Mapping object
@@ -90,13 +102,25 @@ public interface PortMapping {
      *            Unique Identifier for the node of interest.
      * @param circuitPackName
      *            Name of the supporting circuit-pack
-     * @param circuitPackName
+     * @param portName
      *            Name of the supporting port
      *
      * @return Result Mapping object if success otherwise null.
      */
     Mapping getMapping(String nodeId, String circuitPackName, String portName);
 
+    /**
+     * This method removes a given mapping data from the mapping list
+     * stored in the datastore while the Netconf device is already
+     * connected to the controller.
+     *
+     * @param nodeId
+     *            node ID
+     * @param logicalConnectionPoint
+     *            key of the mapping inside the mapping list
+     */
+    void deleteMapping(String nodeId, String logicalConnectionPoint);
+
     /**
      * This method, for a given node media channel-capabilities, returns the object
      * based on portmapping.yang model stored in the MD-SAL data store which is
@@ -151,4 +175,37 @@ public interface PortMapping {
      * @return node data if success otherwise null.
      */
     Nodes getNode(String nodeId);
+
+    /**
+     * This method allows to update a port-mapping node with odu-connection-map data.
+     * This method is used for an otn xponder in version 7.1, when a device sends a
+     * change-notification advertising controller that odu-switching-pools containers
+     * have been populated inside its configuration
+     * (appears after creation of an OTSI-Group interface).
+     *
+     * @param nodeId
+     *            Unique Identifier for the node of interest.
+     * @param ospIID
+     *            Instance Identifier of the odu-switching-pools.
+     * @param nbliidMap
+     *            Map containing the non-blocking-list number as key,
+     *            and the list of Instance Identifier corresponding to each port-list
+     *            as value.
+     *
+     * @return Result true/false based on status of operation.
+     */
+    boolean updatePortMappingWithOduSwitchingPools(String nodeId, InstanceIdentifier<OduSwitchingPools> ospIID,
+        Map<Uint16, List<InstanceIdentifier<PortList>>> nbliidMap);
+
+    /**
+     * This method check the presence or not of a given node inside the PortMapping
+     * datastore.
+     *
+     * @param nodeId
+     *            Unique Identifier for the node of interest.
+     *
+     * @return Result true/false based on existance or not of a given node.
+     */
+    boolean isNodeExist(String nodeId);
+
 }