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>

public class ContextChainImpl extends Object implements ContextChain
  • Method Details

    • 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 interface ContextChain
      Parameters:
      context - child of OFPContext
    • instantiateServiceInstance

      public void instantiateServiceInstance()
      Specified by:
      instantiateServiceInstance in interface org.opendaylight.mdsal.singleton.api.ClusterSingletonService
    • closeServiceInstance

      public com.google.common.util.concurrent.ListenableFuture<?> closeServiceInstance()
      Specified by:
      closeServiceInstance in interface org.opendaylight.mdsal.singleton.api.ClusterSingletonService
    • getIdentifier

      public org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier getIdentifier()
      Specified by:
      getIdentifier in interface org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.mdsal.singleton.api.ServiceGroupIdentifier>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ContextChain
    • makeContextChainStateSlave

      public void makeContextChainStateSlave()
      Description copied from interface: ContextChain
      Slave was successfully set.
      Specified by:
      makeContextChainStateSlave in interface ContextChain
    • 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 interface ContextChain
      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 interface ContextChain
      Parameters:
      mastershipState - state master on device, initial gather, initial submit, initial registry fill
      inReconciliationFrameworkStep - if true, check all needed to be master except the device is written into data store. Using by reconciliation framework. Used only if ReconciliationFrameworkRegistrar.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 interface ContextChain
      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 interface ReconciliationFrameworkStep
      See Also:
    • initializeDevice

      public void initializeDevice()
      Description copied from interface: DeviceInitializationContext
      Initializes device information after master role acquistion.
      Specified by:
      initializeDevice in interface DeviceInitializationContext
    • addAuxiliaryConnection

      public boolean addAuxiliaryConnection(@NonNull ConnectionContext connectionContext)
      Description copied from interface: ContextChain
      Add new auxiliary connection if primary is ok.
      Specified by:
      addAuxiliaryConnection in interface ContextChain
      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 interface ContextChain
      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 interface ContextChain
      Parameters:
      deviceRemovedHandler - device removed handler