Class ContextChainHolderImpl
java.lang.Object
org.opendaylight.openflowplugin.impl.lifecycle.ContextChainHolderImpl
- All Implemented Interfaces:
AutoCloseable,org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListener,org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipListener<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>,,org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange> DeviceConnectedHandler,DeviceDisconnectedHandler,DeviceRemovedHandler,ContextChainHolder,ContextChainMastershipWatcher,MasterChecker
public final class ContextChainHolderImpl
extends Object
implements ContextChainHolder, MasterChecker
-
Constructor Summary
ConstructorsConstructorDescriptionContextChainHolderImpl(Executor executor, org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider singletonServiceProvider, org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService entityOwnershipService, OwnershipChangeListener ownershipChangeListener, OpenflowProviderConfig config) -
Method Summary
Modifier and TypeMethodDescription<T extends OFPManager>
voidaddManager(T manager) Managers need to be added before.voidclose()deviceConnected(ConnectionContext connectionContext) Method is used to propagate information about established connection with device.getContextChain(DeviceInfo deviceInfo) Return theContextChainfor a givenDeviceInfo.booleanCheck if any device is mastered by controller.Mastered devices.voidonDeviceDisconnected(ConnectionContext connectionContext) Method is used to propagate information about closed connection with device.voidonDeviceRemoved(DeviceInfo deviceInfo) Method is used to propagate information about device being removed from manager.voidonMasterRoleAcquired(DeviceInfo deviceInfo, ContextChainMastershipState mastershipState) Changed to MASTER role on device.voidonNotAbleToStartMastership(DeviceInfo deviceInfo, String reason, boolean mandatory) Event occurs if there was a try to acquire MASTER role.voidonSlaveRoleAcquired(DeviceInfo deviceInfo) Change to SLAVE role on device was successful.voidonSlaveRoleNotAcquired(DeviceInfo deviceInfo, String reason) Change to SLAVE role on device was not able.voidownershipChanged(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange entityOwnershipChange) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opendaylight.openflowplugin.api.openflow.lifecycle.ContextChainMastershipWatcher
onNotAbleToStartMastershipMandatory
-
Constructor Details
-
ContextChainHolderImpl
public ContextChainHolderImpl(Executor executor, org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider singletonServiceProvider, org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService entityOwnershipService, OwnershipChangeListener ownershipChangeListener, OpenflowProviderConfig config)
-
-
Method Details
-
addManager
Description copied from interface:ContextChainHolder- Specified by:
addManagerin interfaceContextChainHolder- Type Parameters:
T-OFPManager- Parameters:
manager- a child class ofOFPManager
-
deviceConnected
Description copied from interface:DeviceConnectedHandlerMethod is used to propagate information about established connection with device. It propagates connected device's connection context.- Specified by:
deviceConnectedin interfaceDeviceConnectedHandler
-
onNotAbleToStartMastership
Description copied from interface:ContextChainMastershipWatcherEvent occurs if there was a try to acquire MASTER role. But it was not possible to start this MASTER role on device.- Specified by:
onNotAbleToStartMastershipin interfaceContextChainMastershipWatcher- Parameters:
deviceInfo- connected switch identificationreason- reasonmandatory- if it is mandatory connection will be dropped
-
onMasterRoleAcquired
public void onMasterRoleAcquired(DeviceInfo deviceInfo, ContextChainMastershipState mastershipState) Description copied from interface:ContextChainMastershipWatcherChanged to MASTER role on device.- Specified by:
onMasterRoleAcquiredin interfaceContextChainMastershipWatcher- Parameters:
deviceInfo- connected switch identificationmastershipState- state
-
onSlaveRoleAcquired
Description copied from interface:ContextChainMastershipWatcherChange to SLAVE role on device was successful.- Specified by:
onSlaveRoleAcquiredin interfaceContextChainMastershipWatcher- Parameters:
deviceInfo- connected switch identification
-
onSlaveRoleNotAcquired
Description copied from interface:ContextChainMastershipWatcherChange to SLAVE role on device was not able.- Specified by:
onSlaveRoleNotAcquiredin interfaceContextChainMastershipWatcher- Parameters:
deviceInfo- connected switch identificationreason- reason
-
onDeviceDisconnected
Description copied from interface:DeviceDisconnectedHandlerMethod is used to propagate information about closed connection with device. It propagates connected device's connection context.- Specified by:
onDeviceDisconnectedin interfaceDeviceDisconnectedHandler
-
getContextChain
Description copied from interface:ContextChainHolderReturn theContextChainfor a givenDeviceInfo.- Specified by:
getContextChainin interfaceContextChainHolder- Returns:
ContextChain
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceContextChainHolder
-
ownershipChanged
public void ownershipChanged(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange entityOwnershipChange) - Specified by:
ownershipChangedin interfaceorg.opendaylight.mdsal.eos.binding.api.EntityOwnershipListener- Specified by:
ownershipChangedin interfaceorg.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipListener<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>,org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange>
-
listOfMasteredDevices
Description copied from interface:MasterCheckerMastered devices.- Specified by:
listOfMasteredDevicesin interfaceMasterChecker- Returns:
- list of mastered devices
-
isAnyDeviceMastered
public boolean isAnyDeviceMastered()Description copied from interface:MasterCheckerCheck if any device is mastered by controller.- Specified by:
isAnyDeviceMasteredin interfaceMasterChecker- Returns:
- true if there is at least one device mastered by controller
-
onDeviceRemoved
Description copied from interface:DeviceRemovedHandlerMethod is used to propagate information about device being removed from manager.- Specified by:
onDeviceRemovedin interfaceDeviceRemovedHandler
-