update portmapping YANG to store SAPI/DAPI hashmap
[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.rev200429.network.Nodes;
12 import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200429.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      * @param nodeVersion
43      *            node version
44      *
45      * @return true/false based on status of operation
46      */
47     boolean createMappingData(String nodeId, String nodeVersion);
48
49     /**
50      * This method removes mapping data from the datastore after disconnecting
51      * ODL from a Netconf device.
52      *
53      * @param nodeId
54      *            node ID
55      */
56     void deleteMappingData(String nodeId);
57
58     /**
59      * This method for a given node's termination point returns the Mapping
60      * object based on portmapping.yang model stored in the MD-SAL data store
61      * which is created when the node is connected for the first time. The
62      * mapping object basically contains the following attributes of interest:
63      *
64      * <p>
65      * 1. Supporting circuit pack
66      *
67      * <p>
68      * 2. Supporting port
69      *
70      * <p>
71      * 3. Supporting OMS interface (if port on ROADM) 4. Supporting OTS
72      * 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     boolean updateMapping(String nodeId, Mapping mapping);
84
85     /**
86      * Returns all Mapping informations for a given ordm device.
87      * This method returns all Mapping informations already stored in the MD-SAL
88      * data store for a given openroadm device. Beyound the list of mappings, it
89      * gives access to general node information as its version or its node type,
90      * etc.
91      *
92      * @param nodeId
93      *            Unique Identifier for the node of interest.
94      *
95      * @return node data if success otherwise null.
96      */
97     Nodes getNode(String nodeId);
98 }