Package io.aeron.archive.client
Class RecordingSignalPoller
java.lang.Object
io.aeron.archive.client.RecordingSignalPoller
Encapsulate the polling and decoding of archive control protocol response and recording signal messages.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intLimit to apply when polling messages. -
Constructor Summary
ConstructorsConstructorDescriptionRecordingSignalPoller(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 asFRAGMENT_LIMIT. -
Method Summary
Modifier and TypeMethodDescriptionio.aeron.archive.codecs.ControlResponseCodecode()Get the response code of the last response.longControl session id of the last polled message orAeron.NULL_VALUEif poll returned nothing.longCorrelation id of the last polled message orAeron.NULL_VALUEif poll returned nothing.Get the error message of the last response.booleanHas the last polling action received a complete message?intpoll()Poll for control response events.longGet the recording id of the last received message.longGet the recording position of the last received message.io.aeron.archive.codecs.RecordingSignalGet the recording signal of the last received message.longGet the recording subscription id of the last received message.longGet the relevant id returned with the response, e.g.Get theSubscriptionused for polling messages.intGet the template id of the last received message.toString()intversion()Version response from the server in semantic version form.
-
Field Details
-
FRAGMENT_LIMIT
public static final int FRAGMENT_LIMITLimit to apply when polling messages.- See Also:
-
-
Constructor Details
-
RecordingSignalPoller
Create a poller for a given subscription to an archive for control response messages with a default fragment limit for polling asFRAGMENT_LIMIT.- Parameters:
controlSessionId- to listen for associated asynchronous control events, such as errors.subscription- to poll for new events.
-
-
Method Details
-
subscription
Get theSubscriptionused for polling messages.- Returns:
- the
Subscriptionused 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 orAeron.NULL_VALUEif poll returned nothing.- Returns:
- control session id of the last polled message or
Aeron.NULL_VALUEif poll returned nothing.
-
correlationId
public long correlationId()Correlation id of the last polled message orAeron.NULL_VALUEif poll returned nothing.- Returns:
- correlation id of the last polled message or
Aeron.NULL_VALUEif 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
Get the error message of the last response.- Returns:
- the error message of the last response.
-
toString
-