Add Supported OM to PortMapping.yang
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / mapping / PortMapping.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.mapping;
10
11
12 import java.util.List;
13 import java.util.Map;
14 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.mapping.Mapping;
15 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.mc.capabilities.McCapabilities;
16 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev231221.network.Nodes;
17 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.OduSwitchingPools;
18 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev200529.org.openroadm.device.container.org.openroadm.device.odu.switching.pools.non.blocking.list.PortList;
19 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
20 import org.opendaylight.yangtools.yang.common.Uint16;
21
22
23 public interface PortMapping {
24
25     PortMappingVersion221 getPortMappingVersion221();
26
27     PortMappingVersion710 getPortMappingVersion710();
28
29     /**
30      * This method creates logical to physical port mapping for a given device.
31      * Instead of parsing all the circuit packs/ports in the device, this methods
32      * does a selective read operation on degree/srg subtree to get circuit
33      * packs/ports that map to :
34      *
35      * <p>
36      * 1. DEGn-TTP-TX, DEGn-TTP-RX, DEGn-TTP-TXRX
37      *
38      * <p>
39      * 2. SRGn-PPp-TX, SRGn-PPp-RX, SRGn-PPp-TXRX
40      *
41      * <p>
42      * 3. LINEn
43      *
44      * <p>
45      * 4. CLNTn.
46      *
47      * <p>
48      * If the port is Mw it also store the OMS, OTS interface provisioned on the
49      * port. It skips the logical ports that are internal. If operation is
50      * successful the mapping gets stored in datastore corresponding to
51      * portmapping.yang data model.
52      *
53      * @param nodeId
54      *            node ID
55      * @param nodeVersion
56      *            node version
57      *
58      * @return true/false based on status of operation
59      */
60     boolean createMappingData(String nodeId, String nodeVersion);
61
62     /**
63      * This method removes all mapping data of a given node from the datastore
64      * after disconnecting ODL from a Netconf device.
65      *
66      * @param nodeId
67      *            node ID
68      */
69     void deletePortMappingNode(String nodeId);
70
71     /**
72      * This method for a given node's termination point returns the Mapping object
73      * based on portmapping.yang model stored in the MD-SAL data store which is
74      * created when the node is connected for the first time. The mapping object
75      * basically contains the following attributes of interest:
76      *
77      * <p>
78      * 1. Supporting circuit pack
79      *
80      * <p>
81      * 2. Supporting port
82      *
83      * <p>
84      * 3. Supporting OTS/OMS interface (if port on ROADM)
85      *
86      * @param nodeId
87      *            Unique Identifier for the node of interest.
88      * @param logicalConnPoint
89      *            Name of the logical point
90      *
91      * @return Result Mapping object if success otherwise null.
92      */
93     Mapping getMapping(String nodeId, String logicalConnPoint);
94
95     /**
96      * This method allows retrieving a Mapping object from the mapping list stored in
97      * the MD-SAL data store. The main interest is to retrieve the
98      * logical-connection-point associated with a given port on a supporting
99      * circuit-pack
100      *
101      * @param nodeId
102      *            Unique Identifier for the node of interest.
103      * @param circuitPackName
104      *            Name of the supporting circuit-pack
105      * @param portName
106      *            Name of the supporting port
107      *
108      * @return Result Mapping object if success otherwise null.
109      */
110     Mapping getMapping(String nodeId, String circuitPackName, String portName);
111
112     /**
113      * This method for a given node's termination point returns the Mapping object
114      * based on portmapping.yang model stored in the MD-SAL data store which is
115      * created when the node is connected for the first time. The mapping object
116      * basically contains the following attributes of interest:
117      *
118      * <p>
119      * 1. Supporting circuit pack
120      *
121      * <p>
122      * 2. Supporting port
123      *
124      * <p>
125      * 3. Supporting OTS/OMS interface (if port on ROADM)
126      *
127      * @param nodeId
128      *            Unique Identifier for the node of interest.
129      * @param interfName
130      *            Name of the OTS interface
131      *
132      * @return Result Mapping object if success otherwise null.
133      */
134     Mapping getMappingFromOtsInterface(String nodeId, String interfName);
135
136     /**
137      * This method removes a given mapping data from the mapping list
138      * stored in the datastore while the Netconf device is already
139      * connected to the controller.
140      *
141      * @param nodeId
142      *            node ID
143      * @param logicalConnectionPoint
144      *            key of the mapping inside the mapping list
145      */
146     void deleteMapping(String nodeId, String logicalConnectionPoint);
147
148     /**
149      * This method, for a given node media channel-capabilities, returns the object
150      * based on portmapping.yang model stored in the MD-SAL data store which is
151      * created when the node is connected for the first time. The mapping object
152      * basically contains the following attributes of interest:
153      *
154      * <p>
155      * 1. slot width granularity
156      *
157      * <p>
158      * 2. center frequency granularity
159      *
160      * <p>
161      * 3. Supporting OMS interface (if port on ROADM)
162      *
163      * <p>
164      * 4. Supporting OTS interface (if port on ROADM)
165      *
166      * @param nodeId
167      *            Unique Identifier for the node of interest.
168      * @param mcLcp
169      *            Name of the MC-capability
170      *
171      * @return Result McCapabilities.
172      */
173     McCapabilities getMcCapbilities(String nodeId, String mcLcp);
174
175     /**
176      * This method for a given node, allows to update a specific mapping based on
177      * portmapping.yang model already stored in the MD-SAL data store, following
178      * some changes on the device port (creation of interface supported on this
179      * port, change of port admin state, etc).
180      *
181     * @param nodeId
182      *            Unique Identifier for the node of interest.
183      * @param mapping
184      *            Old mapping to be updated.
185      *
186      * @return Result true/false based on status of operation.
187      */
188     boolean updateMapping(String nodeId, Mapping mapping);
189
190     /**
191      * Returns all Mapping informations for a given ordm device. This method returns
192      * all Mapping informations already stored in the MD-SAL data store for a given
193      * openroadm device. Beyound the list of mappings, it gives access to general
194      * node information as its version or its node type, etc.
195      *
196      * @param nodeId
197      *            Unique Identifier for the node of interest.
198      *
199      * @return node data if success otherwise null.
200      */
201     Nodes getNode(String nodeId);
202
203     /**
204      * This method allows to update a port-mapping node with odu-connection-map data.
205      * This method is used for an otn xponder in version 7.1, when a device sends a
206      * change-notification advertising controller that odu-switching-pools containers
207      * have been populated inside its configuration
208      * (appears after creation of an OTSI-Group interface).
209      *
210      * @param nodeId
211      *            Unique Identifier for the node of interest.
212      * @param ospIID
213      *            Instance Identifier of the odu-switching-pools.
214      * @param nbliidMap
215      *            Map containing the non-blocking-list number as key,
216      *            and the list of Instance Identifier corresponding to each port-list
217      *            as value.
218      *
219      * @return Result true/false based on status of operation.
220      */
221     boolean updatePortMappingWithOduSwitchingPools(String nodeId, InstanceIdentifier<OduSwitchingPools> ospIID,
222         Map<Uint16, List<InstanceIdentifier<PortList>>> nbliidMap);
223
224     /**
225      * This method check the presence or not of a given node inside the PortMapping
226      * datastore.
227      *
228      * @param nodeId
229      *            Unique Identifier for the node of interest.
230      *
231      * @return Result true/false based on existance or not of a given node.
232      */
233     boolean isNodeExist(String nodeId);
234
235 }