Package io.aeron.archive.client
Class ControlResponsePoller
java.lang.Object
io.aeron.archive.client.ControlResponsePoller
Encapsulate the polling and decoding of archive control protocol response messages.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Limit to apply when polling response messages. -
Constructor Summary
ConstructorsConstructorDescriptionControlResponsePoller
(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
.ControlResponsePoller
(Subscription subscription, int fragmentLimit) Create a poller for a given subscription to an archive for control response messages. -
Method Summary
Modifier and TypeMethodDescriptionio.aeron.archive.codecs.ControlResponseCode
code()
Get the response code of the last response.long
Control session id of polled message orAeron.NULL_VALUE
if poll returned nothing.long
Correlation id of the message orAeron.NULL_VALUE
if poll returned nothing.byte[]
Get the encoded challenge of the last challenge.Get the error message of the response.boolean
Has the last polling action received a complete message?int
poll()
Poll for control response events.long
position()
Position of polledRecordingSignal
orAeron.NULL_VALUE
if poll returned nothing.long
Recording id of polledRecordingSignal
orAeron.NULL_VALUE
if poll returned nothing.io.aeron.archive.codecs.RecordingSignal
Enum of polledRecordingSignal
or null if poll returned nothing.long
Get the relevant id returned with the response, e.g.Get theSubscription
used for polling responses.long
Subscription id of polledRecordingSignal
orAeron.NULL_VALUE
if poll returned nothing.int
SBE template id of polled message orAeron.NULL_VALUE
if poll returned nothing.toString()
int
version()
Version response from the server in semantic version form.boolean
Was the last polling action received a challenge message?
-
Field Details
-
FRAGMENT_LIMIT
public static final int FRAGMENT_LIMITLimit to apply when polling response messages.- See Also:
-
-
Constructor Details
-
ControlResponsePoller
Create a poller for a given subscription to an archive for control response messages with a default fragment limit for polling asFRAGMENT_LIMIT
.- Parameters:
subscription
- to poll for new events.
-
ControlResponsePoller
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
Get theSubscription
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 orAeron.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 orAeron.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 orAeron.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 polledRecordingSignal
orAeron.NULL_VALUE
if poll returned nothing.- Returns:
- recording id of polled
RecordingSignal
orAeron.NULL_VALUE
if poll returned nothing.
-
subscriptionId
public long subscriptionId()Subscription id of polledRecordingSignal
orAeron.NULL_VALUE
if poll returned nothing.- Returns:
- subscription id of polled
RecordingSignal
orAeron.NULL_VALUE
if poll returned nothing.
-
position
public long position()Position of polledRecordingSignal
orAeron.NULL_VALUE
if poll returned nothing.- Returns:
- position of polled
RecordingSignal
orAeron.NULL_VALUE
if poll returned nothing.
-
recordingSignal
public io.aeron.archive.codecs.RecordingSignal recordingSignal()Enum of polledRecordingSignal
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
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
-