Adapt TransportPCE code to Sulfur
[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.util.List;
12 import java.util.Optional;
13 import org.opendaylight.transportpce.common.fixedflex.SpectrumInformation;
14 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
15 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev210930.otn.renderer.nodes.Nodes;
16 import org.opendaylight.yangtools.yang.common.Decimal64;
17
18 public interface CrossConnect {
19
20     /**
21      * This method return the RoadmConnection subtree for a given connection
22      * number.
23      *
24      * @param deviceId
25      *            Device id.
26      * @param connectionNumber
27      *            Name of the cross connect.
28      *
29      * @return optional of Roadm connection subtree from the device.
30      */
31     Optional<?> getCrossConnect(String deviceId, String connectionNumber);
32
33     /**
34      * This method does a post(edit-config) on roadm connection subtree for a
35      * given connection number.
36      *
37      * @param deviceId
38      *            Device id.
39      * @param srcTp
40      *            Name of source termination point.
41      * @param destTp
42      *            Name of destination termination point.
43      * @param spectrumInformation SpectrumInformation
44      * @return optional of connection number
45      */
46     Optional<String> postCrossConnect(String deviceId, String srcTp, String destTp,
47             SpectrumInformation spectrumInformation);
48
49     /**
50      * This method does a delete(edit-config) on roadm connection subtree for a
51      * given connection number.
52      *
53      * @param deviceId
54      *            Device id.
55      * @param connectionNumber
56      *            Name of the cross connect.
57      * @param isOtn
58      *            True for odu-connection, False for roadm-connection.
59      *
60      * @return the list of interface-names that were supporting the connection.
61      */
62     List<String> deleteCrossConnect(String deviceId, String connectionNumber, Boolean isOtn);
63
64     /**
65      * This public method returns the list of ports (port-trail) for a roadm's
66      * cross connect. It calls rpc get-port-trail on device. To be used store
67      * detailed path description.
68      *
69      * @param nodeId
70      *            node-id of NE.
71      * @param srcTp
72      *            Source logical connection point.
73      * @param destTp
74      *            Destination logical connection point.
75      * @param lowerSpectralSlotNumber Value of lower spectral slot number.
76      * @param higherSpectralSlotNumber Value of higher spectral slot number.
77      * @return list of Ports object type.
78      *
79      * @throws OpenRoadmInterfaceException
80      *            an exception at OpenRoadm interface.
81      */
82     List<?> getConnectionPortTrail(String nodeId, String srcTp, String destTp, int lowerSpectralSlotNumber,
83             int higherSpectralSlotNumber)
84             throws OpenRoadmInterfaceException;
85
86     /**
87      * This method does an edit-config on roadm connection subtree for a given
88      * connection number in order to set power level for use by the optical
89      * power control.
90      *
91      * @param deviceId
92      *            Device id.
93      * @param mode
94      *            Optical control modelcan be off, power or gainLoss.
95      * @param powerValue
96      *            Power value in DBm.
97      * @param connectionNumber
98      *            Name of the cross connect.
99      * @return true/false based on status of operation.
100      */
101     boolean setPowerLevel(String deviceId, String mode, Decimal64 powerValue, String connectionNumber);
102
103     Optional<String> postOtnCrossConnect(List<String> createdOduInterfaces, Nodes node) throws
104             OpenRoadmInterfaceException;
105
106 }