Class FlowBasedServicesUtils


  • public final class FlowBasedServicesUtils
    extends java.lang.Object
    • Field Detail

      • 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​(TypedReadTransaction<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,
                                                       TypedWriteTransaction<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,
                                       TypedWriteTransaction<Datastore.Configuration> writeTransaction)
      • installLPortDispatcherFlow

        public static void installLPortDispatcherFlow​(org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                                      BoundServices boundService,
                                                      java.lang.String interfaceName,
                                                      TypedWriteTransaction<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,
                                                        TypedWriteTransaction<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,
                                                                   TypedWriteTransaction<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<java.lang.Void> bindDefaultEgressDispatcherService​(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​(TypedWriteTransaction<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<java.lang.Void> bindDefaultEgressDispatcherService​(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<java.lang.Void> bindDefaultEgressDispatcherService​(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​(TypedWriteTransaction<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,
                                             ManagedNewTransactionRunner txRunner,
                                             java.util.List<com.google.common.util.concurrent.ListenableFuture<java.lang.Void>> futures)
      • removeEgressDispatcherFlows

        public static void removeEgressDispatcherFlows​(org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                                       java.lang.String iface,
                                                       TypedWriteTransaction<Datastore.Configuration> writeTransaction,
                                                       short currentServiceIndex)
      • removeEgressSplitHorizonDispatcherFlow

        public static void removeEgressSplitHorizonDispatcherFlow​(org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                                                  java.lang.String iface,
                                                                  TypedWriteTransaction<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 bound
        currentServiceInfo - 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<java.lang.Void>> futures,
                                                   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.controller.md.sal.binding.api.ReadTransaction tx,
                                                               java.lang.String interfaceName,
                                                               java.lang.Class<? extends ServiceModeBase> serviceMode)
                                                        throws org.opendaylight.controller.md.sal.common.api.data.ReadFailedException
        Throws:
        org.opendaylight.controller.md.sal.common.api.data.ReadFailedException
      • getBoundServicesState

        public static BoundServicesState getBoundServicesState​(TypedReadTransaction<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
      • isInterfaceTypeBasedServiceBinding

        public static boolean isInterfaceTypeBasedServiceBinding​(java.lang.String interfaceName)