f8dac83a28bfa87b574b1f050e75a3fae0a6f585
[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.rev200128.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      * @return optional of connection number
45      */
46     Optional<String> postCrossConnect(String deviceId, Long waveNumber, String srcTp, String destTp);
47
48     /**
49      * This method does a delete(edit-config) on roadm connection subtree for a
50      * given connection number.
51      *
52      * @param deviceId
53      *            Device id.
54      * @param connectionNumber
55      *            Name of the cross connect.
56      * @param isOtn
57      *            True for odu-connection, False for roadm-connection.
58      *
59      * @return true/false based on status of operation.
60      */
61     List<String> deleteCrossConnect(String deviceId, String connectionNumber, Boolean isOtn);
62
63     /**
64      * This public method returns the list of ports (port-trail) for a roadm's
65      * cross connect. It calls rpc get-port-trail on device. To be used store
66      * detailed path description.
67      *
68      * @param nodeId
69      *            node-id of NE.
70      * @param waveNumber
71      *            Wavelength number.
72      * @param srcTp
73      *            Source logical connection point.
74      * @param destTp
75      *            Destination logical connection point.
76      *
77      * @return list of Ports object type.
78      *
79      * @throws OpenRoadmInterfaceException
80      *            an exception at OpenRoadm interface.
81      */
82     List<?> getConnectionPortTrail(String nodeId, Long waveNumber, String srcTp, String destTp)
83             throws OpenRoadmInterfaceException;
84
85     /**
86      * This method does an edit-config on roadm connection subtree for a given
87      * connection number in order to set power level for use by the optical
88      * power control.
89      *
90      * @param deviceId
91      *            Device id.
92      * @param mode
93      *            Optical control modelcan be off, power or gainLoss.
94      * @param powerValue
95      *            Power value in DBm.
96      * @param connectionNumber
97      *            Name of the cross connect.
98      * @return true/false based on status of operation.
99      */
100     boolean setPowerLevel(String deviceId, String mode, BigDecimal powerValue,
101                           String connectionNumber);
102
103     Optional<String> postOtnCrossConnect(List<String> createdOduInterfaces, Nodes node) throws
104             OpenRoadmInterfaceException;
105
106 }