Class ControlResponsePoller

java.lang.Object
io.aeron.archive.client.ControlResponsePoller

public final class ControlResponsePoller extends Object
Encapsulate the polling and decoding of archive control protocol response messages.
  • Field Details

    • FRAGMENT_LIMIT

      public static final int FRAGMENT_LIMIT
      Limit to apply when polling response messages.
      See Also:
  • Constructor Details

    • ControlResponsePoller

      public ControlResponsePoller(Subscription subscription)
      Create a poller for a given subscription to an archive for control response messages with a default fragment limit for polling as FRAGMENT_LIMIT.
      Parameters:
      subscription - to poll for new events.
    • ControlResponsePoller

      public ControlResponsePoller(Subscription subscription, int fragmentLimit)
      Create a poller for a given subscription to an archive for control response messages.
      Parameters:
      subscription - to poll for new events.
      fragmentLimit - to apply when polling.
  • Method Details

    • subscription

      public Subscription subscription()
      Get the Subscription used for polling responses.
      Returns:
      the Subscription used for polling responses.
    • poll

      public int poll()
      Poll for control response events.
      Returns:
      the number of fragments read during the operation. Zero if no events are available.
    • templateId

      public int templateId()
      SBE template id of polled message or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      SBE template id of polled message or Aeron.NULL_VALUE if poll returned nothing.
    • controlSessionId

      public long controlSessionId()
      Control session id of polled message or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      control session id of polled message or Aeron.NULL_VALUE if poll returned nothing.
    • correlationId

      public long correlationId()
      Correlation id of the message or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      correlation id of polled message or Aeron.NULL_VALUE if poll returned nothing.
    • relevantId

      public long relevantId()
      Get the relevant id returned with the response, e.g. replay session id.
      Returns:
      the relevant id returned with the response.
    • recordingId

      public long recordingId()
      Recording id of polled RecordingSignal or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      recording id of polled RecordingSignal or Aeron.NULL_VALUE if poll returned nothing.
    • subscriptionId

      public long subscriptionId()
      Subscription id of polled RecordingSignal or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      subscription id of polled RecordingSignal or Aeron.NULL_VALUE if poll returned nothing.
    • position

      public long position()
      Position of polled RecordingSignal or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      position of polled RecordingSignal or Aeron.NULL_VALUE if poll returned nothing.
    • recordingSignal

      public io.aeron.archive.codecs.RecordingSignal recordingSignal()
      Enum of polled RecordingSignal or null if poll returned nothing.
      Returns:
      enum of polled RecordingSignal or null if poll returned nothing.
    • version

      public int version()
      Version response from the server in semantic version form.
      Returns:
      response from the server in semantic version form.
    • isPollComplete

      public boolean isPollComplete()
      Has the last polling action received a complete message?
      Returns:
      true if the last polling action received a complete message?
    • code

      public io.aeron.archive.codecs.ControlResponseCode code()
      Get the response code of the last response.
      Returns:
      the response code of the last response.
    • errorMessage

      public String errorMessage()
      Get the error message of the response.
      Returns:
      the error message of the response.
    • wasChallenged

      public boolean wasChallenged()
      Was the last polling action received a challenge message?
      Returns:
      true if the last polling action received was a challenge message, false if not.
    • encodedChallenge

      public byte[] encodedChallenge()
      Get the encoded challenge of the last challenge.
      Returns:
      the encoded challenge of the last challenge.
    • toString

      public String toString()
      Overrides:
      toString in class Object