Interface ProxySession<S>


public interface ProxySession<S>
Proxy session.
  • Method Details

    • name

      String name()
      Returns the primitive name.
      Returns:
      the primitive name
    • type

      Returns the client proxy type.
      Returns:
      The client proxy type.
    • partitionId

      PartitionId partitionId()
      Returns the proxy partition ID.
      Returns:
      the partition ID
    • context

      io.atomix.utils.concurrent.ThreadContext context()
      Returns the session thread context.
      Returns:
      the session thread context
    • getState

      PrimitiveState getState()
      Returns the session state.
      Returns:
      The session state.
    • register

      void register​(Object client)
      Registers a client listener.
      Parameters:
      client - the client listener to register
    • accept

      CompletableFuture<Void> accept​(java.util.function.Consumer<S> operation)
      Submits an empty operation to the given partition.
      Parameters:
      operation - the operation identifier
      Returns:
      A completable future to be completed with the operation result. The future is guaranteed to be completed after all PrimitiveOperation submission futures that preceded it.
      Throws:
      NullPointerException - if operation is null
    • apply

      <R> CompletableFuture<R> apply​(java.util.function.Function<S,​R> operation)
      Submits an empty operation to the given partition.
      Type Parameters:
      R - the operation result type
      Parameters:
      operation - the operation identifier
      Returns:
      A completable future to be completed with the operation result. The future is guaranteed to be completed after all PrimitiveOperation submission futures that preceded it.
      Throws:
      NullPointerException - if operation is null
    • addStateChangeListener

      void addStateChangeListener​(java.util.function.Consumer<PrimitiveState> listener)
      Registers a session state change listener.
      Parameters:
      listener - The callback to call when the session state changes.
    • removeStateChangeListener

      void removeStateChangeListener​(java.util.function.Consumer<PrimitiveState> listener)
      Removes a state change listener.
      Parameters:
      listener - the state change listener to remove
    • connect

      Connects the proxy session.
      Returns:
      a future to be completed once the proxy session has been connected
    • close

      Closes the proxy session.
      Returns:
      a future to be completed once the proxy session has been closed
    • delete

      Closes the proxy session and deletes the service.
      Returns:
      a future to be completed once the service has been deleted