Class ContextChainImpl
- java.lang.Object
-
- org.opendaylight.openflowplugin.impl.lifecycle.ContextChainImpl
-
- All Implemented Interfaces:
AutoCloseable
,org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService
,ContextChain
,DeviceInitializationContext
,ReconciliationFrameworkStep
,org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier>
public class ContextChainImpl extends Object implements ContextChain
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
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<?>
closeServiceInstance()
void
continueInitializationAfterReconciliation()
Allow to continue after reconciliation framework callback success.@NonNull org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier
getIdentifier()
void
initializeDevice()
Initializes device information after master role acquistion.void
instantiateServiceInstance()
boolean
isClosing()
Checks if context chain is currently closing.boolean
isMastered(@NonNull ContextChainMastershipState mastershipState, boolean inReconciliationFrameworkStep)
Check all needed to be master.void
makeContextChainStateSlave()
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.
-
-
-
Method Detail
-
addContext
public <T extends OFPContext> void addContext(@NonNull T context)
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.common.api.ClusterSingletonService
-
closeServiceInstance
public com.google.common.util.concurrent.ListenableFuture<?> closeServiceInstance()
- Specified by:
closeServiceInstance
in interfaceorg.opendaylight.mdsal.singleton.common.api.ClusterSingletonService
-
getIdentifier
public @NonNull org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier getIdentifier()
- Specified by:
getIdentifier
in interfaceorg.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.mdsal.singleton.common.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.common.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(@NonNull 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:
MastershipChangeService
-
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.- Specified by:
continueInitializationAfterReconciliation
in interfaceReconciliationFrameworkStep
- See Also:
MastershipChangeService
,ReconciliationFrameworkRegistrar.isReconciliationFrameworkRegistered()
-
initializeDevice
public void initializeDevice()
Description copied from interface:DeviceInitializationContext
Initializes device information after master role acquistion.- Specified by:
initializeDevice
in interfaceDeviceInitializationContext
-
addAuxiliaryConnection
public boolean addAuxiliaryConnection(@NonNull ConnectionContext connectionContext)
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
public boolean auxiliaryConnectionDropped(@NonNull ConnectionContext connectionContext)
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
public void registerDeviceRemovedHandler(@NonNull DeviceRemovedHandler deviceRemovedHandler)
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
-
-