Port-mapping changes to support 7.1.0 models
[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.rev201012.network.Nodes;
12 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev201012.network.nodes.Mapping;
13 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev201012.network.nodes.McCapabilities;
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
52      * ODL 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
61      * object based on portmapping.yang model stored in the MD-SAL data store
62      * which is created when the node is connected for the first time. The
63      * mapping object 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 OMS interface (if port on ROADM) 4. Supporting OTS
73      * interface (if port on ROADM)
74      *
75      * @param nodeId
76      *            Unique Identifier for the node of interest.
77      * @param logicalConnPoint
78      *            Name of the logical point
79      *
80      * @return Result Mapping object if success otherwise null.
81      */
82     Mapping getMapping(String nodeId, String logicalConnPoint);
83
84     /**
85      * This method for a given node's media channel-capabilities returns the
86      * object based on portmapping.yang model stored in the MD-SAL data store
87      * which is created when the node is connected for the first time. The
88      * mapping object basically contains the following attributes of interest:
89      *
90      * <p>
91      * 1. slot width granularity
92      *
93      * <p>
94      * 2. center frequency granularity
95      *
96      * <p>
97      * 3. Supporting OMS interface (if port on ROADM) 4. Supporting OTS
98      * interface (if port on ROADM)
99      *
100      * @param nodeId
101      *            Unique Identifier for the node of interest.
102      * @param mcLcp
103      *            Name of the MC-capability
104      *
105      * @return Result McCapabilities.
106      */
107     McCapabilities getMcCapbilities(String nodeId, String mcLcp);
108
109     boolean updateMapping(String nodeId, Mapping mapping);
110
111     /**
112      * Returns all Mapping informations for a given ordm device.
113      * This method returns all Mapping informations already stored in the MD-SAL
114      * data store for a given openroadm device. Beyound the list of mappings, it
115      * gives access to general node information as its version or its node type,
116      * etc.
117      *
118      * @param nodeId
119      *            Unique Identifier for the node of interest.
120      *
121      * @return node data if success otherwise null.
122      */
123     Nodes getNode(String nodeId);
124 }