2 * Copyright © 2017 AT&T and others. All rights reserved.
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
9 package org.opendaylight.transportpce.common.openroadminterfaces;
11 import java.util.Optional;
13 public interface OpenRoadmInterfaces {
16 * This methods does an edit-config operation on the openROADM device in
17 * order to create the given interface.
20 * Before posting the interface it checks if: 1. Interface with same name
21 * does not exist 2. If exists then admin state of interface is
22 * outOfState/Maintenance
25 * @param nodeId node ID
26 * @param ifBuilder Builder object containing the data to post.
29 * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
32 <T> void postInterface(String nodeId, T ifBuilder) throws OpenRoadmInterfaceException;
35 * This methods does an edit-config operation on the openROADM device in
36 * order to manages the equipment-state status of the circuit pack on which
37 * OpenRoadmEthernet or OpenRoadmOch interfaces are created, according to
38 * OpenRoadm whitepaper. Concerns only XPDR node.
40 * @param nodeId node ID
41 * @param circuitPackName Circtuit-Pack name
42 * @param activate activate or not
44 * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
46 void postEquipmentState(String nodeId, String circuitPackName, boolean activate) throws OpenRoadmInterfaceException;
49 * This private does a get on the interface subtree of the device with the
50 * interface name as the key and return the class corresponding to the
53 * @param nodeId node ID
55 * @param interfaceName
56 * Name of the interface
60 * @return Optional of Interface from datastore
62 * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
64 <T> Optional<T> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException;
67 * This methods does an edit-config operation on the openROADM device in
68 * order to delete the given interface.
71 * Before deleting the method: 1. Checks if interface exists 2. If exists
72 * then changes the state of interface to outOfService
75 * @param nodeId node ID
77 * @param interfaceName
78 * Name of the interface to delete.
80 * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
82 void deleteInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException;
85 * This methods does an edit-config operation on the openROADM device in
86 * order to create the OTN given interface.
88 * @param <T> specified type of object
89 * @param nodeId node ID
90 * @param ifBuilder Builder object containing the data to post
91 * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
93 <T> void postOTNInterface(String nodeId, T ifBuilder) throws OpenRoadmInterfaceException;
96 * This methods does an edit-config operation on the openROADM device in
97 * order to manages the equipment-state status of the circuit pack on which
98 * OTN interfaces are created.
100 * @param nodeId node ID
101 * @param circuitPackName Circtuit-Pack name
102 * @param activate activate or not
104 * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
106 void postOTNEquipmentState(String nodeId, String circuitPackName, boolean activate)
107 throws OpenRoadmInterfaceException;
109 String getSupportedInterface(String nodeId, String interfaceName);