Class FlowBasedServicesUtils
- java.lang.Object
-
- org.opendaylight.genius.interfacemanager.servicebindings.flowbased.utilities.FlowBasedServicesUtils
-
public final class FlowBasedServicesUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FlowBasedServicesUtils.ServiceMode
-
Field Summary
Fields Modifier and Type Field Description static java.util.Collection<java.lang.String>
INTERFACE_TYPE_BASED_SERVICE_BINDING_KEYWORDS
static com.google.common.collect.ImmutableBiMap<FlowBasedServicesUtils.ServiceMode,java.lang.Class<? extends ServiceModeBase>>
SERVICE_MODE_MAP
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addBoundServicesState(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Operational> tx, java.lang.String interfaceName, BoundServicesState interfaceBoundServicesState)
static com.google.common.util.concurrent.ListenableFuture<?>
bindDefaultEgressDispatcherService(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner, java.lang.String interfaceName, java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> instructions)
static com.google.common.util.concurrent.ListenableFuture<?>
bindDefaultEgressDispatcherService(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface interfaceInfo, java.lang.String interfaceName, int ifIndex, long groupId)
static com.google.common.util.concurrent.ListenableFuture<?>
bindDefaultEgressDispatcherService(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface interfaceInfo, java.lang.String portNo, java.lang.String interfaceName, int ifIndex)
static void
bindDefaultEgressDispatcherService(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, java.lang.String interfaceName, java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> instructions)
static void
bindDefaultEgressDispatcherService(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface interfaceInfo, java.lang.String portNo, java.lang.String interfaceName, int ifIndex)
static BoundServicesState
buildBoundServicesState(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface interfaceState, java.lang.Class<? extends ServiceModeBase> serviceMode)
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<BoundServices>
buildDefaultServiceId(java.lang.String interfaceName)
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<BoundServices>
buildServiceId(java.lang.String interfaceName, short serviceIndex)
static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<BoundServices>
buildServiceId(java.lang.String interfaceName, short serviceIndex, java.lang.Class<? extends ServiceModeBase> serviceMode)
static BoundServices
getBoundServices(java.lang.String serviceName, short servicePriority, int flowPriority, org.opendaylight.yangtools.yang.common.Uint64 cookie, java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> instructions)
static BoundServicesState
getBoundServicesState(org.opendaylight.mdsal.binding.api.ReadTransaction tx, java.lang.String interfaceName, java.lang.Class<? extends ServiceModeBase> serviceMode)
static BoundServicesState
getBoundServicesState(org.opendaylight.mdsal.binding.util.TypedReadTransaction<org.opendaylight.mdsal.binding.util.Datastore.Operational> tx, java.lang.String interfaceName, java.lang.Class<? extends ServiceModeBase> serviceMode)
static @Nullable org.opendaylight.yangtools.yang.common.Uint64
getDpnIdFromInterface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState)
static java.lang.String
getFlowRef(short tableId, org.opendaylight.yangtools.yang.common.Uint64 dpnId, java.lang.String infName)
static BoundServices[]
getHighAndLowPriorityService(java.util.List<BoundServices> serviceInfos, BoundServices currentServiceInfo)
This utility method returns an array of ServiceInfo in which index 0 will have the immediate lower priority service and index 1 will have the immediate higher priority service among the list of existing serviceInfos.static BoundServices
getHighestPriorityService(java.util.List<BoundServices> serviceInfos)
static java.util.List<MatchInfo>
getMatchInfoForDispatcherTable(int interfaceTag, short servicePriority)
static java.util.List<MatchInfoBase>
getMatchInfoForEgressDispatcherTable(int interfaceTag, short serviceIndex)
static @NonNull java.util.List<MatchInfo>
getMatchInfoForTunnelPortAtIngressTable(org.opendaylight.yangtools.yang.common.Uint64 dpId, long portNo)
static java.util.List<MatchInfo>
getMatchInfoForVlanPortAtIngressTable(org.opendaylight.yangtools.yang.common.Uint64 dpId, long portNo, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface)
static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId
getNodeConnectorIdFromInterface(java.lang.String interfaceName, InterfaceManagerCommonUtils interfaceManagerCommonUtils)
static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId
getNodeConnectorIdFromInterface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState)
static ServicesInfo
getServicesInfoForInterface(org.opendaylight.mdsal.binding.util.TypedReadTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, java.lang.String interfaceName, java.lang.Class<? extends ServiceModeBase> serviceMode)
static void
installEgressDispatcherFlows(org.opendaylight.yangtools.yang.common.Uint64 dpId, BoundServices boundService, java.lang.String interfaceName, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, int interfaceTag, short currentServiceIndex, short nextServiceIndex, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface)
static void
installEgressDispatcherSplitHorizonFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, BoundServices boundService, java.lang.String interfaceName, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, int interfaceTag, short currentServiceIndex, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface)
static void
installFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> writeTransaction)
static void
installInterfaceIngressFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface, BoundServices boundServiceNew, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, java.util.List<MatchInfo> matches, int lportTag, short tableId)
static void
installLPortDispatcherFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, BoundServices boundService, java.lang.String interfaceName, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, int interfaceTag, short currentServiceIndex, short nextServiceIndex)
static void
installLportIngressFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, long portNo, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface, java.util.List<com.google.common.util.concurrent.ListenableFuture<?>> futures, org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner, int lportTag)
static boolean
isInterfaceTypeBasedServiceBinding(java.lang.String interfaceName)
static void
removeBoundServicesState(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Operational> tx, java.lang.String interfaceName, java.lang.Class<? extends ServiceModeBase> serviceMode)
static void
removeEgressDispatcherFlows(org.opendaylight.yangtools.yang.common.Uint64 dpId, java.lang.String iface, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> writeTransaction, short currentServiceIndex)
static void
removeEgressSplitHorizonDispatcherFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, java.lang.String iface, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> writeTransaction)
static void
removeIngressFlow(java.lang.String name, BoundServices serviceOld, org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> writeTransaction)
static void
removeIngressFlow(java.lang.String interfaceName, org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner, java.util.List<com.google.common.util.concurrent.ListenableFuture<?>> futures)
static void
removeLPortDispatcherFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, java.lang.String iface, BoundServices boundServicesOld, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> writeTransaction, short currentServiceIndex)
-
-
-
Field Detail
-
SERVICE_MODE_MAP
public static final com.google.common.collect.ImmutableBiMap<FlowBasedServicesUtils.ServiceMode,java.lang.Class<? extends ServiceModeBase>> SERVICE_MODE_MAP
-
INTERFACE_TYPE_BASED_SERVICE_BINDING_KEYWORDS
public static final java.util.Collection<java.lang.String> INTERFACE_TYPE_BASED_SERVICE_BINDING_KEYWORDS
-
-
Method Detail
-
getServicesInfoForInterface
public static ServicesInfo getServicesInfoForInterface(org.opendaylight.mdsal.binding.util.TypedReadTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, java.lang.String interfaceName, java.lang.Class<? extends ServiceModeBase> serviceMode) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
getNodeConnectorIdFromInterface
public static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId getNodeConnectorIdFromInterface(java.lang.String interfaceName, InterfaceManagerCommonUtils interfaceManagerCommonUtils)
-
getNodeConnectorIdFromInterface
public static org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorId getNodeConnectorIdFromInterface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState)
-
getDpnIdFromInterface
public static @Nullable org.opendaylight.yangtools.yang.common.Uint64 getDpnIdFromInterface(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState)
-
getMatchInfoForVlanPortAtIngressTable
public static java.util.List<MatchInfo> getMatchInfoForVlanPortAtIngressTable(org.opendaylight.yangtools.yang.common.Uint64 dpId, long portNo, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface)
-
getMatchInfoForTunnelPortAtIngressTable
public static @NonNull java.util.List<MatchInfo> getMatchInfoForTunnelPortAtIngressTable(org.opendaylight.yangtools.yang.common.Uint64 dpId, long portNo)
-
getMatchInfoForDispatcherTable
public static java.util.List<MatchInfo> getMatchInfoForDispatcherTable(int interfaceTag, short servicePriority)
-
getMatchInfoForEgressDispatcherTable
public static java.util.List<MatchInfoBase> getMatchInfoForEgressDispatcherTable(int interfaceTag, short serviceIndex)
-
installInterfaceIngressFlow
public static void installInterfaceIngressFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface, BoundServices boundServiceNew, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, java.util.List<MatchInfo> matches, int lportTag, short tableId)
-
installFlow
public static void installFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> writeTransaction)
-
installLPortDispatcherFlow
public static void installLPortDispatcherFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, BoundServices boundService, java.lang.String interfaceName, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, int interfaceTag, short currentServiceIndex, short nextServiceIndex)
-
installEgressDispatcherFlows
public static void installEgressDispatcherFlows(org.opendaylight.yangtools.yang.common.Uint64 dpId, BoundServices boundService, java.lang.String interfaceName, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, int interfaceTag, short currentServiceIndex, short nextServiceIndex, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface)
-
installEgressDispatcherSplitHorizonFlow
public static void installEgressDispatcherSplitHorizonFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, BoundServices boundService, java.lang.String interfaceName, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, int interfaceTag, short currentServiceIndex, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface)
-
getBoundServices
public static BoundServices getBoundServices(java.lang.String serviceName, short servicePriority, int flowPriority, org.opendaylight.yangtools.yang.common.Uint64 cookie, java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> instructions)
-
buildServiceId
public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<BoundServices> buildServiceId(java.lang.String interfaceName, short serviceIndex)
-
buildServiceId
public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<BoundServices> buildServiceId(java.lang.String interfaceName, short serviceIndex, java.lang.Class<? extends ServiceModeBase> serviceMode)
-
buildDefaultServiceId
public static org.opendaylight.yangtools.yang.binding.InstanceIdentifier<BoundServices> buildDefaultServiceId(java.lang.String interfaceName)
-
bindDefaultEgressDispatcherService
public static com.google.common.util.concurrent.ListenableFuture<?> bindDefaultEgressDispatcherService(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface interfaceInfo, java.lang.String portNo, java.lang.String interfaceName, int ifIndex)
-
bindDefaultEgressDispatcherService
public static void bindDefaultEgressDispatcherService(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface interfaceInfo, java.lang.String portNo, java.lang.String interfaceName, int ifIndex)
-
bindDefaultEgressDispatcherService
public static com.google.common.util.concurrent.ListenableFuture<?> bindDefaultEgressDispatcherService(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface interfaceInfo, java.lang.String interfaceName, int ifIndex, long groupId)
-
bindDefaultEgressDispatcherService
public static com.google.common.util.concurrent.ListenableFuture<?> bindDefaultEgressDispatcherService(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner, java.lang.String interfaceName, java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> instructions)
-
bindDefaultEgressDispatcherService
public static void bindDefaultEgressDispatcherService(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, java.lang.String interfaceName, java.util.List<org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction.list.Instruction> instructions)
-
removeIngressFlow
public static void removeIngressFlow(java.lang.String interfaceName, org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner, java.util.List<com.google.common.util.concurrent.ListenableFuture<?>> futures)
-
removeIngressFlow
public static void removeIngressFlow(java.lang.String name, BoundServices serviceOld, org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> writeTransaction)
-
removeLPortDispatcherFlow
public static void removeLPortDispatcherFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, java.lang.String iface, BoundServices boundServicesOld, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> writeTransaction, short currentServiceIndex)
-
removeEgressDispatcherFlows
public static void removeEgressDispatcherFlows(org.opendaylight.yangtools.yang.common.Uint64 dpId, java.lang.String iface, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> writeTransaction, short currentServiceIndex)
-
removeEgressSplitHorizonDispatcherFlow
public static void removeEgressSplitHorizonDispatcherFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, java.lang.String iface, org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> writeTransaction)
-
getFlowRef
public static java.lang.String getFlowRef(short tableId, org.opendaylight.yangtools.yang.common.Uint64 dpnId, java.lang.String infName)
-
getHighAndLowPriorityService
public static BoundServices[] getHighAndLowPriorityService(java.util.List<BoundServices> serviceInfos, BoundServices currentServiceInfo)
This utility method returns an array of ServiceInfo in which index 0 will have the immediate lower priority service and index 1 will have the immediate higher priority service among the list of existing serviceInfos.- Parameters:
serviceInfos
- list of services boundcurrentServiceInfo
- current service bound- Returns:
- array bound services
-
getHighestPriorityService
public static BoundServices getHighestPriorityService(java.util.List<BoundServices> serviceInfos)
-
installLportIngressFlow
public static void installLportIngressFlow(org.opendaylight.yangtools.yang.common.Uint64 dpId, long portNo, org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface iface, java.util.List<com.google.common.util.concurrent.ListenableFuture<?>> futures, org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner, int lportTag)
-
buildBoundServicesState
public static BoundServicesState buildBoundServicesState(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface interfaceState, java.lang.Class<? extends ServiceModeBase> serviceMode)
-
getBoundServicesState
public static BoundServicesState getBoundServicesState(org.opendaylight.mdsal.binding.api.ReadTransaction tx, java.lang.String interfaceName, java.lang.Class<? extends ServiceModeBase> serviceMode) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
getBoundServicesState
public static BoundServicesState getBoundServicesState(org.opendaylight.mdsal.binding.util.TypedReadTransaction<org.opendaylight.mdsal.binding.util.Datastore.Operational> tx, java.lang.String interfaceName, java.lang.Class<? extends ServiceModeBase> serviceMode) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
- Throws:
java.util.concurrent.ExecutionException
java.lang.InterruptedException
-
addBoundServicesState
public static void addBoundServicesState(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Operational> tx, java.lang.String interfaceName, BoundServicesState interfaceBoundServicesState)
-
removeBoundServicesState
public static void removeBoundServicesState(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Operational> tx, java.lang.String interfaceName, java.lang.Class<? extends ServiceModeBase> serviceMode)
-
isInterfaceTypeBasedServiceBinding
public static boolean isInterfaceTypeBasedServiceBinding(java.lang.String interfaceName)
-
-