Update portmapping YANG model
[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 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.mapping.Mapping;
12 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.mc.capabilities.McCapabilities;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.network.Nodes;
14
15 public interface PortMapping {
16
17     /**
18      * This method creates logical to physical port mapping for a given device.
19      * Instead of parsing all the circuit packs/ports in the device, this methods
20      * does a selective read operation on degree/srg subtree to get circuit
21      * packs/ports that map to :
22      *
23      * <p>
24      * 1. DEGn-TTP-TX, DEGn-TTP-RX, DEGn-TTP-TXRX
25      *
26      * <p>
27      * 2. SRGn-PPp-TX, SRGn-PPp-RX, SRGn-PPp-TXRX
28      *
29      * <p>
30      * 3. LINEn
31      *
32      * <p>
33      * 4. CLNTn.
34      *
35      * <p>
36      * If the port is Mw it also store the OMS, OTS interface provisioned on the
37      * port. It skips the logical ports that are internal. If operation is
38      * successful the mapping gets stored in datastore corresponding to
39      * portmapping.yang data model.
40      *
41      * @param nodeId
42      *            node ID
43      * @param nodeVersion
44      *            node version
45      *
46      * @return true/false based on status of operation
47      */
48     boolean createMappingData(String nodeId, String nodeVersion);
49
50     /**
51      * This method removes mapping data from the datastore after disconnecting ODL
52      * from a Netconf device.
53      *
54      * @param nodeId
55      *            node ID
56      */
57     void deleteMappingData(String nodeId);
58
59     /**
60      * This method for a given node's termination point returns the Mapping object
61      * based on portmapping.yang model stored in the MD-SAL data store which is
62      * created when the node is connected for the first time. The mapping object
63      * basically contains the following attributes of interest:
64      *
65      * <p>
66      * 1. Supporting circuit pack
67      *
68      * <p>
69      * 2. Supporting port
70      *
71      * <p>
72      * 3. Supporting OTS/OMS interface (if port on ROADM)
73      *
74      * @param nodeId
75      *            Unique Identifier for the node of interest.
76      * @param logicalConnPoint
77      *            Name of the logical point
78      *
79      * @return Result Mapping object if success otherwise null.
80      */
81     Mapping getMapping(String nodeId, String logicalConnPoint);
82
83     /**
84      * This method allows retrieving a Mapping object from the mapping list stored in
85      * the MD-SAL data store. The main interest is to retrieve the
86      * logical-connection-point associated with a given port on a supporting
87      * circuit-pack
88      *
89      * @param nodeId
90      *            Unique Identifier for the node of interest.
91      * @param circuitPackName
92      *            Name of the supporting circuit-pack
93      * @param circuitPackName
94      *            Name of the supporting port
95      *
96      * @return Result Mapping object if success otherwise null.
97      */
98     Mapping getMapping(String nodeId, String circuitPackName, String portName);
99
100     /**
101      * This method, for a given node media channel-capabilities, returns the object
102      * based on portmapping.yang model stored in the MD-SAL data store which is
103      * created when the node is connected for the first time. The mapping object
104      * basically contains the following attributes of interest:
105      *
106      * <p>
107      * 1. slot width granularity
108      *
109      * <p>
110      * 2. center frequency granularity
111      *
112      * <p>
113      * 3. Supporting OMS interface (if port on ROADM)
114      *
115      * <p>
116      * 4. Supporting OTS interface (if port on ROADM)
117      *
118      * @param nodeId
119      *            Unique Identifier for the node of interest.
120      * @param mcLcp
121      *            Name of the MC-capability
122      *
123      * @return Result McCapabilities.
124      */
125     McCapabilities getMcCapbilities(String nodeId, String mcLcp);
126
127     /**
128      * This method for a given node, allows to update a specific mapping based on
129      * portmapping.yang model already stored in the MD-SAL data store, following
130      * some changes on the device port (creation of interface supported on this
131      * port, change of port admin state, etc).
132      *
133     * @param nodeId
134      *            Unique Identifier for the node of interest.
135      * @param mapping
136      *            Old mapping to be updated.
137      *
138      * @return Result true/false based on status of operation.
139      */
140     boolean updateMapping(String nodeId, Mapping mapping);
141
142     /**
143      * Returns all Mapping informations for a given ordm device. This method returns
144      * all Mapping informations already stored in the MD-SAL data store for a given
145      * openroadm device. Beyound the list of mappings, it gives access to general
146      * node information as its version or its node type, etc.
147      *
148      * @param nodeId
149      *            Unique Identifier for the node of interest.
150      *
151      * @return node data if success otherwise null.
152      */
153     Nodes getNode(String nodeId);
154 }