public class ContextChainHolderImpl extends Object implements ContextChainHolder, MasterChecker
| Constructor and Description |
|---|
ContextChainHolderImpl(ExecutorService executorService,
org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider singletonServiceProvider,
org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService entityOwnershipService,
OwnershipChangeListener ownershipChangeListener) |
| Modifier and Type | Method and Description |
|---|---|
<T extends OFPManager> |
addManager(T manager)
Managers need to be added before.
|
void |
close() |
ConnectionStatus |
deviceConnected(ConnectionContext connectionContext)
Method is used to propagate information about established connection with device.
|
ContextChain |
getContextChain(DeviceInfo deviceInfo)
Return the
ContextChain for a given DeviceInfo. |
boolean |
isAnyDeviceMastered()
Check if any device is mastered by controller.
|
List<DeviceInfo> |
listOfMasteredDevices()
Mastered devices.
|
void |
onDeviceDisconnected(ConnectionContext connectionContext)
Method is used to propagate information about closed connection with device.
|
void |
onDeviceRemoved(DeviceInfo deviceInfo)
Method is used to propagate information about device being removed from manager.
|
void |
onMasterRoleAcquired(DeviceInfo deviceInfo,
ContextChainMastershipState mastershipState)
Changed to MASTER role on device.
|
void |
onNotAbleToStartMastership(DeviceInfo deviceInfo,
String reason,
boolean mandatory)
Event occurs if there was a try to acquire MASTER role.
|
void |
onSlaveRoleAcquired(DeviceInfo deviceInfo)
Change to SLAVE role on device was successful.
|
void |
onSlaveRoleNotAcquired(DeviceInfo deviceInfo,
String reason)
Change to SLAVE role on device was not able.
|
void |
ownershipChanged(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange entityOwnershipChange) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonNotAbleToStartMastershipMandatorypublic ContextChainHolderImpl(ExecutorService executorService, org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider singletonServiceProvider, org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService entityOwnershipService, OwnershipChangeListener ownershipChangeListener)
public <T extends OFPManager> void addManager(T manager)
ContextChainHolderaddManager in interface ContextChainHolderT - OFPManagermanager - a child class of OFPManagerpublic ConnectionStatus deviceConnected(ConnectionContext connectionContext) throws Exception
DeviceConnectedHandlerdeviceConnected in interface DeviceConnectedHandlerExceptionpublic void onNotAbleToStartMastership(@Nonnull DeviceInfo deviceInfo, @Nonnull String reason, boolean mandatory)
ContextChainMastershipWatcheronNotAbleToStartMastership in interface ContextChainMastershipWatcherdeviceInfo - connected switch identificationreason - reasonmandatory - if it is mandatory connection will be droppedpublic void onMasterRoleAcquired(@Nonnull DeviceInfo deviceInfo, @Nonnull ContextChainMastershipState mastershipState)
ContextChainMastershipWatcheronMasterRoleAcquired in interface ContextChainMastershipWatcherdeviceInfo - connected switch identificationmastershipState - statepublic void onSlaveRoleAcquired(DeviceInfo deviceInfo)
ContextChainMastershipWatcheronSlaveRoleAcquired in interface ContextChainMastershipWatcherdeviceInfo - connected switch identificationpublic void onSlaveRoleNotAcquired(DeviceInfo deviceInfo, String reason)
ContextChainMastershipWatcheronSlaveRoleNotAcquired in interface ContextChainMastershipWatcherdeviceInfo - connected switch identificationreason - reasonpublic void onDeviceDisconnected(ConnectionContext connectionContext)
DeviceDisconnectedHandleronDeviceDisconnected in interface DeviceDisconnectedHandlerpublic ContextChain getContextChain(DeviceInfo deviceInfo)
ContextChainHolderContextChain for a given DeviceInfo.getContextChain in interface ContextChainHolderContextChainpublic void close()
throws Exception
close in interface AutoCloseableclose in interface ContextChainHolderExceptionpublic void ownershipChanged(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange entityOwnershipChange)
ownershipChanged in interface org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListenerownershipChanged in interface org.opendaylight.mdsal.eos.common.api.GenericEntityOwnershipListener<org.opendaylight.yangtools.yang.binding.InstanceIdentifier<?>,org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange>public List<DeviceInfo> listOfMasteredDevices()
MasterCheckerlistOfMasteredDevices in interface MasterCheckerpublic boolean isAnyDeviceMastered()
MasterCheckerisAnyDeviceMastered in interface MasterCheckerpublic void onDeviceRemoved(DeviceInfo deviceInfo)
DeviceRemovedHandleronDeviceRemoved in interface DeviceRemovedHandlerCopyright © 2019 OpenDaylight. All rights reserved.