5ddbe0109378d5d5954c5b56cb6e2d9bc44fcc14
[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.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
12
13 public interface PortMapping {
14
15     /**
16      * This method creates logical to physical port mapping for a given device.
17      * Instead of parsing all the circuit packs/ports in the device this methods
18      * does a selective read operation on degree/srg subtree to get circuit
19      * packs/ports that map to :
20      *
21      * <p>
22      * 1. DEGn-TTP-TX, DEGn-TTP-RX, DEGn-TTP-TXRX
23      *
24      * <p>
25      * 2. SRGn-PPp-TX, SRGn-PPp-RX, SRGn-PPp-TXRX
26      *
27      * <p>
28      * 3. LINEn
29      *
30      * <p>
31      * 4. CLNTn.
32      *
33      * <p>
34      * If the port is Mw it also store the OMS, OTS interface provisioned on the
35      * port. It skips the logical ports that are internal. If operation is
36      * successful the mapping gets stored in datastore corresponding to
37      * portmapping.yang data model.
38      *
39      * @return true/false based on status of operation
40      */
41     boolean createMappingData(String nodeId);
42
43     /**
44      * This method for a given node's termination point returns the Mapping object based on
45      * portmapping.yang model stored in the MD-SAL data store which is created when the node is
46      * connected for the first time. The mapping object basically contains the following attributes of
47      * interest:
48      *
49      * <p>
50      * 1. Supporting circuit pack
51      *
52      * <p>
53      * 2. Supporting port
54      *
55      * <p>
56      * 3. Supporting OMS interface (if port on ROADM) 4. Supporting OTS interface (if port on ROADM)
57      *
58      * @param nodeId Unique Identifier for the node of interest.
59      * @param logicalConnPoint Name of the logical point
60      *
61      * @return Result Mapping object if success otherwise null.
62      */
63
64     Mapping getMapping(String nodeId, String logicalConnPoint);
65 }