Class ContextChainImpl
java.lang.Object
org.opendaylight.openflowplugin.impl.lifecycle.ContextChainImpl
- All Implemented Interfaces:
AutoCloseable
,org.opendaylight.mdsal.singleton.api.ClusterSingletonService
,ContextChain
,DeviceInitializationContext
,ReconciliationFrameworkStep
,org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier>
-
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()
com.google.common.util.concurrent.ListenableFuture<?>
void
Allow to continue after reconciliation framework callback success.org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier
void
Initializes device information after master role acquistion.void
boolean
Checks if context chain is currently closing.boolean
isMastered
(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.api.ClusterSingletonServiceProvider clusterSingletonServiceProvider) Registers context chain into cluster singleton service.
-
Method Details
-
addContext
Description copied from interface:ContextChain
Add context to the chain, if reference already exist ignore it.- Specified by:
addContext
in interfaceContextChain
- Parameters:
context
- child of OFPContext
-
instantiateServiceInstance
public void instantiateServiceInstance()- Specified by:
instantiateServiceInstance
in interfaceorg.opendaylight.mdsal.singleton.api.ClusterSingletonService
-
closeServiceInstance
public com.google.common.util.concurrent.ListenableFuture<?> closeServiceInstance()- Specified by:
closeServiceInstance
in interfaceorg.opendaylight.mdsal.singleton.api.ClusterSingletonService
-
getIdentifier
public org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier getIdentifier()- Specified by:
getIdentifier
in interfaceorg.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceContextChain
-
makeContextChainStateSlave
public void makeContextChainStateSlave()Description copied from interface:ContextChain
Slave was successfully set.- Specified by:
makeContextChainStateSlave
in interfaceContextChain
-
registerServices
public void registerServices(org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider clusterSingletonServiceProvider) Description copied from interface:ContextChain
Registers context chain into cluster singleton service.- Specified by:
registerServices
in interfaceContextChain
- Parameters:
clusterSingletonServiceProvider
- provider
-
isMastered
public boolean isMastered(ContextChainMastershipState mastershipState, boolean inReconciliationFrameworkStep) Description copied from interface:ContextChain
Check all needed to be master.- Specified by:
isMastered
in interfaceContextChain
- 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
public boolean isClosing()Description copied from interface:ContextChain
Checks if context chain is currently closing.- Specified by:
isClosing
in interfaceContextChain
- Returns:
- true if context chain is closing
-
continueInitializationAfterReconciliation
public void continueInitializationAfterReconciliation()Description copied from interface:ReconciliationFrameworkStep
Allow to continue after reconciliation framework callback success. -
initializeDevice
public void initializeDevice()Description copied from interface:DeviceInitializationContext
Initializes device information after master role acquistion.- Specified by:
initializeDevice
in interfaceDeviceInitializationContext
-
addAuxiliaryConnection
Description copied from interface:ContextChain
Add new auxiliary connection if primary is ok.- Specified by:
addAuxiliaryConnection
in interfaceContextChain
- Parameters:
connectionContext
- new connection to the device.- Returns:
- false if primary connection is broken
-
auxiliaryConnectionDropped
Description copied from interface:ContextChain
Check if connection is auxiliary and if yes then continue working.- Specified by:
auxiliaryConnectionDropped
in interfaceContextChain
- Parameters:
connectionContext
- connection to the device- Returns:
- false if this is primary connection
-
registerDeviceRemovedHandler
Description copied from interface:ContextChain
This method registers device removed handler what will be executed when device should be removed.- Specified by:
registerDeviceRemovedHandler
in interfaceContextChain
- Parameters:
deviceRemovedHandler
- device removed handler
-