Fix IInterfaceManager.getBridgeRefEntryMap() return type
[genius.git] / interfacemanager / interfacemanager-api / src / main / java / org / opendaylight / genius / interfacemanager / interfaces / IInterfaceManager.java
1 /*
2  * Copyright (c) 2016, 2017 Ericsson India Global Services Pvt Ltd. 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 package org.opendaylight.genius.interfacemanager.interfaces;
9
10 import com.google.common.util.concurrent.ListenableFuture;
11 import java.util.List;
12 import java.util.Map;
13 import java.util.concurrent.ExecutionException;
14 import org.opendaylight.genius.interfacemanager.exceptions.InterfaceAlreadyExistsException;
15 import org.opendaylight.genius.interfacemanager.globals.InterfaceInfo;
16 import org.opendaylight.genius.mdsalutil.ActionInfo;
17 import org.opendaylight.mdsal.binding.api.ReadTransaction;
18 import org.opendaylight.mdsal.binding.util.Datastore.Configuration;
19 import org.opendaylight.mdsal.binding.util.TypedWriteTransaction;
20 import org.opendaylight.mdsal.common.api.ReadFailedException;
21 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntry;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlan;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.InterfaceTypeBase;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeAugmentation;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
30 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
31 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
32 import org.opendaylight.yangtools.yang.common.Uint64;
33
34 public interface IInterfaceManager {
35
36     Long getPortForInterface(String ifName);
37
38     Long getPortForInterface(Interface intf);
39
40     Uint64 getDpnForInterface(String ifName);
41
42     Uint64 getDpnForInterface(Interface intrf);
43
44     String getEndpointIpForDpn(Uint64 dpnId);
45
46     List<ActionInfo> getInterfaceEgressActions(String ifName);
47
48     InterfaceInfo getInterfaceInfo(String intInfo);
49
50     InterfaceInfo getInterfaceInfoFromOperationalDataStore(String interfaceName,
51             InterfaceInfo.InterfaceType interfaceType);
52
53     InterfaceInfo getInterfaceInfoFromOperationalDataStore(String interfaceName);
54
55     /**
56      * This API is currently used only for CLI usage. Please be careful that this API
57      * can return stale entries since it is just a cache read.
58      */
59     InterfaceInfo getInterfaceInfoFromOperationalDSCache(String interfaceName);
60
61     /**
62      * Retrieve the interface information from the configuration datastore.
63      *
64      * @param interfaceName The interface name.
65      * @return The interface information.
66      * @deprecated Use {@link #getInterfaceInfoFromConfigDataStore(ReadTransaction, String)}.
67      */
68     @Deprecated
69     Interface getInterfaceInfoFromConfigDataStore(String interfaceName);
70
71     /**
72      * Retrieve the interface information from the configuration datastore.
73      *
74      * @param tx The transaction to use.
75      * @param interfaceName The interface name.
76      * @return The interface information.
77      * @throws ReadFailedException if an exception occurs while reading from the datastore.
78      */
79     Interface getInterfaceInfoFromConfigDataStore(ReadTransaction tx, String interfaceName)
80             throws ReadFailedException, ExecutionException, InterruptedException;
81
82     /**
83      * Create a VLAN interface.
84      *
85      * @deprecated Use {@link #createVLANInterface(String, String, Integer, String, IfL2vlan.L2vlanMode)}.
86      */
87     @Deprecated
88     void createVLANInterface(String interfaceName, String portName, Uint64 dpId, Integer vlanId, String description,
89             IfL2vlan.L2vlanMode l2vlanMode) throws InterfaceAlreadyExistsException;
90
91     ListenableFuture<? extends Object> createVLANInterface(String interfaceName, String portName, Integer vlanId,
92             String description, IfL2vlan.L2vlanMode l2vlanMode) throws InterfaceAlreadyExistsException;
93
94     /**
95      * Create a VLAN interface.
96      *
97      * @deprecated Use {@link #createVLANInterface(String, String, Integer, String, IfL2vlan.L2vlanMode, boolean)}.
98      */
99     @Deprecated
100     void createVLANInterface(String interfaceName, String portName, Uint64 dpId, Integer vlanId, String description,
101             IfL2vlan.L2vlanMode l2vlanMode, boolean isExternal) throws InterfaceAlreadyExistsException;
102
103     ListenableFuture<? extends Object> createVLANInterface(String interfaceName, String portName, Integer vlanId,
104             String description, IfL2vlan.L2vlanMode l2vlanMode, boolean isExternal)
105                     throws InterfaceAlreadyExistsException;
106
107     boolean isServiceBoundOnInterfaceForIngress(short servicePriority, String interfaceName);
108
109     boolean isServiceBoundOnInterfaceForEgress(short servicePriority, String interfaceName);
110
111     void bindService(String interfaceName, Class<? extends ServiceModeBase> serviceMode, BoundServices serviceInfo);
112
113     void bindService(String interfaceName, Class<? extends ServiceModeBase> serviceMode, BoundServices serviceInfo,
114                      TypedWriteTransaction<Configuration> tx);
115
116     void unbindService(String interfaceName, Class<? extends ServiceModeBase> serviceMode, BoundServices serviceInfo);
117
118     List<Interface> getVlanInterfaces();
119
120     List<Interface> getVxlanInterfaces();
121
122     /**
123      * Retrieve an interface's children.
124      *
125      * @param parentInterface The parent interface.
126      * @return The child interfaces.
127      * @deprecated Use {@link #getChildInterfaces(ReadTransaction, String)} instead.
128      */
129     @Deprecated
130     List<Interface> getChildInterfaces(String parentInterface);
131
132     /**
133      * Retrieve an interface's children.
134      *
135      * @param tx The transaction to use.
136      * @param parentInterface The parent interface.
137      * @return The child interfaces.
138      * @throws ReadFailedException if an exception occurs while reading from the datastore.
139      */
140     List<Interface> getChildInterfaces(ReadTransaction tx, String parentInterface)
141             throws ReadFailedException, ExecutionException, InterruptedException;
142
143     /**
144      * Determine whether an interface is external.
145      *
146      * @param interfaceName The interface name.
147      * @return {@code true} if the interface is external, {@code false} if it isn't.
148      * @deprecated Use {@link #isExternalInterface(ReadTransaction, String)} instead.
149      */
150     @Deprecated
151     boolean isExternalInterface(String interfaceName);
152
153     /**
154      * Determine whether an interface is external.
155      *
156      * @param tx The transaction to use.
157      * @param interfaceName The interface name.
158      * @return {@code true} if the interface is external, {@code false} if it isn't.
159      * @throws ReadFailedException if an exception occurs while reading from the datastore.
160      */
161     boolean isExternalInterface(ReadTransaction tx, String interfaceName)
162             throws ReadFailedException, ExecutionException, InterruptedException;
163
164     String getPortNameForInterface(NodeConnectorId nodeConnectorId, String interfaceName);
165
166     String getPortNameForInterface(String dpnId, String interfaceName);
167
168     String getParentRefNameForInterface(String interfaceName);
169
170     Map<String, OvsdbTerminationPointAugmentation> getTerminationPointCache();
171
172     Map<String, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state
173             .Interface.OperStatus> getBfdStateCache();
174
175     OvsdbTerminationPointAugmentation getTerminationPointForInterface(String interfaceName);
176
177     OvsdbBridgeAugmentation getOvsdbBridgeForInterface(String interfaceName);
178
179     OvsdbBridgeAugmentation getOvsdbBridgeForNodeIid(InstanceIdentifier<Node> nodeIid);
180
181     List<OvsdbTerminationPointAugmentation> getPortsOnBridge(Uint64 dpnId);
182
183     List<OvsdbTerminationPointAugmentation> getTunnelPortsOnBridge(Uint64 dpnId);
184
185     Map<Class<? extends InterfaceTypeBase>, List<OvsdbTerminationPointAugmentation>>
186         getPortsOnBridgeByType(Uint64 dpnId);
187
188     void updateInterfaceParentRef(String interfaceName, String parentInterface);
189
190     void updateInterfaceParentRef(String interfaceName, String parentInterface, boolean readInterfaceBeforeWrite);
191
192     long getLogicalTunnelSelectGroupId(int lportTag);
193
194     boolean isItmDirectTunnelsEnabled();
195
196     Map<Uint64, BridgeRefEntry> getBridgeRefEntryMap();
197
198     boolean isItmOfTunnelsEnabled();
199
200     void addInternalTunnelToCache(String tunnelName, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang
201             .ietf.interfaces.rev140508.interfaces.state.Interface iface);
202
203     org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface
204         getInternalTunnelCacheInfo(String tunnelName);
205
206     org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface
207         removeInternalTunnelFromCache(String tunnelName);
208 }