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 intLimit 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.ControlResponseCodecode()Get the response code of the last response.longControl session id of polled message orAeron.NULL_VALUEif poll returned nothing.longCorrelation id of the message orAeron.NULL_VALUEif poll returned nothing.byte[]Get the encoded challenge of the last challenge.Get the error message of the response.booleanHas the last polling action received a complete message?intpoll()Poll for control response events.longposition()Position of polledRecordingSignalorAeron.NULL_VALUEif poll returned nothing.longRecording id of polledRecordingSignalorAeron.NULL_VALUEif poll returned nothing.io.aeron.archive.codecs.RecordingSignalEnum of polledRecordingSignalor null if poll returned nothing.longGet the relevant id returned with the response, e.g.Get theSubscriptionused for polling responses.longSubscription id of polledRecordingSignalorAeron.NULL_VALUEif poll returned nothing.intSBE template id of polled message orAeron.NULL_VALUEif poll returned nothing.toString()intversion()Version response from the server in semantic version form.booleanWas 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 theSubscriptionused for polling responses.- Returns:
- the
Subscriptionused 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_VALUEif poll returned nothing.- Returns:
- SBE template id of polled message or
Aeron.NULL_VALUEif poll returned nothing.
-
controlSessionId
public long controlSessionId()Control session id of polled message orAeron.NULL_VALUEif poll returned nothing.- Returns:
- control session id of polled message or
Aeron.NULL_VALUEif poll returned nothing.
-
correlationId
public long correlationId()Correlation id of the message orAeron.NULL_VALUEif poll returned nothing.- Returns:
- correlation id of 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.
-
recordingId
public long recordingId()Recording id of polledRecordingSignalorAeron.NULL_VALUEif poll returned nothing.- Returns:
- recording id of polled
RecordingSignalorAeron.NULL_VALUEif poll returned nothing.
-
subscriptionId
public long subscriptionId()Subscription id of polledRecordingSignalorAeron.NULL_VALUEif poll returned nothing.- Returns:
- subscription id of polled
RecordingSignalorAeron.NULL_VALUEif poll returned nothing.
-
position
public long position()Position of polledRecordingSignalorAeron.NULL_VALUEif poll returned nothing.- Returns:
- position of polled
RecordingSignalorAeron.NULL_VALUEif poll returned nothing.
-
recordingSignal
public io.aeron.archive.codecs.RecordingSignal recordingSignal()Enum of polledRecordingSignalor null if poll returned nothing.- Returns:
- enum of polled
RecordingSignalor 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
-