Reintroduce (ordm 2.2.1) Rdm2Rdm links in topo
[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.rev170228.network.Nodes;
12 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
13
14 public interface PortMapping {
15
16     /**
17      * This method creates logical to physical port mapping for a given device.
18      * Instead of parsing all the circuit packs/ports in the device this methods
19      * does a selective read operation on degree/srg subtree to get circuit
20      * packs/ports that map to :
21      *
22      * <p>
23      * 1. DEGn-TTP-TX, DEGn-TTP-RX, DEGn-TTP-TXRX
24      *
25      * <p>
26      * 2. SRGn-PPp-TX, SRGn-PPp-RX, SRGn-PPp-TXRX
27      *
28      * <p>
29      * 3. LINEn
30      *
31      * <p>
32      * 4. CLNTn.
33      *
34      * <p>
35      * If the port is Mw it also store the OMS, OTS interface provisioned on the
36      * port. It skips the logical ports that are internal. If operation is
37      * successful the mapping gets stored in datastore corresponding to
38      * portmapping.yang data model.
39      *
40      * @param nodeId
41      *            node ID
42      *
43      * @return true/false based on status of operation
44      */
45     boolean createMappingData(String nodeId, String nodeVersion);
46
47     /**
48      * This method removes mapping data from the datastore after disconnecting
49      * ODL from a Netconf device.
50      *
51      * @param nodeId
52      *            node ID
53      */
54     void deleteMappingData(String nodeId);
55
56     /**
57      * This method for a given node's termination point returns the Mapping
58      * object based on portmapping.yang model stored in the MD-SAL data store
59      * which is created when the node is connected for the first time. The
60      * mapping object basically contains the following attributes of interest:
61      *
62      * <p>
63      * 1. Supporting circuit pack
64      *
65      * <p>
66      * 2. Supporting port
67      *
68      * <p>
69      * 3. Supporting OMS interface (if port on ROADM) 4. Supporting OTS
70      * interface (if port on ROADM)
71      *
72      * @param nodeId
73      *            Unique Identifier for the node of interest.
74      * @param logicalConnPoint
75      *            Name of the logical point
76      *
77      * @return Result Mapping object if success otherwise null.
78      */
79     Mapping getMapping(String nodeId, String logicalConnPoint);
80
81     boolean updateMapping(String nodeId, Mapping mapping);
82
83     /**
84      * Returns all Mapping informations for a given ordm device.
85      * This method returns all Mapping informations already stored in the MD-SAL
86      * data store for a given openroadm device. Beyound the list of mappings, it
87      * gives access to general node information as its version or its node type,
88      * etc.
89      *
90      * @param nodeId
91      *            Unique Identifier for the node of interest.
92      *
93      * @return node data if success otherwise null.
94      */
95     Nodes getNode(String nodeId);
96 }