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
Constructors Constructor Description ContextChainHolderImpl(Executor executor, org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider singletonServiceProvider, org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService entityOwnershipService, OwnershipChangeListener ownershipChangeListener, OpenflowProviderConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends OFPManager>
voidaddManager(T manager)Managers need to be added before.voidclose()ConnectionStatusdeviceConnected(ConnectionContext connectionContext)Method is used to propagate information about established connection with device.ContextChaingetContextChain(DeviceInfo deviceInfo)Return theContextChainfor a givenDeviceInfo.booleanisAnyDeviceMastered()Check if any device is mastered by controller.List<DeviceInfo>listOfMasteredDevices()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, wait
-
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.lifecycle.ContextChainMastershipWatcher
onNotAbleToStartMastershipMandatory
-
-
-
-
Constructor Detail
-
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 Detail
-
addManager
public <T extends OFPManager> void addManager(T manager)
Description copied from interface:ContextChainHolder- Specified by:
addManagerin interfaceContextChainHolder- Type Parameters:
T-OFPManager- Parameters:
manager- a child class ofOFPManager
-
deviceConnected
public ConnectionStatus deviceConnected(ConnectionContext connectionContext)
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
public void onNotAbleToStartMastership(DeviceInfo deviceInfo, String reason, boolean mandatory)
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
public void onSlaveRoleAcquired(DeviceInfo deviceInfo)
Description copied from interface:ContextChainMastershipWatcherChange to SLAVE role on device was successful.- Specified by:
onSlaveRoleAcquiredin interfaceContextChainMastershipWatcher- Parameters:
deviceInfo- connected switch identification
-
onSlaveRoleNotAcquired
public void onSlaveRoleNotAcquired(DeviceInfo deviceInfo, String reason)
Description copied from interface:ContextChainMastershipWatcherChange to SLAVE role on device was not able.- Specified by:
onSlaveRoleNotAcquiredin interfaceContextChainMastershipWatcher- Parameters:
deviceInfo- connected switch identificationreason- reason
-
onDeviceDisconnected
public void onDeviceDisconnected(ConnectionContext connectionContext)
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
public ContextChain getContextChain(DeviceInfo deviceInfo)
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
public List<DeviceInfo> 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
public void onDeviceRemoved(DeviceInfo deviceInfo)
Description copied from interface:DeviceRemovedHandlerMethod is used to propagate information about device being removed from manager.- Specified by:
onDeviceRemovedin interfaceDeviceRemovedHandler
-
-