Interface ContextChain
-
- All Superinterfaces:
AutoCloseable,org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService,DeviceInitializationContext,org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier>,ReconciliationFrameworkStep
- All Known Implementing Classes:
ContextChainImpl
public interface ContextChain extends org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService, AutoCloseable, ReconciliationFrameworkStep, DeviceInitializationContext
Chain of contexts, hold references to the contexts.- Since:
- 0.4.0 Carbon
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddAuxiliaryConnection(@NonNull ConnectionContext connectionContext)Add new auxiliary connection if primary is ok.<T extends OFPContext>
voidaddContext(@NonNull T context)Add context to the chain, if reference already exist ignore it.booleanauxiliaryConnectionDropped(@NonNull ConnectionContext connectionContext)Check if connection is auxiliary and if yes then continue working.voidclose()booleanisClosing()Checks if context chain is currently closing.booleanisMastered(@NonNull ContextChainMastershipState mastershipState, boolean inReconciliationFrameworkStep)Check all needed to be master.voidmakeContextChainStateSlave()Slave was successfully set.voidregisterDeviceRemovedHandler(@NonNull DeviceRemovedHandler deviceRemovedHandler)This method registers device removed handler what will be executed when device should be removed.voidregisterServices(org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider clusterSingletonServiceProvider)Registers context chain into cluster singleton service.-
Methods inherited from interface org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService
closeServiceInstance, instantiateServiceInstance
-
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.lifecycle.DeviceInitializationContext
initializeDevice
-
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.lifecycle.ReconciliationFrameworkStep
continueInitializationAfterReconciliation
-
-
-
-
Method Detail
-
addContext
<T extends OFPContext> void addContext(@NonNull T context)
Add context to the chain, if reference already exist ignore it.- Parameters:
context- child of OFPContext
-
close
void close()
- Specified by:
closein interfaceAutoCloseable
-
makeContextChainStateSlave
void makeContextChainStateSlave()
Slave was successfully set.
-
registerServices
void registerServices(org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider clusterSingletonServiceProvider)
Registers context chain into cluster singleton service.- Parameters:
clusterSingletonServiceProvider- provider
-
isMastered
boolean isMastered(@NonNull ContextChainMastershipState mastershipState, boolean inReconciliationFrameworkStep)
Check all needed to be master.- Parameters:
mastershipState- state master on device, initial gather, initial submit, initial registry fillinReconciliationFrameworkStep- if true, check all needed to be master except the device is written into data store. Using by reconciliation framework. Used only ifReconciliationFrameworkRegistrar.isReconciliationFrameworkRegistered()is set to true.- Returns:
- true if everything done fine
- See Also:
MastershipChangeService
-
isClosing
boolean isClosing()
Checks if context chain is currently closing.- Returns:
- true if context chain is closing
-
addAuxiliaryConnection
boolean addAuxiliaryConnection(@NonNull ConnectionContext connectionContext)
Add new auxiliary connection if primary is ok.- Parameters:
connectionContext- new connection to the device.- Returns:
- false if primary connection is broken
-
auxiliaryConnectionDropped
boolean auxiliaryConnectionDropped(@NonNull ConnectionContext connectionContext)
Check if connection is auxiliary and if yes then continue working.- Parameters:
connectionContext- connection to the device- Returns:
- false if this is primary connection
-
registerDeviceRemovedHandler
void registerDeviceRemovedHandler(@NonNull DeviceRemovedHandler deviceRemovedHandler)
This method registers device removed handler what will be executed when device should be removed.- Parameters:
deviceRemovedHandler- device removed handler
-
-