Class AbstractSnatService

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.opendaylight.mdsal.binding.api.DataBroker dataBroker  
      protected IFibManager fibManager  
      protected org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService idManager  
      protected org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager interfaceManager  
      protected org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalManager  
      protected org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService odlInterfaceRpcService  
      protected org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean addCentralizedRouter​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId, org.opendaylight.yangtools.yang.common.Uint64 dpnId)
      Adds flows for centralized switch for the dpnId.
      boolean addCentralizedRouterAllSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)
      Adds flows for centralized switch for all dpns having ports on the router subnet.
      boolean addSnat​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId, org.opendaylight.yangtools.yang.common.Uint64 dpnId)
      Adds snat flows for the dpnId.
      boolean addSnatAllSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)
      Adds snat flows for all dpns having ports on the router subnet.
      protected void addSnatMissEntry​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, org.opendaylight.yangtools.yang.common.Uint64 dpnId, org.opendaylight.yangtools.yang.common.Uint32 routerId, java.lang.String routerName, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)  
      protected abstract void addSnatSpecificEntriesForNaptSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 dpnId)  
      protected abstract void addSnatSpecificEntriesForNonNaptSwitch()  
      protected org.opendaylight.mdsal.binding.api.DataBroker getDataBroker()  
      protected java.lang.String getFlowRef​(org.opendaylight.yangtools.yang.common.Uint64 dpnId, short tableId, org.opendaylight.yangtools.yang.common.Uint32 routerID)  
      protected java.lang.String getGroupIdKey​(java.lang.String routerName)  
      boolean handleRouterUpdate​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers origRouter, Routers updatedRouter)
      Handles changes to external router.
      boolean removeCentralizedRouter​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId, org.opendaylight.yangtools.yang.common.Uint64 dpnId)
      Removes flows for centralized switch for the dpnId.
      boolean removeCentralizedRouterAllSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)
      Removes flows for centralized switch for all dpns having ports on the router subnet.
      boolean removeSnat​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId, org.opendaylight.yangtools.yang.common.Uint64 dpnId)
      Removes snat flows for the dpnId.
      boolean removeSnatAllSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)
      Removes snat flows for all dpns having ports on the router subnet.
      protected void removeSnatMissEntry​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, org.opendaylight.yangtools.yang.common.Uint64 dpnId, org.opendaylight.yangtools.yang.common.Uint32 routerId, java.lang.String routerName)  
      protected abstract void removeSnatSpecificEntriesForNaptSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 dpnId)  
      protected abstract void removeSnatSpecificEntriesForNonNaptSwitch()  
      • Methods inherited from class java.lang.Object

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

      • dataBroker

        protected final org.opendaylight.mdsal.binding.api.DataBroker dataBroker
      • txRunner

        protected final org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner txRunner
      • mdsalManager

        protected final org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager mdsalManager
      • idManager

        protected final org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerService idManager
      • odlInterfaceRpcService

        protected final org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService odlInterfaceRpcService
      • interfaceManager

        protected final org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManager interfaceManager
    • Method Detail

      • getDataBroker

        protected org.opendaylight.mdsal.binding.api.DataBroker getDataBroker()
      • addSnatAllSwitch

        public boolean addSnatAllSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                        Routers routers,
                                        org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)
        Description copied from interface: SnatServiceListener
        Adds snat flows for all dpns having ports on the router subnet.
        Specified by:
        addSnatAllSwitch in interface SnatServiceListener
        Parameters:
        confTx - The transaction to use.
        routers - the router.
        primarySwitchId - the primaryswitchId
        Returns:
        returns success/failure.
      • removeSnatAllSwitch

        public boolean removeSnatAllSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                           Routers routers,
                                           org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)
                                    throws java.util.concurrent.ExecutionException,
                                           java.lang.InterruptedException
        Description copied from interface: SnatServiceListener
        Removes snat flows for all dpns having ports on the router subnet.
        Specified by:
        removeSnatAllSwitch in interface SnatServiceListener
        Parameters:
        confTx - The transaction to use.
        routers - the router.
        primarySwitchId - the primaryswitchId
        Returns:
        returns success/failure.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • addSnat

        public boolean addSnat​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                               Routers routers,
                               org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId,
                               org.opendaylight.yangtools.yang.common.Uint64 dpnId)
        Description copied from interface: SnatServiceListener
        Adds snat flows for the dpnId.
        Specified by:
        addSnat in interface SnatServiceListener
        Parameters:
        confTx - The transaction to use.
        routers - the router.
        primarySwitchId - the primaryswitchId.
        dpnId - the dpnId for which the flows needs to be added.
        Returns:
        returns success/failure.
      • removeSnat

        public boolean removeSnat​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                  Routers routers,
                                  org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId,
                                  org.opendaylight.yangtools.yang.common.Uint64 dpnId)
                           throws java.util.concurrent.ExecutionException,
                                  java.lang.InterruptedException
        Description copied from interface: SnatServiceListener
        Removes snat flows for the dpnId.
        Specified by:
        removeSnat in interface SnatServiceListener
        Parameters:
        confTx - The transaction to use.
        routers - the router.
        primarySwitchId - the primaryswitchId.
        dpnId - the dpnId for which the flows needs to be removed.
        Returns:
        returns success/failure.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • addCentralizedRouterAllSwitch

        public boolean addCentralizedRouterAllSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                                     Routers routers,
                                                     org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)
        Description copied from interface: SnatServiceListener
        Adds flows for centralized switch for all dpns having ports on the router subnet.
        Specified by:
        addCentralizedRouterAllSwitch in interface SnatServiceListener
        Parameters:
        confTx - The transaction to use.
        routers - the router.
        primarySwitchId - the primaryswitchId.
        Returns:
        returns success/failure.
      • removeCentralizedRouterAllSwitch

        public boolean removeCentralizedRouterAllSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                                        Routers routers,
                                                        org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)
                                                 throws java.util.concurrent.ExecutionException,
                                                        java.lang.InterruptedException
        Description copied from interface: SnatServiceListener
        Removes flows for centralized switch for all dpns having ports on the router subnet.
        Specified by:
        removeCentralizedRouterAllSwitch in interface SnatServiceListener
        Parameters:
        confTx - The transaction to use.
        routers - the router.
        primarySwitchId - the primaryswitchId.
        Returns:
        returns success/failure.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • addCentralizedRouter

        public boolean addCentralizedRouter​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                            Routers routers,
                                            org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId,
                                            org.opendaylight.yangtools.yang.common.Uint64 dpnId)
        Description copied from interface: SnatServiceListener
        Adds flows for centralized switch for the dpnId.
        Specified by:
        addCentralizedRouter in interface SnatServiceListener
        Parameters:
        confTx - The transaction to use.
        routers - the router.
        primarySwitchId - the primaryswitchId.
        dpnId - the dpnId for which the flows needs to be added.
        Returns:
        returns success/failure.
      • removeCentralizedRouter

        public boolean removeCentralizedRouter​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                               Routers routers,
                                               org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId,
                                               org.opendaylight.yangtools.yang.common.Uint64 dpnId)
                                        throws java.util.concurrent.ExecutionException,
                                               java.lang.InterruptedException
        Description copied from interface: SnatServiceListener
        Removes flows for centralized switch for the dpnId.
        Specified by:
        removeCentralizedRouter in interface SnatServiceListener
        Parameters:
        confTx - The transaction to use.
        routers - the router.
        primarySwitchId - the primaryswitchId.
        dpnId - the dpnId for which the flows needs to be removed.
        Returns:
        returns success/failure.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • handleRouterUpdate

        public boolean handleRouterUpdate​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                          Routers origRouter,
                                          Routers updatedRouter)
                                   throws java.util.concurrent.ExecutionException,
                                          java.lang.InterruptedException
        Description copied from interface: SnatServiceListener
        Handles changes to external router.
        Specified by:
        handleRouterUpdate in interface SnatServiceListener
        origRouter - the Orignal router.
        updatedRouter - the Updated router.
        Returns:
        returns success/failure.
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • addSnatSpecificEntriesForNaptSwitch

        protected abstract void addSnatSpecificEntriesForNaptSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                                                    Routers routers,
                                                                    org.opendaylight.yangtools.yang.common.Uint64 dpnId)
      • removeSnatSpecificEntriesForNaptSwitch

        protected abstract void removeSnatSpecificEntriesForNaptSwitch​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                                                       Routers routers,
                                                                       org.opendaylight.yangtools.yang.common.Uint64 dpnId)
                                                                throws java.util.concurrent.ExecutionException,
                                                                       java.lang.InterruptedException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • addSnatSpecificEntriesForNonNaptSwitch

        protected abstract void addSnatSpecificEntriesForNonNaptSwitch()
      • removeSnatSpecificEntriesForNonNaptSwitch

        protected abstract void removeSnatSpecificEntriesForNonNaptSwitch()
      • addSnatMissEntry

        protected void addSnatMissEntry​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                        org.opendaylight.yangtools.yang.common.Uint64 dpnId,
                                        org.opendaylight.yangtools.yang.common.Uint32 routerId,
                                        java.lang.String routerName,
                                        org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)
      • removeSnatMissEntry

        protected void removeSnatMissEntry​(org.opendaylight.mdsal.binding.util.TypedReadWriteTransaction<org.opendaylight.mdsal.binding.util.Datastore.Configuration> confTx,
                                           org.opendaylight.yangtools.yang.common.Uint64 dpnId,
                                           org.opendaylight.yangtools.yang.common.Uint32 routerId,
                                           java.lang.String routerName)
                                    throws java.util.concurrent.ExecutionException,
                                           java.lang.InterruptedException
        Throws:
        java.util.concurrent.ExecutionException
        java.lang.InterruptedException
      • getFlowRef

        protected java.lang.String getFlowRef​(org.opendaylight.yangtools.yang.common.Uint64 dpnId,
                                              short tableId,
                                              org.opendaylight.yangtools.yang.common.Uint32 routerID)
      • getGroupIdKey

        protected java.lang.String getGroupIdKey​(java.lang.String routerName)