Class MDSALManager

  • All Implemented Interfaces:
    IMdsalApiManager, org.opendaylight.infrautils.inject.Lifecycle

    @Singleton
    public class MDSALManager
    extends org.opendaylight.infrautils.inject.AbstractLifecycle
    implements IMdsalApiManager
    • Constructor Summary

      Constructors 
      Constructor Description
      MDSALManager​(org.opendaylight.mdsal.binding.api.DataBroker db)  
      MDSALManager​(org.opendaylight.mdsal.binding.api.DataBroker db, org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService pktProcService)
      Deprecated.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addBucket​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yangtools.yang.common.Uint64 dpId, long groupId, org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket bucket)  
      void addFlow​(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, FlowEntity flowEntity)
      Adds the given flow.
      void addFlow​(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow)
      Adds the given flow.
      void addGroup​(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, GroupEntity groupEntity)
      Adds the given group using the given transaction.
      void addGroup​(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group group)
      Adds the given group using the given transaction.
      boolean groupExists​(org.opendaylight.yangtools.yang.common.Uint64 dpId, long groupId)
      Check if OF group exist on DPN.
      com.google.common.util.concurrent.FluentFuture<?> installFlow​(FlowEntity flowEntity)
      Adds a flow.
      com.google.common.util.concurrent.FluentFuture<?> installFlow​(org.opendaylight.yangtools.yang.common.Uint64 dpId, FlowEntity flowEntity)
      Adds a flow.
      com.google.common.util.concurrent.FluentFuture<?> installFlow​(org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flowEntity)
      Adds a flow.
      void removeBucket​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yangtools.yang.common.Uint64 dpId, long groupId, long bucketId)  
      com.google.common.util.concurrent.FluentFuture<?> removeFlow​(FlowEntity flowEntity)
      Removes a flow.
      void removeFlow​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, FlowEntity flowEntity)
      Removes the given flow.
      void removeFlow​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yangtools.yang.common.Uint64 dpId, java.lang.String flowId, short tableId)
      Removes the given flow.
      void removeFlow​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow)
      Removes the given flow.
      void removeFlow​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey flowKey, short tableId)
      Removes the given flow.
      com.google.common.util.concurrent.ListenableFuture<?> removeFlow​(org.opendaylight.yangtools.yang.common.Uint64 dpId, short tableId, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId flowId)
      Removes a flow.
      com.google.common.util.concurrent.FluentFuture<?> removeFlow​(org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flowEntity)
      Removes a flow.
      void removeGroup​(GroupEntity groupEntity)
      Remove a group.
      void removeGroup​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, GroupEntity groupEntity)
      Remove a group using the given transaction.
      void removeGroup​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yangtools.yang.common.Uint64 dpId, long groupId)
      Remove a group using the given transaction.
      void removeGroup​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx, org.opendaylight.yangtools.yang.common.Uint64 dpId, org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group group)
      Remove a group using the given transaction.
      protected void start()  
      protected void stop()  
      void syncInstallFlow​(FlowEntity flowEntity)
      Installs a flow.
      void syncInstallFlow​(FlowEntity flowEntity, long delayTime)
      Install a flow.
      void syncInstallGroup​(GroupEntity groupEntity)
      Installs a group.
      void syncRemoveFlow​(FlowEntity flowEntity)
      Removes a flow.
      void syncRemoveFlow​(FlowEntity flowEntity, long delayTime)
      API to remove the flow on Data Plane Node synchronously.
      void syncRemoveGroup​(GroupEntity groupEntity)
      API to remove the Group on Data Plane Node synchronously.
      • Methods inherited from class org.opendaylight.infrautils.inject.AbstractLifecycle

        checkIsRunning, destroy, init, isRunning
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MDSALManager

        @Deprecated
        public MDSALManager​(org.opendaylight.mdsal.binding.api.DataBroker db,
                            org.opendaylight.yang.gen.v1.urn.opendaylight.packet.service.rev130709.PacketProcessingService pktProcService)
        Deprecated.
        Writes the flows and Groups to the MD SAL DataStore which will be sent to the openflowplugin for installing flows/groups on the switch. Other modules of VPN service that wants to install flows / groups on the switch uses this utility
        Parameters:
        db - dataBroker reference
        pktProcService - PacketProcessingService for sending the packet outs
      • MDSALManager

        @Inject
        public MDSALManager​(org.opendaylight.mdsal.binding.api.DataBroker db)
    • Method Detail

      • start

        protected void start()
        Specified by:
        start in class org.opendaylight.infrautils.inject.AbstractLifecycle
      • stop

        protected void stop()
        Specified by:
        stop in class org.opendaylight.infrautils.inject.AbstractLifecycle
      • installFlow

        public com.google.common.util.concurrent.FluentFuture<?> installFlow​(FlowEntity flowEntity)
        Description copied from interface: IMdsalApiManager
        Adds a flow.
        Specified by:
        installFlow in interface IMdsalApiManager
        Parameters:
        flowEntity - The flow entity.
      • installFlow

        public com.google.common.util.concurrent.FluentFuture<?> installFlow​(org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                                                             org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flowEntity)
        Description copied from interface: IMdsalApiManager
        Adds a flow.
        Specified by:
        installFlow in interface IMdsalApiManager
        Parameters:
        dpId - The DPN identifier.
        flowEntity - The flow entity.
      • installFlow

        public com.google.common.util.concurrent.FluentFuture<?> installFlow​(org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                                                             FlowEntity flowEntity)
        Description copied from interface: IMdsalApiManager
        Adds a flow.
        Specified by:
        installFlow in interface IMdsalApiManager
        Parameters:
        dpId - The DPN identifier.
        flowEntity - The flow entity.
      • removeFlow

        public com.google.common.util.concurrent.ListenableFuture<?> removeFlow​(org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                                                                short tableId,
                                                                                org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId flowId)
        Description copied from interface: IMdsalApiManager
        Removes a flow.
        Specified by:
        removeFlow in interface IMdsalApiManager
        Parameters:
        dpId - The DPN identifier.
        tableId - The table identifier.
        flowId - The flow identifier.
      • removeFlow

        public com.google.common.util.concurrent.FluentFuture<?> removeFlow​(org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                                                            org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flowEntity)
        Description copied from interface: IMdsalApiManager
        Removes a flow.
        Specified by:
        removeFlow in interface IMdsalApiManager
      • removeFlow

        public com.google.common.util.concurrent.FluentFuture<?> removeFlow​(FlowEntity flowEntity)
        Description copied from interface: IMdsalApiManager
        Removes a flow.
        Specified by:
        removeFlow in interface IMdsalApiManager
        Parameters:
        flowEntity - The flow entity.
      • removeFlow

        public void removeFlow​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                               FlowEntity flowEntity)
                        throws java.util.concurrent.ExecutionException,
                               java.lang.InterruptedException
        Description copied from interface: IMdsalApiManager
        Removes the given flow.
        Specified by:
        removeFlow in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        flowEntity - The flow entity.
        Throws:
        java.util.concurrent.ExecutionException - in case of a technical (!) error while reading
        java.lang.InterruptedException - in case of a technical (!) error while reading
      • removeFlow

        public void removeFlow​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                               org.opendaylight.yangtools.yang.common.Uint64 dpId,
                               org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow)
                        throws java.util.concurrent.ExecutionException,
                               java.lang.InterruptedException
        Description copied from interface: IMdsalApiManager
        Removes the given flow.
        Specified by:
        removeFlow in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        dpId - The DPN identifier.
        flow - The flow.
        Throws:
        java.util.concurrent.ExecutionException - in case of a technical (!) error while reading
        java.lang.InterruptedException - in case of a technical (!) error while reading
      • removeFlow

        public void removeFlow​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                               org.opendaylight.yangtools.yang.common.Uint64 dpId,
                               java.lang.String flowId,
                               short tableId)
                        throws java.util.concurrent.ExecutionException,
                               java.lang.InterruptedException
        Description copied from interface: IMdsalApiManager
        Removes the given flow.
        Specified by:
        removeFlow in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        dpId - The DPN identifier.
        flowId - The flow identifier.
        tableId - The table identifier.
        Throws:
        java.util.concurrent.ExecutionException - in case of a technical (!) error while reading
        java.lang.InterruptedException - in case of a technical (!) error while reading
      • removeFlow

        public void removeFlow​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                               org.opendaylight.yangtools.yang.common.Uint64 dpId,
                               org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey flowKey,
                               short tableId)
                        throws java.util.concurrent.ExecutionException,
                               java.lang.InterruptedException
        Description copied from interface: IMdsalApiManager
        Removes the given flow.
        Specified by:
        removeFlow in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        dpId - The DPN identifier.
        flowKey - The flow key.
        tableId - The table identifier.
        Throws:
        java.util.concurrent.ExecutionException - in case of a technical (!) error while reading
        java.lang.InterruptedException - in case of a technical (!) error while reading
      • removeGroup

        public void removeGroup​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                                GroupEntity groupEntity)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException
        Description copied from interface: IMdsalApiManager
        Remove a group using the given transaction.
        Specified by:
        removeGroup in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        groupEntity - The group to remove.
        Throws:
        java.util.concurrent.ExecutionException - in case of a technical (!) error while reading
        java.lang.InterruptedException - in case of a technical (!) error while reading
      • removeGroup

        public void removeGroup​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                                org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group group)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException
        Description copied from interface: IMdsalApiManager
        Remove a group using the given transaction.
        Specified by:
        removeGroup in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        dpId - The DPN identifier.
        group - The group to remove.
        Throws:
        java.util.concurrent.ExecutionException - in case of a technical (!) error while reading
        java.lang.InterruptedException - in case of a technical (!) error while reading
      • removeGroup

        public void removeGroup​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                                org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                long groupId)
                         throws java.util.concurrent.ExecutionException,
                                java.lang.InterruptedException
        Description copied from interface: IMdsalApiManager
        Remove a group using the given transaction.
        Specified by:
        removeGroup in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        dpId - The DPN identifier.
        groupId - The group identifier of the group to remove.
        Throws:
        java.util.concurrent.ExecutionException - in case of a technical (!) error while reading
        java.lang.InterruptedException - in case of a technical (!) error while reading
      • syncRemoveFlow

        public void syncRemoveFlow​(FlowEntity flowEntity,
                                   long delayTime)
        Description copied from interface: IMdsalApiManager
        API to remove the flow on Data Plane Node synchronously. It internally waits for Flow Change Notification to confirm flow delete request is being sent with-in delayTime.
        Specified by:
        syncRemoveFlow in interface IMdsalApiManager
        Parameters:
        flowEntity - The flow entity.
        delayTime - The delay time.
      • syncInstallFlow

        public void syncInstallFlow​(FlowEntity flowEntity,
                                    long delayTime)
        Description copied from interface: IMdsalApiManager
        Install a flow.
        Specified by:
        syncInstallFlow in interface IMdsalApiManager
        Parameters:
        flowEntity - The flow entity.
        delayTime - The delay time.
      • syncRemoveGroup

        public void syncRemoveGroup​(GroupEntity groupEntity)
        Description copied from interface: IMdsalApiManager
        API to remove the Group on Data Plane Node synchronously. It internally waits for Group Change Notification to confirm group delete request is being sent.
        Specified by:
        syncRemoveGroup in interface IMdsalApiManager
        Parameters:
        groupEntity - The group to add.
      • addFlow

        public void addFlow​(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                            FlowEntity flowEntity)
        Description copied from interface: IMdsalApiManager
        Adds the given flow.
        Specified by:
        addFlow in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        flowEntity - The flow entity.
      • addFlow

        public void addFlow​(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                            org.opendaylight.yangtools.yang.common.Uint64 dpId,
                            org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow flow)
        Description copied from interface: IMdsalApiManager
        Adds the given flow.
        Specified by:
        addFlow in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        dpId - The DPN identifier.
        flow - The flow.
      • addGroup

        public void addGroup​(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                             GroupEntity groupEntity)
        Description copied from interface: IMdsalApiManager
        Adds the given group using the given transaction.
        Specified by:
        addGroup in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        groupEntity - The group to add.
      • addGroup

        public void addGroup​(org.opendaylight.mdsal.binding.util.TypedWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                             org.opendaylight.yangtools.yang.common.Uint64 dpId,
                             org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group group)
        Description copied from interface: IMdsalApiManager
        Adds the given group using the given transaction.
        Specified by:
        addGroup in interface IMdsalApiManager
        Parameters:
        tx - The transaction to use.
        dpId - The DPN identifier.
        group - The group to add.
      • addBucket

        public void addBucket​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                              org.opendaylight.yangtools.yang.common.Uint64 dpId,
                              long groupId,
                              org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.buckets.Bucket bucket)
                       throws java.util.concurrent.ExecutionException,
                              java.lang.InterruptedException
        Specified by:
        addBucket in interface IMdsalApiManager
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • removeBucket

        public void removeBucket​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> tx,
                                 org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                 long groupId,
                                 long bucketId)
                          throws java.util.concurrent.ExecutionException,
                                 java.lang.InterruptedException
        Specified by:
        removeBucket in interface IMdsalApiManager
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • groupExists

        public boolean groupExists​(org.opendaylight.yangtools.yang.common.Uint64 dpId,
                                   long groupId)
        Description copied from interface: IMdsalApiManager
        Check if OF group exist on DPN.
        Specified by:
        groupExists in interface IMdsalApiManager
        Parameters:
        dpId - dpn id
        groupId - OF group id
        Returns:
        true if group exists and false otherwise