Interface ClientAcknowledgementState

All Known Implementing Classes:
NoClientAcknowledgement, PendingClientAcknowledgement

public interface ClientAcknowledgementState
Runtime state for a client acknowledgement request.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    acknowledge(UUID playerId, UUID acknowledgementId)
    Handles an acknowledgement received from a client.
    void
    Marks acknowledgement as complete.
    Returns the acknowledgement configuration that created this state.
    id()
    Returns the acknowledgement id clients must echo back.
    boolean
    Returns whether all required clients have acknowledged.
    boolean
    Returns whether this state is waiting on clients.
    boolean
    Returns whether this acknowledgement has timed out.
    void
    Advances timeout tracking by one tick.
    Returns the clients that have not acknowledged yet.
  • Method Details

    • isPending

      boolean isPending()
      Returns whether this state is waiting on clients.
      Returns:
      true while acknowledgement is pending
    • id

      UUID id()
      Returns the acknowledgement id clients must echo back.
      Returns:
      the acknowledgement id
    • config

      Returns the acknowledgement configuration that created this state.
      Returns:
      the acknowledgement configuration
    • waitingFor

      Set<UUID> waitingFor()
      Returns the clients that have not acknowledged yet.
      Returns:
      the waiting player ids
    • tick

      void tick()
      Advances timeout tracking by one tick.
    • acknowledge

      void acknowledge(UUID playerId, UUID acknowledgementId)
      Handles an acknowledgement received from a client.
      Parameters:
      playerId - the acknowledging player
      acknowledgementId - the acknowledgement id sent by the client
    • isComplete

      boolean isComplete()
      Returns whether all required clients have acknowledged.
      Returns:
      true when acknowledgement is complete
    • isTimedOut

      boolean isTimedOut()
      Returns whether this acknowledgement has timed out.
      Returns:
      true when the configured timeout has elapsed
    • complete

      void complete()
      Marks acknowledgement as complete.