Update connection and interface name
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / crossconnect / CrossConnect.java
1 /*
2  * Copyright © 2017 AT&T and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.transportpce.common.crossconnect;
10
11 import java.math.BigDecimal;
12 import java.util.List;
13 import java.util.Optional;
14 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
15 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.otn.renderer.input.Nodes;
16
17 public interface CrossConnect {
18
19     /**
20      * This method return the RoadmConnection subtree for a given connection
21      * number.
22      *
23      * @param deviceId
24      *            Device id.
25      * @param connectionNumber
26      *            Name of the cross connect.
27      *
28      * @return optional of Roadm connection subtree from the device.
29      */
30     Optional<?> getCrossConnect(String deviceId, String connectionNumber);
31
32     /**
33      * This method does a post(edit-config) on roadm connection subtree for a
34      * given connection number.
35      *
36      * @param deviceId
37      *            Device id.
38      * @param waveNumber
39      *            Wavelength number.
40      * @param srcTp
41      *            Name of source termination point.
42      * @param destTp
43      *            Name of destination termination point.
44      * @param lowerSpectralSlotNumber Value of lower spectral slot number.
45      * @param higherSpectralSlotNumber Value of higher spectral slot number.
46      * @return optional of connection number
47      */
48     Optional<String> postCrossConnect(String deviceId, Long waveNumber, String srcTp, String destTp,
49             int lowerSpectralSlotNumber, int higherSpectralSlotNumber);
50
51     /**
52      * This method does a delete(edit-config) on roadm connection subtree for a
53      * given connection number.
54      *
55      * @param deviceId
56      *            Device id.
57      * @param connectionNumber
58      *            Name of the cross connect.
59      * @param isOtn
60      *            True for odu-connection, False for roadm-connection.
61      *
62      * @return true/false based on status of operation.
63      */
64     List<String> deleteCrossConnect(String deviceId, String connectionNumber, Boolean isOtn);
65
66     /**
67      * This public method returns the list of ports (port-trail) for a roadm's
68      * cross connect. It calls rpc get-port-trail on device. To be used store
69      * detailed path description.
70      *
71      * @param nodeId
72      *            node-id of NE.
73      * @param waveNumber
74      *            Wavelength number.
75      * @param srcTp
76      *            Source logical connection point.
77      * @param destTp
78      *            Destination logical connection point.
79      * @param lowerSpectralSlotNumber Value of lower spectral slot number.
80      * @param higherSpectralSlotNumber Value of higher spectral slot number.
81      * @return list of Ports object type.
82      *
83      * @throws OpenRoadmInterfaceException
84      *            an exception at OpenRoadm interface.
85      */
86     List<?> getConnectionPortTrail(String nodeId, Long waveNumber, String srcTp, String destTp,
87             int lowerSpectralSlotNumber, int higherSpectralSlotNumber)
88             throws OpenRoadmInterfaceException;
89
90     /**
91      * This method does an edit-config on roadm connection subtree for a given
92      * connection number in order to set power level for use by the optical
93      * power control.
94      *
95      * @param deviceId
96      *            Device id.
97      * @param mode
98      *            Optical control modelcan be off, power or gainLoss.
99      * @param powerValue
100      *            Power value in DBm.
101      * @param connectionNumber
102      *            Name of the cross connect.
103      * @return true/false based on status of operation.
104      */
105     boolean setPowerLevel(String deviceId, String mode, BigDecimal powerValue,
106                           String connectionNumber);
107
108     Optional<String> postOtnCrossConnect(List<String> createdOduInterfaces, Nodes node) throws
109             OpenRoadmInterfaceException;
110
111 }