Interface SessionClient


public interface SessionClient
Partition proxy.
  • Method Details

    • name

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

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

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

      SessionId sessionId()
      Returns the proxy session identifier.
      Returns:
      The proxy session identifier
    • partitionId

      PartitionId partitionId()
      Returns the partition identifier.
      Returns:
      the partition identifier.
    • context

      io.atomix.utils.concurrent.ThreadContext context()
      Returns the partition thread context.
      Returns:
      the partition thread context
    • execute

      CompletableFuture<byte[]> execute​(PrimitiveOperation operation)
      Executes an operation to the cluster.
      Parameters:
      operation - the operation to execute
      Returns:
      a future to be completed with the operation result
      Throws:
      NullPointerException - if operation is null
    • addEventListener

      void addEventListener​(EventType eventType, java.util.function.Consumer<PrimitiveEvent> listener)
      Adds an event listener.
      Parameters:
      eventType - the event type for which to add the listener
      listener - the event listener to add
    • removeEventListener

      void removeEventListener​(EventType eventType, java.util.function.Consumer<PrimitiveEvent> listener)
      Removes an event listener.
      Parameters:
      eventType - the event type for which to remove the listener
      listener - the event listener to remove
    • 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.
      Returns:
      a future to be completed once the proxy has been connected
    • close

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

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