Class AbstractSnatService
- java.lang.Object
-
- org.opendaylight.netvirt.natservice.internal.AbstractSnatService
-
- All Implemented Interfaces:
SnatServiceListener
- Direct Known Subclasses:
ConntrackBasedSnatService
public abstract class AbstractSnatService extends java.lang.Object implements SnatServiceListener
-
-
Field Summary
Fields Modifier and Type Field Description protected org.opendaylight.mdsal.binding.api.DataBrokerdataBrokerprotected IFibManagerfibManagerprotected org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdManagerServiceidManagerprotected org.opendaylight.genius.interfacemanager.interfaces.IInterfaceManagerinterfaceManagerprotected org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManagermdsalManagerprotected org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcServiceodlInterfaceRpcServiceprotected org.opendaylight.genius.infra.ManagedNewTransactionRunnertxRunner
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanaddCentralizedRouter(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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.booleanaddCentralizedRouterAllSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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.booleanaddSnat(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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.booleanaddSnatAllSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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 voidaddSnatMissEntry(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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 voidaddSnatSpecificEntriesForNaptSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 dpnId)protected abstract voidaddSnatSpecificEntriesForNonNaptSwitch()protected org.opendaylight.mdsal.binding.api.DataBrokergetDataBroker()protected java.lang.StringgetFlowRef(org.opendaylight.yangtools.yang.common.Uint64 dpnId, short tableId, org.opendaylight.yangtools.yang.common.Uint32 routerID)protected java.lang.StringgetGroupIdKey(java.lang.String routerName)booleanhandleRouterUpdate(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers origRouter, Routers updatedRouter)Handles changes to external router.booleanremoveCentralizedRouter(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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.booleanremoveCentralizedRouterAllSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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.booleanremoveSnat(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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.booleanremoveSnatAllSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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 voidremoveSnatMissEntry(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, org.opendaylight.yangtools.yang.common.Uint64 dpnId, org.opendaylight.yangtools.yang.common.Uint32 routerId, java.lang.String routerName)protected abstract voidremoveSnatSpecificEntriesForNaptSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 dpnId)protected abstract voidremoveSnatSpecificEntriesForNonNaptSwitch()
-
-
-
Field Detail
-
dataBroker
protected final org.opendaylight.mdsal.binding.api.DataBroker dataBroker
-
txRunner
protected final org.opendaylight.genius.infra.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
-
fibManager
protected final IFibManager fibManager
-
-
Method Detail
-
getDataBroker
protected org.opendaylight.mdsal.binding.api.DataBroker getDataBroker()
-
addSnatAllSwitch
public boolean addSnatAllSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)Description copied from interface:SnatServiceListenerAdds snat flows for all dpns having ports on the router subnet.- Specified by:
addSnatAllSwitchin interfaceSnatServiceListener- Parameters:
confTx- The transaction to use.routers- the router.primarySwitchId- the primaryswitchId- Returns:
- returns success/failure.
-
removeSnatAllSwitch
public boolean removeSnatAllSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId) throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionDescription copied from interface:SnatServiceListenerRemoves snat flows for all dpns having ports on the router subnet.- Specified by:
removeSnatAllSwitchin interfaceSnatServiceListener- Parameters:
confTx- The transaction to use.routers- the router.primarySwitchId- the primaryswitchId- Returns:
- returns success/failure.
- Throws:
java.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
addSnat
public boolean addSnat(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId, org.opendaylight.yangtools.yang.common.Uint64 dpnId)Description copied from interface:SnatServiceListenerAdds snat flows for the dpnId.- Specified by:
addSnatin interfaceSnatServiceListener- 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.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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.InterruptedExceptionDescription copied from interface:SnatServiceListenerRemoves snat flows for the dpnId.- Specified by:
removeSnatin interfaceSnatServiceListener- 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.ExecutionExceptionjava.lang.InterruptedException
-
addCentralizedRouterAllSwitch
public boolean addCentralizedRouterAllSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId)Description copied from interface:SnatServiceListenerAdds flows for centralized switch for all dpns having ports on the router subnet.- Specified by:
addCentralizedRouterAllSwitchin interfaceSnatServiceListener- Parameters:
confTx- The transaction to use.routers- the router.primarySwitchId- the primaryswitchId.- Returns:
- returns success/failure.
-
removeCentralizedRouterAllSwitch
public boolean removeCentralizedRouterAllSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId) throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionDescription copied from interface:SnatServiceListenerRemoves flows for centralized switch for all dpns having ports on the router subnet.- Specified by:
removeCentralizedRouterAllSwitchin interfaceSnatServiceListener- Parameters:
confTx- The transaction to use.routers- the router.primarySwitchId- the primaryswitchId.- Returns:
- returns success/failure.
- Throws:
java.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
addCentralizedRouter
public boolean addCentralizedRouter(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 primarySwitchId, org.opendaylight.yangtools.yang.common.Uint64 dpnId)Description copied from interface:SnatServiceListenerAdds flows for centralized switch for the dpnId.- Specified by:
addCentralizedRouterin interfaceSnatServiceListener- 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.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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.InterruptedExceptionDescription copied from interface:SnatServiceListenerRemoves flows for centralized switch for the dpnId.- Specified by:
removeCentralizedRouterin interfaceSnatServiceListener- 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.ExecutionExceptionjava.lang.InterruptedException
-
handleRouterUpdate
public boolean handleRouterUpdate(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers origRouter, Routers updatedRouter) throws java.util.concurrent.ExecutionException, java.lang.InterruptedExceptionDescription copied from interface:SnatServiceListenerHandles changes to external router.- Specified by:
handleRouterUpdatein interfaceSnatServiceListenerorigRouter- the Orignal router.updatedRouter- the Updated router.- Returns:
- returns success/failure.
- Throws:
java.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
addSnatSpecificEntriesForNaptSwitch
protected abstract void addSnatSpecificEntriesForNaptSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 dpnId)
-
removeSnatSpecificEntriesForNaptSwitch
protected abstract void removeSnatSpecificEntriesForNaptSwitch(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.Datastore.Configuration> confTx, Routers routers, org.opendaylight.yangtools.yang.common.Uint64 dpnId) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionExceptionjava.lang.InterruptedException
-
addSnatSpecificEntriesForNonNaptSwitch
protected abstract void addSnatSpecificEntriesForNonNaptSwitch()
-
removeSnatSpecificEntriesForNonNaptSwitch
protected abstract void removeSnatSpecificEntriesForNonNaptSwitch()
-
addSnatMissEntry
protected void addSnatMissEntry(org.opendaylight.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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.genius.infra.TypedReadWriteTransaction<org.opendaylight.genius.infra.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.ExecutionExceptionjava.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)
-
-