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.Uint64getCentralizedSwitch(java.lang.String routerName)Retrieves the centralized switch scheduled for the router.booleanreleaseCentralizedSwitch(Routers router)Releases the centralized switch scheduled for the router.booleanscheduleCentralizedSwitch(Routers router)Schedule the centralized switch for the router.voidswitchAddedToCache(SwitchInfo switchInfo)Switch is added.voidswitchRemovedFromCache(SwitchInfo switchInfo)Switch is removed.booleanupdateCentralizedSwitch(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:CentralizedSwitchSchedulerSchedule the centralized switch for the router.- Specified by:
scheduleCentralizedSwitchin interfaceCentralizedSwitchScheduler- Parameters:
router- the external router.- Returns:
- success/failure
-
updateCentralizedSwitch
public boolean updateCentralizedSwitch(Routers oldRouter, Routers newRouter)
Description copied from interface:CentralizedSwitchSchedulerUpdate the centralized switch scheduled for the router.- Specified by:
updateCentralizedSwitchin 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:CentralizedSwitchSchedulerReleases the centralized switch scheduled for the router.- Specified by:
releaseCentralizedSwitchin interfaceCentralizedSwitchScheduler- Parameters:
router- the external router.- Returns:
- success/failure
-
switchAddedToCache
public void switchAddedToCache(SwitchInfo switchInfo)
Description copied from interface:NatSwitchCacheListenerSwitch is added.- Specified by:
switchAddedToCachein interfaceNatSwitchCacheListener- Parameters:
switchInfo- the switch details.
-
switchRemovedFromCache
public void switchRemovedFromCache(SwitchInfo switchInfo)
Description copied from interface:NatSwitchCacheListenerSwitch is removed.- Specified by:
switchRemovedFromCachein interfaceNatSwitchCacheListener- Parameters:
switchInfo- the switch details.
-
getCentralizedSwitch
public @Nullable org.opendaylight.yangtools.yang.common.Uint64 getCentralizedSwitch(java.lang.String routerName)
Description copied from interface:CentralizedSwitchSchedulerRetrieves the centralized switch scheduled for the router.- Specified by:
getCentralizedSwitchin interfaceCentralizedSwitchScheduler- Parameters:
routerName- the router name.- Returns:
- success/failure
-
-