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
27 * @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
58 * @return Optional of Interface from datastore
60 * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
62 <T> Optional<T> getInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException;
65 * This methods does an edit-config operation on the openROADM device in
66 * order to delete the given interface.
69 * Before deleting the method: 1. Checks if interface exists 2. If exists
70 * then changes the state of interface to outOfService
73 * @param nodeId node ID
75 * @param interfaceName
76 * Name of the interface to delete.
78 * @throws OpenRoadmInterfaceException OpenRoadm Interface Exception
80 void deleteInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException;