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 TypeMethodDescriptionbooleanaddAuxiliaryConnection(@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()com.google.common.util.concurrent.ListenableFuture<?>voidAllow to continue after reconciliation framework callback success.org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifiervoidInitializes device information after master role acquistion.voidbooleanChecks if context chain is currently closing.booleanisMastered(ContextChainMastershipState mastershipState, boolean inReconciliationFrameworkStep) Check all needed to be master.voidSlave 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.api.ClusterSingletonServiceProvider clusterSingletonServiceProvider) Registers context chain into cluster singleton service.
-
Method Details
-
addContext
Description copied from interface:ContextChainAdd context to the chain, if reference already exist ignore it.- Specified by:
addContextin interfaceContextChain- Parameters:
context- child of OFPContext
-
instantiateServiceInstance
public void instantiateServiceInstance()- Specified by:
instantiateServiceInstancein interfaceorg.opendaylight.mdsal.singleton.api.ClusterSingletonService
-
closeServiceInstance
public com.google.common.util.concurrent.ListenableFuture<?> closeServiceInstance()- Specified by:
closeServiceInstancein interfaceorg.opendaylight.mdsal.singleton.api.ClusterSingletonService
-
getIdentifier
public org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier getIdentifier()- Specified by:
getIdentifierin interfaceorg.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceContextChain
-
makeContextChainStateSlave
public void makeContextChainStateSlave()Description copied from interface:ContextChainSlave was successfully set.- Specified by:
makeContextChainStateSlavein interfaceContextChain
-
registerServices
public void registerServices(org.opendaylight.mdsal.singleton.api.ClusterSingletonServiceProvider clusterSingletonServiceProvider) Description copied from interface:ContextChainRegisters context chain into cluster singleton service.- Specified by:
registerServicesin interfaceContextChain- Parameters:
clusterSingletonServiceProvider- provider
-
isMastered
public boolean isMastered(ContextChainMastershipState mastershipState, boolean inReconciliationFrameworkStep) Description copied from interface:ContextChainCheck all needed to be master.- Specified by:
isMasteredin 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:ContextChainChecks if context chain is currently closing.- Specified by:
isClosingin interfaceContextChain- Returns:
- true if context chain is closing
-
continueInitializationAfterReconciliation
public void continueInitializationAfterReconciliation()Description copied from interface:ReconciliationFrameworkStepAllow to continue after reconciliation framework callback success. -
initializeDevice
public void initializeDevice()Description copied from interface:DeviceInitializationContextInitializes device information after master role acquistion.- Specified by:
initializeDevicein interfaceDeviceInitializationContext
-
addAuxiliaryConnection
Description copied from interface:ContextChainAdd new auxiliary connection if primary is ok.- Specified by:
addAuxiliaryConnectionin interfaceContextChain- Parameters:
connectionContext- new connection to the device.- Returns:
- false if primary connection is broken
-
auxiliaryConnectionDropped
Description copied from interface:ContextChainCheck if connection is auxiliary and if yes then continue working.- Specified by:
auxiliaryConnectionDroppedin interfaceContextChain- Parameters:
connectionContext- connection to the device- Returns:
- false if this is primary connection
-
registerDeviceRemovedHandler
Description copied from interface:ContextChainThis method registers device removed handler what will be executed when device should be removed.- Specified by:
registerDeviceRemovedHandlerin interfaceContextChain- Parameters:
deviceRemovedHandler- device removed handler
-