Integrate renderer & olm code to run on device221
[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
16 public interface CrossConnect {
17
18     /**
19      * This method return the RoadmConnection subtree for a given connection
20      * number.
21      *
22      * @param deviceId
23      *            Device id.
24      * @param connectionNumber
25      *            Name of the cross connect.
26      *
27      * @return Roadm connection subtree from the device.
28      */
29     <T> Optional<T> getCrossConnect(String deviceId, String connectionNumber);
30
31     /**
32      * This method does a post(edit-config) on roadm connection subtree for a
33      * given connection number.
34      *
35      * @param deviceId
36      *            Device id.
37      * @param waveNumber
38      *            Wavelength number.
39      * @param srcTp
40      *            Name of source termination point.
41      * @param destTp
42      *            Name of destination termination point.
43      * @return optional of connection number
44      */
45     Optional<String> postCrossConnect(String deviceId, Long waveNumber, String srcTp, String destTp);
46
47     /**
48      * This method does a delete(edit-config) on roadm connection subtree for a
49      * given connection number.
50      *
51      * @param deviceId
52      *            Device id.
53      * @param connectionNumber
54      *            Name of the cross connect.
55      *
56      * @return true/false based on status of operation.
57      */
58
59     List<String> deleteCrossConnect(String deviceId, String connectionNumber);
60
61     /**
62      * This public method returns the list of ports (port-trail) for a roadm's
63      * cross connect. It calls rpc get-port-trail on device. To be used store
64      * detailed path description.
65      *
66      * @param nodeId
67      *            node-id of NE.
68      * @param waveNumber
69      *            Wavelength number.
70      * @param srcTp
71      *            Source logical connection point.
72      * @param destTp
73      *            Destination logical connection point.
74      *
75      * @return list of Ports object type.
76      */
77     <T> List<T> getConnectionPortTrail(String nodeId, Long waveNumber, String srcTp, String destTp)
78             throws OpenRoadmInterfaceException;
79
80     /**
81      * This method does an edit-config on roadm connection subtree for a given
82      * connection number in order to set power level for use by the optical
83      * power control.
84      *
85      * @param deviceId
86      *            Device id.
87      * @param mode
88      *            Optical control modelcan be off, power or gainLoss.
89      * @param powerValue
90      *            Power value in DBm.
91      * @param connectionNumber
92      *            Name of the cross connect.
93      * @return true/false based on status of operation.
94      */
95     boolean setPowerLevel(String deviceId, Enum mode, BigDecimal powerValue,
96                           String connectionNumber);
97 }