Class AeronArchive.Context
- All Implemented Interfaces:
Cloneable
- Enclosing class:
- AeronArchive
The context will be owned by AeronArchive after a successful
AeronArchive.connect(Context) and closed via AeronArchive.close().
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaeron()Aeronclient for communicating with the local Media Driver.Aeronclient for communicating with the local Media Driver.Get the top level Aeron directory used for communication between the Aeron client and Media Driver.aeronDirectoryName(String aeronDirectoryName) Set the top level Aeron directory used for communication between the Aeron client and Media Driver.Get theAgentInvokerto be invoked in addition to any invoker used by theaeron()instance.agentInvoker(AgentInvoker agentInvoker) Set theAgentInvokerto be invoked in addition to any invoker used by theaeron()instance.Returns the name of this client.clientName(String clientName) Sets the name used to identify this client among other clients connected to the Archive.clone()Perform a shallow copy of the object.voidclose()Close the context and free applicable resources.voidconclude()Conclude configuration by setting up defaults when specifics are not provided.intGet the MTU length for the control streams.controlMtuLength(int controlMtuLength) Set the MTU length for the control streams.Get the channel parameter for the control request channel.controlRequestChannel(String channel) Set the channel parameter for the control request channel.intGet the stream id for the control request channel.controlRequestStreamId(int streamId) Set the stream id for the control request channel.Get the channel parameter for the control response channel.controlResponseChannel(String channel) Set the channel parameter for the control response channel.intGet the stream id for the control response channel.controlResponseStreamId(int streamId) Set the stream id for the control response channel.intGet the term buffer length for the control streams.controlTermBufferLength(int controlTermBufferLength) Set the term buffer length for the control streams.booleanShould the control streams use sparse file term buffers.controlTermBufferSparse(boolean controlTermBufferSparse) Should the control streams use sparse file term buffers.Get theCredentialsSupplierto be used for authentication with the archive.credentialsSupplier(CredentialsSupplier credentialsSupplier) Set theCredentialsSupplierto be used for authentication with the archive.Get the error handler that will be called for asynchronous errors.errorHandler(ErrorHandler errorHandler) Handle errors returned asynchronously from the archive for a control session.Get theIdleStrategyused when waiting for responses.idleStrategy(IdleStrategy idleStrategy) Set theIdleStrategyused when waiting for responses.booleanHas the context had theconclude()method called.lock()Get theLockthat is used to provide mutual exclusion in theAeronArchiveclient.TheLockthat is used to provide mutual exclusion in theAeronArchiveclient.intThe number of retry attempts to be made when offering messages to the archive.messageRetryAttempts(int messageRetryAttempts) Set the number of retry attempts to be made when offering messages to the archive.longThe message timeout in nanoseconds to wait for sending or receiving a message.messageTimeoutNs(long messageTimeoutNs) Set the message timeout in nanoseconds to wait for sending or receiving a message.booleanDoes this context own theaeron()client and thus takes responsibility for closing it?ownsAeronClient(boolean ownsAeronClient) Does this context own theaeron()client and thus takes responsibility for closing it?Get the channel URI on which the recording events publication will publish.recordingEventsChannel(String recordingEventsChannel) Set the channel URI on which the recording events publication will publish.intGet the stream id on which the recording events publication will publish.recordingEventsStreamId(int recordingEventsStreamId) Set the stream id on which the recording events publication will publish.Set theRecordingSignalConsumerto will be called when polling for responses from an Archive.recordingSignalConsumer(RecordingSignalConsumer recordingSignalConsumer) Set theRecordingSignalConsumerto will be called when polling for responses from an Archive.toString()
-
Constructor Details
-
Context
public Context()
-
-
Method Details
-
clone
Perform a shallow copy of the object. -
conclude
public void conclude()Conclude configuration by setting up defaults when specifics are not provided. -
isConcluded
public boolean isConcluded()Has the context had theconclude()method called.- Returns:
- true of the
conclude()method has been called.
-
messageTimeoutNs
Set the message timeout in nanoseconds to wait for sending or receiving a message.- Parameters:
messageTimeoutNs- to wait for sending or receiving a message.- Returns:
- this for a fluent API.
- See Also:
-
messageTimeoutNs
public long messageTimeoutNs()The message timeout in nanoseconds to wait for sending or receiving a message.- Returns:
- the message timeout in nanoseconds to wait for sending or receiving a message.
- See Also:
-
messageRetryAttempts
Set the number of retry attempts to be made when offering messages to the archive.- Parameters:
messageRetryAttempts- the number of retry attempts.- Returns:
- this for a fluent API.
- See Also:
-
messageRetryAttempts
public int messageRetryAttempts()The number of retry attempts to be made when offering messages to the archive.- Returns:
- the number of retry attempts.
- See Also:
-
recordingEventsChannel
Get the channel URI on which the recording events publication will publish.- Returns:
- the channel URI on which the recording events publication will publish.
-
recordingEventsChannel
Set the channel URI on which the recording events publication will publish.To support dynamic subscribers then this can be set to multicast or MDC (Multi-Destination-Cast) if multicast cannot be supported for on the available the network infrastructure.
- Parameters:
recordingEventsChannel- channel URI on which the recording events publication will publish.- Returns:
- this for a fluent API.
- See Also:
-
recordingEventsStreamId
public int recordingEventsStreamId()Get the stream id on which the recording events publication will publish.- Returns:
- the stream id on which the recording events publication will publish.
-
recordingEventsStreamId
Set the stream id on which the recording events publication will publish.- Parameters:
recordingEventsStreamId- stream id on which the recording events publication will publish.- Returns:
- this for a fluent API.
-
controlRequestChannel
Set the channel parameter for the control request channel.- Parameters:
channel- parameter for the control request channel.- Returns:
- this for a fluent API.
- See Also:
-
controlRequestChannel
Get the channel parameter for the control request channel.- Returns:
- the channel parameter for the control request channel.
- See Also:
-
controlRequestStreamId
Set the stream id for the control request channel.- Parameters:
streamId- for the control request channel.- Returns:
- this for a fluent API
- See Also:
-
controlRequestStreamId
public int controlRequestStreamId()Get the stream id for the control request channel.- Returns:
- the stream id for the control request channel.
- See Also:
-
controlResponseChannel
Set the channel parameter for the control response channel.- Parameters:
channel- parameter for the control response channel.- Returns:
- this for a fluent API.
- See Also:
-
controlResponseChannel
Get the channel parameter for the control response channel.- Returns:
- the channel parameter for the control response channel.
- See Also:
-
controlResponseStreamId
Set the stream id for the control response channel.- Parameters:
streamId- for the control response channel.- Returns:
- this for a fluent API
- See Also:
-
controlResponseStreamId
public int controlResponseStreamId()Get the stream id for the control response channel.- Returns:
- the stream id for the control response channel.
- See Also:
-
controlTermBufferSparse
Should the control streams use sparse file term buffers.- Parameters:
controlTermBufferSparse- for the control stream.- Returns:
- this for a fluent API.
- See Also:
-
controlTermBufferSparse
public boolean controlTermBufferSparse()Should the control streams use sparse file term buffers.- Returns:
trueif the control stream should use sparse file term buffers.- See Also:
-
controlTermBufferLength
Set the term buffer length for the control streams.- Parameters:
controlTermBufferLength- for the control streams.- Returns:
- this for a fluent API.
- See Also:
-
controlTermBufferLength
public int controlTermBufferLength()Get the term buffer length for the control streams.- Returns:
- the term buffer length for the control streams.
- See Also:
-
controlMtuLength
Set the MTU length for the control streams.- Parameters:
controlMtuLength- for the control streams.- Returns:
- this for a fluent API.
- See Also:
-
controlMtuLength
public int controlMtuLength()Get the MTU length for the control streams.- Returns:
- the MTU length for the control streams.
- See Also:
-
idleStrategy
Set theIdleStrategyused when waiting for responses.- Parameters:
idleStrategy- used when waiting for responses.- Returns:
- this for a fluent API.
-
idleStrategy
Get theIdleStrategyused when waiting for responses.- Returns:
- the
IdleStrategyused when waiting for responses.
-
aeronDirectoryName
Set the top level Aeron directory used for communication between the Aeron client and Media Driver.- Parameters:
aeronDirectoryName- the top level Aeron directory.- Returns:
- this for a fluent API.
-
aeronDirectoryName
Get the top level Aeron directory used for communication between the Aeron client and Media Driver.- Returns:
- The top level Aeron directory.
-
clientName
Sets the name used to identify this client among other clients connected to the Archive.- Parameters:
clientName- to use.- Returns:
- this for a fluent API.
- Since:
- 1.49.0
- See Also:
-
clientName
Returns the name of this client.- Returns:
- name of this client or empty String if not configured.
- Since:
- 1.49.0
- See Also:
-
aeron
Aeronclient for communicating with the local Media Driver.This client will be closed when the
AeronArchive.close()orclose()methods are called ifownsAeronClient()is true.- Parameters:
aeron- client for communicating with the local Media Driver.- Returns:
- this for a fluent API.
- See Also:
-
aeron
Aeronclient for communicating with the local Media Driver.If not provided then a default will be established during
conclude()by callingAeron.connect().- Returns:
- client for communicating with the local Media Driver.
-
ownsAeronClient
Does this context own theaeron()client and thus takes responsibility for closing it?- Parameters:
ownsAeronClient- does this context own theaeron()client?- Returns:
- this for a fluent API.
-
ownsAeronClient
public boolean ownsAeronClient()Does this context own theaeron()client and thus takes responsibility for closing it?- Returns:
- does this context own the
aeron()client and thus takes responsibility for closing it?
-
lock
TheLockthat is used to provide mutual exclusion in theAeronArchiveclient.If the
AeronArchiveis used from only a single thread then the lock can be set toNoOpLockto elide the lock overhead.- Parameters:
lock- that is used to provide mutual exclusion in theAeronArchiveclient.- Returns:
- this for a fluent API.
-
lock
Get theLockthat is used to provide mutual exclusion in theAeronArchiveclient.- Returns:
- the
Lockthat is used to provide mutual exclusion in theAeronArchiveclient.
-
errorHandler
Handle errors returned asynchronously from the archive for a control session.- Parameters:
errorHandler- method to handle objects of type Throwable.- Returns:
- this for a fluent API.
-
errorHandler
Get the error handler that will be called for asynchronous errors.- Returns:
- the error handler that will be called for asynchronous errors.
-
credentialsSupplier
Set theCredentialsSupplierto be used for authentication with the archive.- Parameters:
credentialsSupplier- to be used for authentication with the archive.- Returns:
- this for fluent API.
-
credentialsSupplier
Get theCredentialsSupplierto be used for authentication with the archive.- Returns:
- the
CredentialsSupplierto be used for authentication with the archive.
-
recordingSignalConsumer
public AeronArchive.Context recordingSignalConsumer(RecordingSignalConsumer recordingSignalConsumer) Set theRecordingSignalConsumerto will be called when polling for responses from an Archive.- Parameters:
recordingSignalConsumer- to called with recording signal events.- Returns:
- this for a fluent API.
-
recordingSignalConsumer
Set theRecordingSignalConsumerto will be called when polling for responses from an Archive.- Returns:
- a recording signal consumer.
-
agentInvoker
Set theAgentInvokerto be invoked in addition to any invoker used by theaeron()instance.Useful for when running on a low thread count scenario.
Note: it is the responsibility of the user to invoke
agentInvokerand theaeron.conductorAgentInvoker()periodically outside of this class.AeronArchivewill invoke those when doing blocking operations (e.g.AeronArchive.getMaxRecordedPosition(long))- Parameters:
agentInvoker- to be invoked while awaiting a response in the client.- Returns:
- this for a fluent API.
-
agentInvoker
Get theAgentInvokerto be invoked in addition to any invoker used by theaeron()instance.- Returns:
- the
AgentInvokerthat is used.
-
close
public void close()Close the context and free applicable resources.If
ownsAeronClient()is true then theaeron()client will be closed. -
toString
-