Power control support for 87.5GHz spectrum width
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / crossconnect / CrossConnect.java
index 0b708c00670d55d0828597762417a873a1e9a44e..05ee1648b5c1b8f70db2da08d8d609eda163f96f 100644 (file)
@@ -8,12 +8,12 @@
 
 package org.opendaylight.transportpce.common.crossconnect;
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.Optional;
-
+import org.opendaylight.transportpce.common.fixedflex.SpectrumInformation;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.get.connection.port.trail.output.Ports;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
+import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev210930.otn.renderer.nodes.Nodes;
 
 public interface CrossConnect {
 
@@ -26,9 +26,9 @@ public interface CrossConnect {
      * @param connectionNumber
      *            Name of the cross connect.
      *
-     * @return Roadm connection subtree from the device.
+     * @return optional of Roadm connection subtree from the device.
      */
-    Optional<RoadmConnections> getCrossConnect(String deviceId, String connectionNumber);
+    Optional<?> getCrossConnect(String deviceId, String connectionNumber);
 
     /**
      * This method does a post(edit-config) on roadm connection subtree for a
@@ -36,15 +36,15 @@ public interface CrossConnect {
      *
      * @param deviceId
      *            Device id.
-     * @param waveNumber
-     *            Wavelength number.
      * @param srcTp
      *            Name of source termination point.
      * @param destTp
      *            Name of destination termination point.
+     * @param spectrumInformation SpectrumInformation
      * @return optional of connection number
      */
-    Optional<String> postCrossConnect(String deviceId, Long waveNumber, String srcTp, String destTp);
+    Optional<String> postCrossConnect(String deviceId, String srcTp, String destTp,
+            SpectrumInformation spectrumInformation);
 
     /**
      * This method does a delete(edit-config) on roadm connection subtree for a
@@ -54,11 +54,12 @@ public interface CrossConnect {
      *            Device id.
      * @param connectionNumber
      *            Name of the cross connect.
+     * @param isOtn
+     *            True for odu-connection, False for roadm-connection.
      *
-     * @return true/false based on status of operation.
+     * @return the list of interface-names that were supporting the connection.
      */
-
-    boolean deleteCrossConnect(String deviceId, String connectionNumber);
+    List<String> deleteCrossConnect(String deviceId, String connectionNumber, Boolean isOtn);
 
     /**
      * This public method returns the list of ports (port-trail) for a roadm's
@@ -67,17 +68,40 @@ public interface CrossConnect {
      *
      * @param nodeId
      *            node-id of NE.
-     * @param waveNumber
-     *            Wavelength number.
      * @param srcTp
      *            Source logical connection point.
      * @param destTp
      *            Destination logical connection point.
-     * @throws OpenRoadmInterfaceException
-     *            OpenRoadm Interface Exception.
-     *
+     * @param lowerSpectralSlotNumber Value of lower spectral slot number.
+     * @param higherSpectralSlotNumber Value of higher spectral slot number.
      * @return list of Ports object type.
+     *
+     * @throws OpenRoadmInterfaceException
+     *            an exception at OpenRoadm interface.
      */
-    List<Ports> getConnectionPortTrail(String nodeId, Long waveNumber, String srcTp, String destTp)
+    List<?> getConnectionPortTrail(String nodeId, String srcTp, String destTp, int lowerSpectralSlotNumber,
+            int higherSpectralSlotNumber)
             throws OpenRoadmInterfaceException;
+
+    /**
+     * This method does an edit-config on roadm connection subtree for a given
+     * connection number in order to set power level for use by the optical
+     * power control.
+     *
+     * @param deviceId
+     *            Device id.
+     * @param mode
+     *            Optical control modelcan be off, power or gainLoss.
+     * @param powerValue
+     *            Power value in DBm.
+     * @param connectionNumber
+     *            Name of the cross connect.
+     * @return true/false based on status of operation.
+     */
+    boolean setPowerLevel(String deviceId, String mode, BigDecimal powerValue,
+                          String connectionNumber);
+
+    Optional<String> postOtnCrossConnect(List<String> createdOduInterfaces, Nodes node) throws
+            OpenRoadmInterfaceException;
+
 }