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, wait
onNotAbleToStartMastershipMandatory
public 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)
ContextChainHolder
addManager
in interface ContextChainHolder
T
- OFPManager
manager
- a child class of OFPManager
public ConnectionStatus deviceConnected(ConnectionContext connectionContext) throws Exception
DeviceConnectedHandler
deviceConnected
in interface DeviceConnectedHandler
Exception
public void onNotAbleToStartMastership(@Nonnull DeviceInfo deviceInfo, @Nonnull String reason, boolean mandatory)
ContextChainMastershipWatcher
onNotAbleToStartMastership
in interface ContextChainMastershipWatcher
deviceInfo
- connected switch identificationreason
- reasonmandatory
- if it is mandatory connection will be droppedpublic void onMasterRoleAcquired(@Nonnull DeviceInfo deviceInfo, @Nonnull ContextChainMastershipState mastershipState)
ContextChainMastershipWatcher
onMasterRoleAcquired
in interface ContextChainMastershipWatcher
deviceInfo
- connected switch identificationmastershipState
- statepublic void onSlaveRoleAcquired(DeviceInfo deviceInfo)
ContextChainMastershipWatcher
onSlaveRoleAcquired
in interface ContextChainMastershipWatcher
deviceInfo
- connected switch identificationpublic void onSlaveRoleNotAcquired(DeviceInfo deviceInfo, String reason)
ContextChainMastershipWatcher
onSlaveRoleNotAcquired
in interface ContextChainMastershipWatcher
deviceInfo
- connected switch identificationreason
- reasonpublic void onDeviceDisconnected(ConnectionContext connectionContext)
DeviceDisconnectedHandler
onDeviceDisconnected
in interface DeviceDisconnectedHandler
public ContextChain getContextChain(DeviceInfo deviceInfo)
ContextChainHolder
ContextChain
for a given DeviceInfo
.getContextChain
in interface ContextChainHolder
ContextChain
public void close() throws Exception
close
in interface AutoCloseable
close
in interface ContextChainHolder
Exception
public void ownershipChanged(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange entityOwnershipChange)
ownershipChanged
in interface org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListener
ownershipChanged
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()
MasterChecker
listOfMasteredDevices
in interface MasterChecker
public boolean isAnyDeviceMastered()
MasterChecker
isAnyDeviceMastered
in interface MasterChecker
public void onDeviceRemoved(DeviceInfo deviceInfo)
DeviceRemovedHandler
onDeviceRemoved
in interface DeviceRemovedHandler
Copyright © 2018 OpenDaylight. All rights reserved.