Move otn link update from renderer to SH
[transportpce.git] / networkmodel / src / main / java / org / opendaylight / transportpce / networkmodel / service / NetworkModelService.java
index 3a02d7b715c11feaeaad2cce27d5a2820e395c61..c3606ed2b284df24eb155e31360d655d783e9790 100644 (file)
@@ -7,9 +7,11 @@
  */
 package org.opendaylight.transportpce.networkmodel.service;
 
-import java.util.List;
-import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev200129.OtnLinkType;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210426.mapping.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210618.renderer.rpc.result.sp.Link;
+import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.OtnLinkType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus;
+import org.opendaylight.yangtools.yang.common.Uint32;
 
 /**
  * Service for data manipulation on OpenROADM topology models.
@@ -20,9 +22,9 @@ public interface NetworkModelService {
      * Create new OpenROADM node in all OpenROADM topologies.
      *
      * @param nodeId
-     *   unique node ID of new OpenROADM node
+     *     unique node ID of new OpenROADM node
      * @param nodeVersion
-     *   OpenROADM node version
+     *     OpenROADM node version
      */
     void createOpenRoadmNode(String nodeId, String nodeVersion);
 
@@ -30,18 +32,30 @@ public interface NetworkModelService {
      * Delete OpenROADM node mapping and topologies.
      *
      * @param nodeId
-     *   unique node ID of OpenROADM node.
+     *     unique node ID of OpenROADM node.
      *
      */
     void deleteOpenRoadmnode(String nodeId);
 
+    /**
+     * Update termination point, and if need, be associated links, of
+     * openroadm-topology and otn-topology after a change on a given mapping.
+     *
+     * @param nodeId
+     *            unique node ID of OpenROADM node at the origin of the NETCONF
+     *            notification change.
+     * @param mapping
+     *            updated mapping following the device notification change.
+     */
+    void updateOpenRoadmTopologies(String nodeId, Mapping mapping);
+
     /**
      * Set/update connection status of OpenROADM node.
      *
      * @param nodeId
-     *   unique node ID of new OpenROADM node
+     *     unique node ID of new OpenROADM node
      * @param connectionStatus
-     *   connection status of the node
+     *     connection status of the node
      */
     void setOpenRoadmNodeStatus(String nodeId, NetconfNodeConnectionStatus.ConnectionStatus connectionStatus);
 
@@ -49,15 +63,15 @@ public interface NetworkModelService {
      * create new otn link in otn-topology.
      *
      * @param nodeA
-     *   OpenROADM node ID for link termination point A
+     *     OpenROADM node ID for link termination point A
      * @param tpA
-     *   OpenROADM tp id on nodeA for link termination point A
+     *     OpenROADM tp id on nodeA for link termination point A
      * @param nodeZ
-     *   OpenROADM node ID for link termination point Z
+     *     OpenROADM node ID for link termination point Z
      * @param tpZ
-     *   OpenROADM tp id on nodeZ for link termination point Z
+     *     OpenROADM tp id on nodeZ for link termination point Z
      * @param linkType
-     *   OtnLinkType, as OTU4, ODTU, etc
+     *     OtnLinkType, as OTU4, ODTU, etc
      */
     void createOtnLinks(String nodeA, String tpA, String nodeZ, String tpZ, OtnLinkType linkType);
 
@@ -65,34 +79,32 @@ public interface NetworkModelService {
      * delete otn links from otn-topology.
      *
      * @param nodeA
-     *   OpenROADM node ID for link termination point A
+     *     OpenROADM node ID for link termination point A
      * @param tpA
-     *   OpenROADM tp id on nodeA for link termination point A
+     *     OpenROADM tp id on nodeA for link termination point A
      * @param nodeZ
-     *   OpenROADM node ID for link termination point Z
+     *     OpenROADM node ID for link termination point Z
      * @param tpZ
-     *   OpenROADM tp id on nodeZ for link termination point Z
+     *     OpenROADM tp id on nodeZ for link termination point Z
      * @param linkType
-     *   OtnLinkType, as OTU4, ODTU, etc
+     *     OtnLinkType, as OTU4, ODTU, etc
      */
     void deleteOtnLinks(String nodeA, String tpA, String nodeZ, String tpZ, OtnLinkType linkType);
 
     /**
      * update otn links from otn-topology.
      *
-     * @param nodeTps
-     *   List containing a string composed of the netconf nodeId , and the
-     *       termination point supporting the service
+     * @param link
+     *     link containing termination points to be updated
      * @param serviceRate
-     *   Service rate may be 1G, 10G or 100G
+     *     Service rate may be 1G, 10G or 100G
      * @param tribPortNb
-     *   Trib port number allocated by the service
+     *     Trib port number allocated by the service
      * @param tribSoltNb
-     *   First trib slot number allocated by the service
+     *     First trib slot number allocated by the service
      * @param isDeletion
-     *   True indicates if the low-order otn service must be deleted
+     *       True indicates if the low-order otn service must be deleted
      */
-    void updateOtnLinks(List<String> nodeTps, String serviceRate, Short tribPortNb, Short tribSoltNb,
-        boolean isDeletion);
+    void updateOtnLinks(Link link, Uint32 serviceRate, Short tribPortNb, Short tribSoltNb, boolean isDeletion);
 
 }