public class ControlResponsePoller extends Object implements ControlledFragmentHandler
ControlledFragmentHandler.Action| Modifier and Type | Field and Description |
|---|---|
static int |
FRAGMENT_LIMIT
Limit to apply when polling response messages.
|
| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
ControlResponseCode |
code()
Get the response code of the last response.
|
long |
controlSessionId()
Control session id of the last polled message or
Aeron.NULL_VALUE if poll returned nothing. |
long |
correlationId()
Correlation id of the last polled message or
Aeron.NULL_VALUE if poll returned nothing. |
byte[] |
encodedChallenge()
Get the encoded challenge of the last challenge.
|
String |
errorMessage()
Get the error message of the last response.
|
boolean |
isPollComplete()
Has the last polling action received a complete message?
|
ControlledFragmentHandler.Action |
onFragment(DirectBuffer buffer,
int offset,
int length,
Header header)
Callback for handling fragments of data being read from a log.
|
int |
poll()
Poll for control response events.
|
long |
relevantId()
Get the relevant id returned with the response, e.g.
|
Subscription |
subscription()
Get the
Subscription used for polling responses. |
String |
toString() |
int |
version()
Version response from the server in semantic version form.
|
boolean |
wasChallenged()
Was the last polling action received a challenge message?
|
public static final int FRAGMENT_LIMIT
public ControlResponsePoller(Subscription subscription)
FRAGMENT_LIMIT.subscription - to poll for new events.public Subscription subscription()
Subscription used for polling responses.Subscription used for polling responses.public int poll()
public long controlSessionId()
Aeron.NULL_VALUE if poll returned nothing.Aeron.NULL_VALUE if poll returned nothing.public long correlationId()
Aeron.NULL_VALUE if poll returned nothing.Aeron.NULL_VALUE if poll returned nothing.public long relevantId()
public int version()
public boolean isPollComplete()
public ControlResponseCode code()
public String errorMessage()
public boolean wasChallenged()
public byte[] encodedChallenge()
public ControlledFragmentHandler.Action onFragment(DirectBuffer buffer, int offset, int length, Header header)
ControlledFragmentHandler
Within this callback reentrant calls to the Aeron client are not permitted and
will result in undefined behaviour.
onFragment in interface ControlledFragmentHandlerbuffer - containing the data.offset - at which the data begins.length - of the data in bytes.header - representing the meta data for the data.Copyright © 2014-2020 Real Logic Limited. All Rights Reserved.