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 Details

    • addContext

      <T extends OFPContext> void addContext(@NonNull T context)
      Add context to the chain, if reference already exist ignore it.
      Parameters:
      context - child of OFPContext
    • close

      void close()
      Specified by:
      close in interface AutoCloseable
    • 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 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

      boolean isClosing()
      Checks if context chain is currently closing.
      Returns:
      true if context chain is closing
    • addAuxiliaryConnection

      boolean addAuxiliaryConnection(@NonNull ConnectionContext connectionContext)
      Add new auxiliary connection if primary is ok.
      Parameters:
      connectionContext - new connection to the device.
      Returns:
      false if primary connection is broken
    • auxiliaryConnectionDropped

      boolean auxiliaryConnectionDropped(@NonNull ConnectionContext connectionContext)
      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

      void registerDeviceRemovedHandler(@NonNull DeviceRemovedHandler deviceRemovedHandler)
      This method registers device removed handler what will be executed when device should be removed.
      Parameters:
      deviceRemovedHandler - device removed handler