Make 'bindService' transaction-embeddable
[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
9 package org.opendaylight.genius.interfacemanager.interfaces;
10
11 import java.math.BigInteger;
12 import java.util.List;
13 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
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.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rev160406.IfL2vlan;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.service.bindings.services.info.BoundServices;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId;
22
23 public interface IInterfaceManager {
24
25     Long getPortForInterface(String ifName);
26
27     Long getPortForInterface(Interface intf);
28
29     BigInteger getDpnForInterface(String ifName);
30
31     BigInteger getDpnForInterface(Interface intrf);
32
33     String getEndpointIpForDpn(BigInteger dpnId);
34
35     List<ActionInfo> getInterfaceEgressActions(String ifName);
36
37     InterfaceInfo getInterfaceInfo(String intInfo);
38
39     InterfaceInfo getInterfaceInfoFromOperationalDataStore(String interfaceName,
40             InterfaceInfo.InterfaceType interfaceType);
41
42     InterfaceInfo getInterfaceInfoFromOperationalDataStore(String interfaceName);
43
44     /**
45      * This API is currently used only for CLI usage. Please be careful that this API
46      * can return stale entries since it is just a cache read.
47      */
48     InterfaceInfo getInterfaceInfoFromOperationalDSCache(String interfaceName);
49
50     Interface getInterfaceInfoFromConfigDataStore(String interfaceName);
51
52     void createVLANInterface(String interfaceName, String portName, BigInteger dpId, Integer vlanId, String description,
53             IfL2vlan.L2vlanMode l2vlanMode) throws InterfaceAlreadyExistsException;
54
55     void createVLANInterface(String interfaceName, String portName, BigInteger dpId, Integer vlanId, String description,
56             IfL2vlan.L2vlanMode l2vlanMode, boolean isExternal) throws InterfaceAlreadyExistsException;
57
58     boolean isServiceBoundOnInterfaceForIngress(short servicePriority, String interfaceName);
59
60     boolean isServiceBoundOnInterfaceForEgress(short servicePriority, String interfaceName);
61
62     void bindService(String interfaceName, Class<? extends ServiceModeBase> serviceMode, BoundServices serviceInfo);
63
64     void bindService(String interfaceName, Class<? extends ServiceModeBase> serviceMode, BoundServices serviceInfo,
65                      WriteTransaction tx);
66
67     void unbindService(String interfaceName, Class<? extends ServiceModeBase> serviceMode, BoundServices serviceInfo);
68
69     List<Interface> getVlanInterfaces();
70
71     List<Interface> getVxlanInterfaces();
72
73     boolean isExternalInterface(String interfaceName);
74
75     String getPortNameForInterface(NodeConnectorId nodeConnectorId, String interfaceName);
76
77     String getPortNameForInterface(String dpnId, String interfaceName);
78
79     String getParentRefNameForInterface(String interfaceName);
80
81     void updateInterfaceParentRef(String interfaceName, String parentInterface);
82
83     void updateInterfaceParentRef(String interfaceName, String parentInterface, boolean readInterfaceBeforeWrite);
84
85 }