Class RecordingSignalPoller

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

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

    • FRAGMENT_LIMIT

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

    • RecordingSignalPoller

      public RecordingSignalPoller(long controlSessionId, 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:
      controlSessionId - to listen for associated asynchronous control events, such as errors.
      subscription - to poll for new events.
  • Method Details

    • subscription

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

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

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

      public long correlationId()
      Correlation id of the last polled message or Aeron.NULL_VALUE if poll returned nothing.
      Returns:
      correlation id of the last 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.
    • templateId

      public int templateId()
      Get the template id of the last received message.
      Returns:
      the template id of the last received message.
    • recordingId

      public long recordingId()
      Get the recording id of the last received message.
      Returns:
      the recording id of the last received message.
    • recordingSubscriptionId

      public long recordingSubscriptionId()
      Get the recording subscription id of the last received message.
      Returns:
      the recording subscription id of the last received message.
    • recordingPosition

      public long recordingPosition()
      Get the recording position of the last received message.
      Returns:
      the recording position of the last received message.
    • recordingSignal

      public io.aeron.archive.codecs.RecordingSignal recordingSignal()
      Get the recording signal of the last received message.
      Returns:
      the recording signal of the last received message.
    • 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 last response.
      Returns:
      the error message of the last response.
    • toString

      public String toString()
      Overrides:
      toString in class Object