java.lang.Object
org.opendaylight.controller.cluster.access.client.AbstractClientActorBehavior<C>
org.opendaylight.controller.cluster.access.client.ClientActorBehavior<T>
All Implemented Interfaces:
AutoCloseable, org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.controller.cluster.access.concepts.ClientIdentifier>

public abstract class ClientActorBehavior<T extends BackendInfo> extends AbstractClientActorBehavior<C> implements org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.controller.cluster.access.concepts.ClientIdentifier>
A behavior, which handles messages sent to a AbstractClientActor.
  • Constructor Details

  • Method Details

    • getIdentifier

      public final org.opendaylight.controller.cluster.access.concepts.ClientIdentifier getIdentifier()
      Specified by:
      getIdentifier in interface org.opendaylight.yangtools.concepts.Identifiable<T extends BackendInfo>
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class AbstractClientActorBehavior<ClientActorContext>
    • getConnection

      public final AbstractClientConnection<T> getConnection(Long shard)
      Get a connection to a shard.
      Parameters:
      shard - Shard cookie
      Returns:
      Connection to a shard
      Throws:
      InversibleLockException - if the shard is being reconnected
    • haltClient

      protected abstract void haltClient(@NonNull Throwable cause)
      Halt And Catch Fire. Halt processing on this client. Implementations need to ensure they initiate state flush procedures. No attempt to use this instance should be made after this method returns. Any such use may result in undefined behavior.
      Parameters:
      cause - Failure cause
    • onCommand

      protected abstract @Nullable ClientActorBehavior<T> onCommand(@NonNull Object command)
      Override this method to handle any command which is not handled by the base behavior.
      Parameters:
      command - the command to process
      Returns:
      Next behavior to use, null if this actor should shut down.
    • resolver

      protected final @NonNull BackendInfoResolver<T> resolver()
      Override this method to provide a backend resolver instance.
      Returns:
      a backend resolver instance
    • connectionUp

      @Holding("connectionsLock") protected abstract @NonNull ClientActorBehavior.ConnectionConnectCohort connectionUp(@NonNull ConnectedClientConnection<T> newConn)
      Callback invoked when a new connection has been established. Implementations are expected perform preparatory tasks before the previous connection is frozen.
      Parameters:
      newConn - New connection
      Returns:
      ConnectionConnectCohort which will be used to complete the process of bringing the connection up.