Class WeightedCentralizedSwitchScheduler
- java.lang.Object
-
- org.opendaylight.netvirt.natservice.ha.WeightedCentralizedSwitchScheduler
-
- All Implemented Interfaces:
CentralizedSwitchScheduler
,NatSwitchCacheListener
@Singleton public class WeightedCentralizedSwitchScheduler extends java.lang.Object implements CentralizedSwitchScheduler, NatSwitchCacheListener
-
-
Constructor Summary
Constructors Constructor Description WeightedCentralizedSwitchScheduler(org.opendaylight.mdsal.binding.api.DataBroker dataBroker, org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService interfaceManager, IVpnFootprintService vpnFootprintService, NatserviceConfig config, NatSwitchCache natSwitchCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable org.opendaylight.yangtools.yang.common.Uint64
getCentralizedSwitch(java.lang.String routerName)
Retrieves the centralized switch scheduled for the router.boolean
releaseCentralizedSwitch(Routers router)
Releases the centralized switch scheduled for the router.boolean
scheduleCentralizedSwitch(Routers router)
Schedule the centralized switch for the router.void
switchAddedToCache(SwitchInfo switchInfo)
Switch is added.void
switchRemovedFromCache(SwitchInfo switchInfo)
Switch is removed.boolean
updateCentralizedSwitch(Routers oldRouter, Routers newRouter)
Update the centralized switch scheduled for the router.
-
-
-
Constructor Detail
-
WeightedCentralizedSwitchScheduler
@Inject public WeightedCentralizedSwitchScheduler(org.opendaylight.mdsal.binding.api.DataBroker dataBroker, org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService interfaceManager, IVpnFootprintService vpnFootprintService, NatserviceConfig config, NatSwitchCache natSwitchCache)
-
-
Method Detail
-
scheduleCentralizedSwitch
public boolean scheduleCentralizedSwitch(Routers router)
Description copied from interface:CentralizedSwitchScheduler
Schedule the centralized switch for the router.- Specified by:
scheduleCentralizedSwitch
in interfaceCentralizedSwitchScheduler
- Parameters:
router
- the external router.- Returns:
- success/failure
-
updateCentralizedSwitch
public boolean updateCentralizedSwitch(Routers oldRouter, Routers newRouter)
Description copied from interface:CentralizedSwitchScheduler
Update the centralized switch scheduled for the router.- Specified by:
updateCentralizedSwitch
in interfaceCentralizedSwitchScheduler
- Parameters:
oldRouter
- the existing external router.newRouter
- the new external router.- Returns:
- success/failure
-
releaseCentralizedSwitch
public boolean releaseCentralizedSwitch(Routers router)
Description copied from interface:CentralizedSwitchScheduler
Releases the centralized switch scheduled for the router.- Specified by:
releaseCentralizedSwitch
in interfaceCentralizedSwitchScheduler
- Parameters:
router
- the external router.- Returns:
- success/failure
-
switchAddedToCache
public void switchAddedToCache(SwitchInfo switchInfo)
Description copied from interface:NatSwitchCacheListener
Switch is added.- Specified by:
switchAddedToCache
in interfaceNatSwitchCacheListener
- Parameters:
switchInfo
- the switch details.
-
switchRemovedFromCache
public void switchRemovedFromCache(SwitchInfo switchInfo)
Description copied from interface:NatSwitchCacheListener
Switch is removed.- Specified by:
switchRemovedFromCache
in interfaceNatSwitchCacheListener
- Parameters:
switchInfo
- the switch details.
-
getCentralizedSwitch
public @Nullable org.opendaylight.yangtools.yang.common.Uint64 getCentralizedSwitch(java.lang.String routerName)
Description copied from interface:CentralizedSwitchScheduler
Retrieves the centralized switch scheduled for the router.- Specified by:
getCentralizedSwitch
in interfaceCentralizedSwitchScheduler
- Parameters:
routerName
- the router name.- Returns:
- success/failure
-
-