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
ConstructorDescriptionContextChainHolderImpl
(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.void
close()
deviceConnected
(ConnectionContext connectionContext) Method is used to propagate information about established connection with device.getContextChain
(DeviceInfo deviceInfo) Return theContextChain
for a givenDeviceInfo
.boolean
Check if any device is mastered by controller.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) 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 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:
addManager
in interfaceContextChainHolder
- Type Parameters:
T
-OFPManager
- Parameters:
manager
- a child class ofOFPManager
-
deviceConnected
Description copied from interface:DeviceConnectedHandler
Method is used to propagate information about established connection with device. It propagates connected device's connection context.- Specified by:
deviceConnected
in interfaceDeviceConnectedHandler
-
onNotAbleToStartMastership
Description copied from interface:ContextChainMastershipWatcher
Event occurs if there was a try to acquire MASTER role. But it was not possible to start this MASTER role on device.- Specified by:
onNotAbleToStartMastership
in 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:ContextChainMastershipWatcher
Changed to MASTER role on device.- Specified by:
onMasterRoleAcquired
in interfaceContextChainMastershipWatcher
- Parameters:
deviceInfo
- connected switch identificationmastershipState
- state
-
onSlaveRoleAcquired
Description copied from interface:ContextChainMastershipWatcher
Change to SLAVE role on device was successful.- Specified by:
onSlaveRoleAcquired
in interfaceContextChainMastershipWatcher
- Parameters:
deviceInfo
- connected switch identification
-
onSlaveRoleNotAcquired
Description copied from interface:ContextChainMastershipWatcher
Change to SLAVE role on device was not able.- Specified by:
onSlaveRoleNotAcquired
in interfaceContextChainMastershipWatcher
- Parameters:
deviceInfo
- connected switch identificationreason
- reason
-
onDeviceDisconnected
Description copied from interface:DeviceDisconnectedHandler
Method is used to propagate information about closed connection with device. It propagates connected device's connection context.- Specified by:
onDeviceDisconnected
in interfaceDeviceDisconnectedHandler
-
getContextChain
Description copied from interface:ContextChainHolder
Return theContextChain
for a givenDeviceInfo
.- Specified by:
getContextChain
in interfaceContextChainHolder
- Returns:
ContextChain
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceContextChainHolder
-
ownershipChanged
public void ownershipChanged(org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange entityOwnershipChange) - Specified by:
ownershipChanged
in interfaceorg.opendaylight.mdsal.eos.binding.api.EntityOwnershipListener
- Specified by:
ownershipChanged
in 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:MasterChecker
Mastered devices.- Specified by:
listOfMasteredDevices
in interfaceMasterChecker
- Returns:
- list of mastered devices
-
isAnyDeviceMastered
public boolean isAnyDeviceMastered()Description copied from interface:MasterChecker
Check if any device is mastered by controller.- Specified by:
isAnyDeviceMastered
in interfaceMasterChecker
- Returns:
- true if there is at least one device mastered by controller
-
onDeviceRemoved
Description copied from interface:DeviceRemovedHandler
Method is used to propagate information about device being removed from manager.- Specified by:
onDeviceRemoved
in interfaceDeviceRemovedHandler
-