Merge "fix more javadocs warnings"
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / openroadminterfaces / OpenRoadmInterfaces.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.openroadminterfaces;
10
11 import java.util.Optional;
12
13 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
14 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceBuilder;
15
16 public interface OpenRoadmInterfaces {
17
18     /**
19      * This methods does an edit-config operation on the openROADM device in
20      * order to create the given interface.
21      *
22      * <p>
23      * Before posting the interface it checks if: 1. Interface with same name
24      * does not exist 2. If exists then admin state of interface is
25      * outOfState/Maintenance
26      * </p>
27      *
28      * @param nodeId node ID
29      *
30      * @param ifBuilder Builder object containing the data to post.
31      *
32      * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
33      *
34      */
35     void postInterface(String nodeId, InterfaceBuilder ifBuilder) throws OpenRoadmInterfaceException;
36
37     /**
38      * This methods does an edit-config operation on the openROADM device in
39      * order to manages the equipment-state status of the circuit pack on which
40      * OpenRoadmEthernet or OpenRoadmOch interfaces are created, according to
41      * OpenRoadm whitepaper. Concerns only XPDR node.
42      *
43      * @param nodeId node ID
44      * @param circuitPackName Circtuit-Pack name
45      * @param activate activate or not
46      *
47      * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
48      */
49     void postEquipmentState(String nodeId, String circuitPackName, boolean activate) throws OpenRoadmInterfaceException;
50
51     /**
52      * This private does a get on the interface subtree of the device with the
53      * interface name as the key and return the class corresponding to the
54      * interface type.
55      *
56      * @param nodeId node ID
57      *
58      * @param interfaceName
59      *            Name of the interface
60      *
61      * @return Optional of Interface from datastore
62      *
63      * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
64      */
65     Optional<Interface> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException;
66
67     /**
68      * This methods does an edit-config operation on the openROADM device in
69      * order to delete the given interface.
70      *
71      * <p>
72      * Before deleting the method: 1. Checks if interface exists 2. If exists
73      * then changes the state of interface to outOfService
74      * </p>
75      *
76      * @param nodeId node ID
77      *
78      * @param interfaceName
79      *            Name of the interface to delete.
80      *
81      * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
82      */
83     void deleteInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException;
84
85 }