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
Modifier and TypeMethodDescriptionboolean
addAuxiliaryConnection
(@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.boolean
auxiliaryConnectionDropped
(@NonNull ConnectionContext connectionContext) Check if connection is auxiliary and if yes then continue working.void
close()
boolean
Checks if context chain is currently closing.boolean
isMastered
(@NonNull ContextChainMastershipState mastershipState, boolean inReconciliationFrameworkStep) Check all needed to be master.void
Slave was successfully set.void
registerDeviceRemovedHandler
(@NonNull DeviceRemovedHandler deviceRemovedHandler) This method registers device removed handler what will be executed when device should be removed.void
registerServices
(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.yangtools.concepts.Identifiable
getIdentifier
Methods inherited from interface org.opendaylight.openflowplugin.api.openflow.lifecycle.ReconciliationFrameworkStep
continueInitializationAfterReconciliation
-
Method Details
-
addContext
Add context to the chain, if reference already exist ignore it.- Parameters:
context
- child of OFPContext
-
close
void close()- Specified by:
close
in 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:
-
isClosing
boolean isClosing()Checks if context chain is currently closing.- Returns:
- true if context chain is closing
-
addAuxiliaryConnection
Add new auxiliary connection if primary is ok.- Parameters:
connectionContext
- new connection to the device.- Returns:
- false if primary connection is broken
-
auxiliaryConnectionDropped
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
This method registers device removed handler what will be executed when device should be removed.- Parameters:
deviceRemovedHandler
- device removed handler
-