Class Archive.Context

java.lang.Object
io.aeron.archive.Archive.Context
All Implemented Interfaces:
Cloneable
Enclosing class:
Archive

public static final class Archive.Context extends Object implements Cloneable
Overrides for the defaults and system properties.

The context will be owned by ArchiveConductor after a successful Archive.launch(Context) and closed via Archive.close().

  • Constructor Details

    • Context

      public Context()
  • Method Details

    • clone

      public Archive.Context clone()
      Perform a shallow copy of the object.
      Overrides:
      clone in class Object
      Returns:
      a shallow copy of the object.
    • conclude

      public void conclude()
      Conclude the configuration parameters by resolving dependencies and null values to use defaults.
    • isConcluded

      public boolean isConcluded()
      Has the context had the conclude() method called.
      Returns:
      true of the conclude() method has been called.
    • deleteArchiveOnStart

      public Archive.Context deleteArchiveOnStart(boolean deleteArchiveOnStart)
      Should an existing archive be deleted on start. Useful only for testing.
      Parameters:
      deleteArchiveOnStart - true if an existing archive should be deleted on startup.
      Returns:
      this for a fluent API.
    • deleteArchiveOnStart

      public boolean deleteArchiveOnStart()
      Should an existing archive be deleted on start. Useful only for testing.
      Returns:
      true if an existing archive should be deleted on start up.
    • archiveDirectoryName

      public Archive.Context archiveDirectoryName(String archiveDirectoryName)
      Set the directory name to be used for the archive to store recordings and the Catalog. This name is used if archiveDir(File) is not set.
      Parameters:
      archiveDirectoryName - to store recordings and the Catalog.
      Returns:
      this for a fluent API.
      See Also:
    • archiveDirectoryName

      public String archiveDirectoryName()
      Get the directory name to be used to store recordings and the Catalog.
      Returns:
      the directory name to be used for the archive to store recordings and the Catalog.
    • archiveDir

      public File archiveDir()
      Get the directory in which the Archive will store recordings and the Catalog.
      Returns:
      the directory in which the Archive will store recordings and the Catalog.
    • archiveDir

      public Archive.Context archiveDir(File archiveDir)
      Set the directory in which the Archive will store recordings and the Catalog.
      Parameters:
      archiveDir - the directory in which the Archive will store recordings and the Catalog.
      Returns:
      this for a fluent API.
    • markFileDir

      public File markFileDir()
      Get the directory in which the Archive will store mark file (i.e. archive-mark.dat). It defaults to archiveDir() if it is not set explicitly via the Archive.Configuration.MARK_FILE_DIR_PROP_NAME.
      Returns:
      the directory in which the Archive will store mark file (i.e. archive-mark.dat).
      See Also:
    • markFileDir

      public Archive.Context markFileDir(File markFileDir)
      Set the directory in which the Archive will store mark file (i.e. archive-mark.dat).
      Parameters:
      markFileDir - the directory in which the Archive will store mark file (i.e. archive-mark.dat).
      Returns:
      this for a fluent API.
    • archiveFileStore

      public FileStore archiveFileStore()
      Get the FileStore where the archive will record streams.
      Returns:
      the FileStore where the archive will record streams.
    • archiveFileStore

      public Archive.Context archiveFileStore(FileStore fileStore)
      Set the FileStore where the archive will record streams. This should only be used for testing.
      Parameters:
      fileStore - where the archive will record streams.
      Returns:
      this for a fluent API.
    • archiveDirChannel

      public FileChannel archiveDirChannel()
      Get the FileChannel for the directory in which the Archive will store recordings and the Catalog. This can be used for sync'ing the directory.
      Returns:
      the directory in which the Archive will store recordings and the Catalog.
    • archiveClientContext

      public Archive.Context archiveClientContext(AeronArchive.Context archiveContext)
      Set the AeronArchive.Context that should be used for communicating with a remote archive for replication.
      Parameters:
      archiveContext - that should be used for communicating with a remote Archive.
      Returns:
      this for a fluent API.
    • archiveClientContext

      public AeronArchive.Context archiveClientContext()
      Get the AeronArchive.Context that should be used for communicating with a remote archive for replication.
      Returns:
      the AeronArchive.Context that should be used for communicating with a remote archive for replication.
    • controlChannelEnabled

      public boolean controlChannelEnabled()
      Should the UDP control channel be enabled.
      Returns:
      true if the UDP control channel should be enabled.
      See Also:
    • controlChannelEnabled

      public Archive.Context controlChannelEnabled(boolean controlChannelEnabled)
      Set if the UDP control channel should be enabled.
      Parameters:
      controlChannelEnabled - indication of if the network control channel should be enabled.
      Returns:
      this for a fluent API.
      See Also:
    • controlChannel

      public String controlChannel()
      Get the channel URI on which the control request subscription will listen.
      Returns:
      the channel URI on which the control request subscription will listen.
      See Also:
    • controlChannel

      public Archive.Context controlChannel(String controlChannel)
      Set the channel URI on which the control request subscription will listen.
      Parameters:
      controlChannel - channel URI on which the control request subscription will listen.
      Returns:
      this for a fluent API.
      See Also:
    • controlStreamId

      public int controlStreamId()
      Get the stream id on which the control request subscription will listen.
      Returns:
      the stream id on which the control request subscription will listen.
      See Also:
    • controlStreamId

      public Archive.Context controlStreamId(int controlStreamId)
      Set the stream id on which the control request subscription will listen.
      Parameters:
      controlStreamId - stream id on which the control request subscription will listen.
      Returns:
      this for a fluent API.
      See Also:
    • localControlChannel

      public String localControlChannel()
      Get the driver local channel URI on which the control request subscription will listen.
      Returns:
      the channel URI on which the control request subscription will listen.
      See Also:
    • localControlChannel

      public Archive.Context localControlChannel(String controlChannel)
      Set the driver local channel URI on which the control request subscription will listen.
      Parameters:
      controlChannel - channel URI on which the control request subscription will listen.
      Returns:
      this for a fluent API.
      See Also:
    • localControlStreamId

      public int localControlStreamId()
      Get the local stream id on which the control request subscription will listen.
      Returns:
      the stream id on which the control request subscription will listen.
      See Also:
    • controlTermBufferSparse

      public Archive.Context controlTermBufferSparse(boolean 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:
      true if the control stream should use sparse file term buffers.
      See Also:
    • controlTermBufferLength

      public Archive.Context controlTermBufferLength(int 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

      public Archive.Context controlMtuLength(int 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:
    • localControlStreamId

      public Archive.Context localControlStreamId(int controlStreamId)
      Set the local stream id on which the control request subscription will listen.
      Parameters:
      controlStreamId - stream id on which the control request subscription will listen.
      Returns:
      this for a fluent API.
      See Also:
    • recordingEventsChannel

      public String recordingEventsChannel()
      Get the channel URI on which the recording events publication will publish. Will be null if not configured.
      Returns:
      the channel URI on which the recording events publication will publish.
      See Also:
    • recordingEventsChannel

      public Archive.Context recordingEventsChannel(String 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.
      See Also:
    • recordingEventsStreamId

      public Archive.Context recordingEventsStreamId(int 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.
      See Also:
    • recordingEventsEnabled

      public boolean recordingEventsEnabled()
      Should the recording events channel be enabled.
      Returns:
      true if the recording events channel should be enabled.
      See Also:
    • recordingEventsEnabled

      public Archive.Context recordingEventsEnabled(boolean recordingEventsEnabled)
      Set if the recording events channel should be enabled.
      Parameters:
      recordingEventsEnabled - indication of if the recording events channel should be enabled.
      Returns:
      this for a fluent API.
      See Also:
    • replicationChannel

      public String replicationChannel()
      Get the channel URI for replicating stream from another archive as replays.
      Returns:
      the channel URI for replicating stream from another archive as replays.
      See Also:
    • replicationChannel

      public Archive.Context replicationChannel(String replicationChannel)
      The channel URI for replicating stream from another archive as replays.
      Parameters:
      replicationChannel - channel URI for replicating stream from another archive as replays.
      Returns:
      this for a fluent API.
      See Also:
    • connectTimeoutNs

      public Archive.Context connectTimeoutNs(long connectTimeoutNs)
      The timeout in nanoseconds to wait for connection to be established.
      Parameters:
      connectTimeoutNs - to wait for a connection to be established.
      Returns:
      this for a fluent API.
      See Also:
    • connectTimeoutNs

      public long connectTimeoutNs()
      The timeout in nanoseconds to wait for connection to be established.
      Returns:
      the message timeout in nanoseconds to wait for a connection to be established.
      See Also:
    • sessionLivenessCheckIntervalNs

      public Archive.Context sessionLivenessCheckIntervalNs(long sessionLivenessCheckIntervalNs)
      The time internal in nanoseconds at which session liveness checks are performed.
      Parameters:
      sessionLivenessCheckIntervalNs - of a liveness check.
      Returns:
      this for a fluent API.
      Since:
      1.47.0
      See Also:
    • sessionLivenessCheckIntervalNs

      public long sessionLivenessCheckIntervalNs()
      The time internal in nanoseconds at which session liveness checks are performed.
      Returns:
      the time internal in nanoseconds at which session liveness checks are performed.
      Since:
      1.47.0
      See Also:
    • replayLingerTimeoutNs

      public Archive.Context replayLingerTimeoutNs(long replayLingerTimeoutNs)
      The timeout in nanoseconds for or a replay publication to linger after draining.
      Parameters:
      replayLingerTimeoutNs - in nanoseconds for a replay publication to linger after draining.
      Returns:
      this for a fluent API.
      See Also:
    • replayLingerTimeoutNs

      public long replayLingerTimeoutNs()
      The timeout in nanoseconds for a replay publication to linger after draining.
      Returns:
      the timeout in nanoseconds for a replay publication to linger after draining.
      See Also:
    • conductorCycleThresholdNs

      public Archive.Context conductorCycleThresholdNs(long thresholdNs)
      Set a threshold for the conductor work cycle time which when exceed it will increment the conductor cycle time exceeded count.
      Parameters:
      thresholdNs - value in nanoseconds
      Returns:
      this for fluent API.
      See Also:
    • conductorCycleThresholdNs

      public long conductorCycleThresholdNs()
      Threshold for the conductor work cycle time which when exceed it will increment the conductor cycle time exceeded count.
      Returns:
      threshold to track for the conductor work cycle time.
    • recorderCycleThresholdNs

      public Archive.Context recorderCycleThresholdNs(long thresholdNs)
      Set a threshold for the recorder work cycle time which when exceed it will increment the recorder cycle time exceeded count.
      Parameters:
      thresholdNs - value in nanoseconds
      Returns:
      this for fluent API.
      See Also:
    • recorderCycleThresholdNs

      public long recorderCycleThresholdNs()
      Threshold for the recorder work cycle time which when exceed it will increment the recorder cycle time exceeded count.
      Returns:
      threshold to track for the recorder work cycle time.
    • replayerCycleThresholdNs

      public Archive.Context replayerCycleThresholdNs(long thresholdNs)
      Set a threshold for the replayer work cycle time which when exceed it will increment the replayer cycle time exceeded count.
      Parameters:
      thresholdNs - value in nanoseconds
      Returns:
      this for fluent API.
      See Also:
    • replayerCycleThresholdNs

      public long replayerCycleThresholdNs()
      Threshold for the replayer work cycle time which when exceed it will increment the replayer cycle time exceeded count.
      Returns:
      threshold to track for the replayer work cycle time.
    • conductorDutyCycleTracker

      public Archive.Context conductorDutyCycleTracker(DutyCycleTracker dutyCycleTracker)
      Set the duty cycle tracker for the conductor.
      Parameters:
      dutyCycleTracker - for the conductor.
      Returns:
      this for a fluent API.
    • conductorDutyCycleTracker

      public DutyCycleTracker conductorDutyCycleTracker()
      The duty cycle tracker for the conductor.
      Returns:
      duty cycle tracker for the conductor.
    • recorderDutyCycleTracker

      public Archive.Context recorderDutyCycleTracker(DutyCycleTracker dutyCycleTracker)
      Set the duty cycle tracker for the recorder. NOTE: Only used in DEDICATED threading mode.
      Parameters:
      dutyCycleTracker - for the recorder.
      Returns:
      this for a fluent API.
    • recorderDutyCycleTracker

      public DutyCycleTracker recorderDutyCycleTracker()
      The duty cycle tracker for the recorder. NOTE: Only used in DEDICATED threading mode.
      Returns:
      duty cycle tracker for the recorder.
    • replayerDutyCycleTracker

      public Archive.Context replayerDutyCycleTracker(DutyCycleTracker dutyCycleTracker)
      Set the duty cycle tracker for the replayer. NOTE: Only used in DEDICATED threading mode.
      Parameters:
      dutyCycleTracker - for the replayer.
      Returns:
      this for a fluent API.
    • replayerDutyCycleTracker

      public DutyCycleTracker replayerDutyCycleTracker()
      The duty cycle tracker for the replayer. NOTE: Only used in DEDICATED threading mode.
      Returns:
      duty cycle tracker for the replayer.
    • recordChecksum

      public Archive.Context recordChecksum(Checksum recordChecksum)
      Provides an explicit Checksum for checksum computation during recording.
      Parameters:
      recordChecksum - to be used for recordings.
      Returns:
      this for a fluent API.
      See Also:
    • recordChecksum

      public Checksum recordChecksum()
      Get the Checksum for checksum computation during recording.
      Returns:
      the Checksum instance for checksum computation during recording or null if no Checksum was configured.
      See Also:
    • replayChecksum

      public Archive.Context replayChecksum(Checksum replayChecksum)
      The Checksum for checksum computation during replay.
      Parameters:
      replayChecksum - to be used for replays.
      Returns:
      this for a fluent API.
      See Also:
    • replayChecksum

      public Checksum replayChecksum()
      Get the Checksum for checksum computation during replay.
      Returns:
      the Checksum instance for checksum computation during replay or null if no replay Checksum was configured.
      See Also:
    • idleStrategySupplier

      public Archive.Context idleStrategySupplier(Supplier<IdleStrategy> idleStrategySupplier)
      Provides an IdleStrategy supplier for idling the conductor or composite Agent. Which is also the default for recorder and replayer Agents.
      Parameters:
      idleStrategySupplier - supplier for idling the conductor.
      Returns:
      this for a fluent API.
    • idleStrategy

      public IdleStrategy idleStrategy()
      Get a new IdleStrategy for idling the conductor or composite Agent. Which is also the default for recorder and replayer Agents.
      Returns:
      a new IdleStrategy for idling the conductor or composite Agent.
    • recorderIdleStrategySupplier

      public Archive.Context recorderIdleStrategySupplier(Supplier<IdleStrategy> idleStrategySupplier)
      Provides an IdleStrategy supplier for idling the recorder Agent.
      Parameters:
      idleStrategySupplier - supplier for idling the conductor.
      Returns:
      this for a fluent API.
    • recorderIdleStrategy

      public IdleStrategy recorderIdleStrategy()
      Get a new IdleStrategy for idling the recorder Agent.
      Returns:
      a new IdleStrategy for idling the recorder Agent.
    • replayerIdleStrategySupplier

      public Archive.Context replayerIdleStrategySupplier(Supplier<IdleStrategy> idleStrategySupplier)
      Provides an IdleStrategy supplier for idling the replayer Agent.
      Parameters:
      idleStrategySupplier - supplier for idling the replayer.
      Returns:
      this for a fluent API.
    • replayerIdleStrategy

      public IdleStrategy replayerIdleStrategy()
      Get a new IdleStrategy for idling the replayer Agent.
      Returns:
      a new IdleStrategy for idling the replayer Agent.
    • epochClock

      public Archive.Context epochClock(EpochClock clock)
      Set the EpochClock to be used for tracking wall clock time.
      Parameters:
      clock - EpochClock to be used for tracking wall clock time.
      Returns:
      this for a fluent API.
    • epochClock

      public EpochClock epochClock()
      Get the EpochClock to used for tracking wall clock time.
      Returns:
      the EpochClock to used for tracking wall clock time.
    • nanoClock

      public Archive.Context nanoClock(NanoClock clock)
      Set the NanoClock to be used for tracking wall clock time.
      Parameters:
      clock - NanoClock to be used for tracking wall clock time.
      Returns:
      this for a fluent API.
    • nanoClock

      public NanoClock nanoClock()
      Get the NanoClock to used for tracking wall clock time.
      Returns:
      the NanoClock to used for tracking wall clock time.
    • segmentFileLength

      public int segmentFileLength()
      Get the file length used for recording data segment files.
      Returns:
      the file length used for recording data segment files
      See Also:
    • segmentFileLength

      public Archive.Context segmentFileLength(int segmentFileLength)
      Set the file length to be used for recording data segment files. If the Image.termBufferLength() is larger than the segment file length then the term length will be used.
      Parameters:
      segmentFileLength - the file length to be used for recording data segment files.
      Returns:
      this for a fluent API.
      See Also:
    • fileSyncLevel

      public int fileSyncLevel()
      Get level at which files should be sync'ed to disk.
      • 0 - normal writes.
      • 1 - sync file data.
      • 2 - sync file data + metadata.
      Returns:
      the level to be applied for file write.
      See Also:
    • fileSyncLevel

      public Archive.Context fileSyncLevel(int syncLevel)
      Set level at which files should be sync'ed to disk.
      • 0 - normal writes.
      • 1 - sync file data.
      • 2 - sync file data + metadata.
      Parameters:
      syncLevel - to be applied for file writes.
      Returns:
      this for a fluent API.
      See Also:
    • catalogFileSyncLevel

      public int catalogFileSyncLevel()
      Get level at which the catalog file should be sync'ed to disk.
      • 0 - normal writes.
      • 1 - sync file data.
      • 2 - sync file data + metadata.
      Returns:
      the level to be applied for file write.
      See Also:
    • catalogFileSyncLevel

      public Archive.Context catalogFileSyncLevel(int syncLevel)
      Set level at which the catalog file should be sync'ed to disk.
      • 0 - normal writes.
      • 1 - sync file data.
      • 2 - sync file data + metadata.
      Parameters:
      syncLevel - to be applied for file writes.
      Returns:
      this for a fluent API.
      See Also:
    • mediaDriverAgentInvoker

      public AgentInvoker mediaDriverAgentInvoker()
      Get the AgentInvoker that should be used for the Media Driver if running in a lightweight mode.
      Returns:
      the AgentInvoker that should be used for the Media Driver if running in a lightweight mode.
    • mediaDriverAgentInvoker

      public Archive.Context mediaDriverAgentInvoker(AgentInvoker mediaDriverAgentInvoker)
      Set the AgentInvoker that should be used for the Media Driver if running in a lightweight mode.
      Parameters:
      mediaDriverAgentInvoker - that should be used for the Media Driver if running in a lightweight mode.
      Returns:
      this for a fluent API.
    • errorHandler

      public ErrorHandler errorHandler()
      Get the ErrorHandler to be used by the Archive.
      Returns:
      the ErrorHandler to be used by the Archive.
    • errorHandler

      public Archive.Context errorHandler(ErrorHandler errorHandler)
      Set the ErrorHandler to be used by the Archive.
      Parameters:
      errorHandler - the error handler to be used by the Archive.
      Returns:
      this for a fluent API
    • countedErrorHandler

      public Archive.Context countedErrorHandler(CountedErrorHandler countedErrorHandler)
      Non-default for context.
      Parameters:
      countedErrorHandler - to override the default.
      Returns:
      this for a fluent API.
    • countedErrorHandler

      public CountedErrorHandler countedErrorHandler()
      The errorHandler() that will increment errorCounter() by default.
      Returns:
      errorHandler() that will increment errorCounter() by default.
    • threadingMode

      public ArchiveThreadingMode threadingMode()
      Get the archive threading mode.
      Returns:
      the archive threading mode.
      See Also:
    • threadingMode

      public Archive.Context threadingMode(ArchiveThreadingMode threadingMode)
      Set the archive threading mode.
      Parameters:
      threadingMode - archive threading mode.
      Returns:
      this for a fluent API.
      See Also:
    • threadFactory

      public ThreadFactory threadFactory()
      Get the thread factory used for creating threads in ArchiveThreadingMode.SHARED and ArchiveThreadingMode.DEDICATED threading modes.
      Returns:
      thread factory used for creating threads in SHARED and DEDICATED threading modes.
    • threadFactory

      public Archive.Context threadFactory(ThreadFactory threadFactory)
      Set the thread factory used for creating threads in ArchiveThreadingMode.SHARED and ArchiveThreadingMode.DEDICATED threading modes. The thread factories can be overridden for the recorder and replayer by using recorderThreadFactory(ThreadFactory) and replayerThreadFactory(ThreadFactory) respectively.
      Parameters:
      threadFactory - used for creating threads in SHARED and DEDICATED threading modes.
      Returns:
      this for a fluent API.
    • recorderThreadFactory

      public ThreadFactory recorderThreadFactory()
      Get the thread factory used for creating the recorder thread when running in DEDICATED threading mode.
      Returns:
      the thread factory used for creating the recorder thread when running in DEDICATED threading mode.
    • recorderThreadFactory

      public Archive.Context recorderThreadFactory(ThreadFactory threadFactory)
      Set the thread factory used for creating the recorder thread when running in DEDICATED threading mode. This will be used to override threadFactory.
      Parameters:
      threadFactory - used for creating the recorder thread when running in DEDICATED threading mode.
      Returns:
      this for a fluent API.
    • replayerThreadFactory

      public ThreadFactory replayerThreadFactory()
      Get the thread factory used for creating the replayer thread when running in DEDICATED threading mode.
      Returns:
      the thread factory used for creating the replayer thread when running in DEDICATED threading mode.
    • replayerThreadFactory

      public Archive.Context replayerThreadFactory(ThreadFactory threadFactory)
      Set the thread factory used for creating the replayer thread when running in DEDICATED threading mode. This will be used to override threadFactory.
      Parameters:
      threadFactory - used for creating the replayer thread when running in DEDICATED threading mode.
      Returns:
      this for a fluent API.
    • errorBufferLength

      public Archive.Context errorBufferLength(int errorBufferLength)
      Set the error buffer length in bytes to use.
      Parameters:
      errorBufferLength - in bytes to use.
      Returns:
      this for a fluent API.
      See Also:
    • errorBufferLength

      public int errorBufferLength()
      The error buffer length in bytes.
      Returns:
      error buffer length in bytes.
      See Also:
    • archiveId

      public Archive.Context archiveId(long archiveId)
      Set the id for this Archive instance.
      Parameters:
      archiveId - for this Archive instance.
      Returns:
      this for a fluent API
      See Also:
    • archiveId

      public long archiveId()
      Get the id of this Archive instance.
      Returns:
      the id of this Archive instance.
      See Also:
    • errorCounter

      public AtomicCounter errorCounter()
      Get the error counter that will record the number of errors observed.
      Returns:
      the error counter that will record the number of errors observed.
    • errorCounter

      public Archive.Context errorCounter(AtomicCounter errorCounter)
      Set the error counter that will record the number of errors observed.
      Parameters:
      errorCounter - the error counter that will record the number of errors observed.
      Returns:
      this for a fluent API.
    • controlSessionsCounter

      public Counter controlSessionsCounter()
      Get the counter used to track the number of active control sessions.
      Returns:
      the counter used to track the number of active control sessions.
    • controlSessionsCounter

      public Archive.Context controlSessionsCounter(Counter controlSessionsCounter)
      Set the counter used to track the number of active control sessions.
      Parameters:
      controlSessionsCounter - the counter used to track the number of active control sessions.
      Returns:
      this for a fluent API.
    • recordingSessionCounter

      public Counter recordingSessionCounter()
      Get the counter used to track the count of concurrent recording sessions.
      Returns:
      the counter used to track the count of concurrent recording sessions.
    • recordingSessionCounter

      public Archive.Context recordingSessionCounter(Counter counter)
      Set the counter used to track the count of concurrent recording sessions.
      Parameters:
      counter - used to track the count of concurrent recording sessions.
      Returns:
      this for a fluent API.
    • replaySessionCounter

      public Counter replaySessionCounter()
      Get the counter used to track the count of concurrent replay sessions.
      Returns:
      the counter used to track the count of concurrent replay sessions.
    • replaySessionCounter

      public Archive.Context replaySessionCounter(Counter counter)
      Set the counter used to track the count of concurrent replay sessions.
      Parameters:
      counter - used to track the count of concurrent replay sessions.
      Returns:
      this for a fluent API.
    • totalWriteBytesCounter

      public Counter totalWriteBytesCounter()
      Get the counter used to track the total number of bytes written by the recorder.
      Returns:
      the counter used to track the total number of bytes written by the recorder.
    • totalWriteBytesCounter

      public Archive.Context totalWriteBytesCounter(Counter counter)
      Set the counter used to track the total number of bytes written by the recorder.
      Parameters:
      counter - used to track the total number of bytes written by the recorder.
      Returns:
      this for a fluent API.
    • totalWriteTimeCounter

      public Counter totalWriteTimeCounter()
      Get the counter used to track the total time used by the recorder to write data.
      Returns:
      the counter used to track the total time used by the recorder to write data.
    • totalWriteTimeCounter

      public Archive.Context totalWriteTimeCounter(Counter counter)
      Set the counter used to track the total time used by the recorder to write data.
      Parameters:
      counter - used to track the total time used by the recorder to write data.
      Returns:
      this for a fluent API.
    • maxWriteTimeCounter

      public Counter maxWriteTimeCounter()
      Get the counter used to track the max time used by the recorder to write a block of data.
      Returns:
      the counter used to track the max time used by the recorder to write a block of data.
    • maxWriteTimeCounter

      public Archive.Context maxWriteTimeCounter(Counter counter)
      Set the counter used to track the max time used by the recorder to write a block of data.
      Parameters:
      counter - used to track the max time used by the recorder to write a block of data.
      Returns:
      this for a fluent API.
    • totalReadBytesCounter

      public Counter totalReadBytesCounter()
      Get the counter used to track the total number of bytes read by the replayer.
      Returns:
      the counter used to track the total number of bytes read by the replayer.
    • totalReadBytesCounter

      public Archive.Context totalReadBytesCounter(Counter counter)
      Set the counter used to track the total number of bytes read by the replayer.
      Parameters:
      counter - used to track the total number of bytes read by the replayer.
      Returns:
      this for a fluent API.
    • totalReadTimeCounter

      public Counter totalReadTimeCounter()
      Get the counter used to track the total time used by the replayer to read data.
      Returns:
      the counter used to track the total time used by the replayer to read data.
    • totalReadTimeCounter

      public Archive.Context totalReadTimeCounter(Counter counter)
      Set the counter used to track the total time used by the replayer to read data.
      Parameters:
      counter - used to track the total time used by the replayer to read data.
      Returns:
      this for a fluent API.
    • maxReadTimeCounter

      public Counter maxReadTimeCounter()
      Get the counter used to track the max time used by the replayer to read a block of data.
      Returns:
      the counter used to track the max time used by the replayer to read a block of data.
    • maxReadTimeCounter

      public Archive.Context maxReadTimeCounter(Counter counter)
      Set the counter used to track the max time used by the replayer to read a block of data.
      Parameters:
      counter - used to track the max time used by the replayer to read a block of data.
      Returns:
      this for a fluent API.
    • maxConcurrentRecordings

      public int maxConcurrentRecordings()
      Get the max number of concurrent recordings.
      Returns:
      the max number of concurrent recordings.
      See Also:
    • maxConcurrentRecordings

      public Archive.Context maxConcurrentRecordings(int maxConcurrentRecordings)
      Set the max number of concurrent recordings.
      Parameters:
      maxConcurrentRecordings - the max number of concurrent recordings.
      Returns:
      this for a fluent API.
      See Also:
    • maxConcurrentReplays

      public int maxConcurrentReplays()
      Get the max number of concurrent replays.
      Returns:
      the max number of concurrent replays.
      See Also:
    • maxConcurrentReplays

      public Archive.Context maxConcurrentReplays(int maxConcurrentReplays)
      Set the max number of concurrent replays.
      Parameters:
      maxConcurrentReplays - the max number of concurrent replays.
      Returns:
      this for a fluent API.
      See Also:
    • fileIoMaxLength

      public int fileIoMaxLength()
      Get the max length of a file IO operation.
      Returns:
      the max length of a file IO operation.
      See Also:
    • fileIoMaxLength

      public Archive.Context fileIoMaxLength(int fileIoMaxLength)
      Set the max length of a file IO operation.
      Parameters:
      fileIoMaxLength - the max length of a file IO operation.
      Returns:
      this for a fluent API.
      See Also:
    • lowStorageSpaceThreshold

      public Archive.Context lowStorageSpaceThreshold(long lowStorageSpaceThreshold)
      Threshold below which the archive will reject new recording requests.
      Parameters:
      lowStorageSpaceThreshold - in bytes.
      Returns:
      this for a fluent API.
      See Also:
    • lowStorageSpaceThreshold

      public long lowStorageSpaceThreshold()
      Threshold below which the archive will reject new recording requests.
      Returns:
      threshold below which the archive will reject new recording requests in bytes.
      See Also:
    • deleteArchiveDirectory

      @Deprecated public void deleteArchiveDirectory()
      Deprecated.
      Delete the archive directory if the archiveDir() value is not null.

      Use deleteDirectory() instead.

    • deleteDirectory

      public void deleteDirectory()
      Delete the archive directory if the archiveDir() value is not null.
    • aeronDirectoryName

      public Archive.Context aeronDirectoryName(String 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

      public String aeronDirectoryName()
      Get the top level Aeron directory used for communication between the Aeron client and Media Driver.
      Returns:
      The top level Aeron directory.
    • aeron

      public Archive.Context aeron(Aeron aeron)
      Aeron client for communicating with the local Media Driver.

      This client will be closed when the Archive.close() or close() methods are called if ownsAeronClient() is true.

      Parameters:
      aeron - client for communicating with the local Media Driver.
      Returns:
      this for a fluent API.
      See Also:
    • aeron

      public Aeron aeron()
      Aeron client for communicating with the local Media Driver.

      If not provided then a default will be established during conclude() by calling Aeron.connect().

      Returns:
      client for communicating with the local Media Driver.
    • ownsAeronClient

      public Archive.Context ownsAeronClient(boolean ownsAeronClient)
      Does this context own the aeron() client and this takes responsibility for closing it?
      Parameters:
      ownsAeronClient - does this context own the aeron() client.
      Returns:
      this for a fluent API.
    • ownsAeronClient

      public boolean ownsAeronClient()
      Does this context own the aeron() client and this takes responsibility for closing it?
      Returns:
      does this context own the aeron() client and this takes responsibility for closing it?
    • archiveMarkFile

      public Archive.Context archiveMarkFile(ArchiveMarkFile archiveMarkFile)
      The ArchiveMarkFile for the Archive.
      Parameters:
      archiveMarkFile - ArchiveMarkFile for the Archive.
      Returns:
      this for a fluent API.
    • archiveMarkFile

      public ArchiveMarkFile archiveMarkFile()
      The ArchiveMarkFile for the Archive.
      Returns:
      ArchiveMarkFile for the Archive.
    • maxCatalogEntries

      @Deprecated public Archive.Context maxCatalogEntries(long maxCatalogEntries)
      Deprecated.
      This method was deprecated in favor of catalogCapacity(long) which works with bytes rather than number of entries.
      Maximum number of catalog entries for the Archive.

      Note: This method has no effect.

      Parameters:
      maxCatalogEntries - for the archive.
      Returns:
      this for a fluent API.
      See Also:
    • maxCatalogEntries

      @Deprecated public long maxCatalogEntries()
      Deprecated.
      This method was deprecated in favor of catalogCapacity() which returns capacity of the Catalog in bytes rather than in number of entries.
      Maximum number of catalog entries for the Archive.

      Note: This method is not used.

      Returns:
      maximum number of catalog entries for the Archive.
      See Also:
    • catalogCapacity

      public Archive.Context catalogCapacity(long catalogCapacity)
      Capacity in bytes of the Catalog.
      Parameters:
      catalogCapacity - in bytes.
      Returns:
      this for a fluent API.
      See Also:
    • catalogCapacity

      public long catalogCapacity()
      Capacity in bytes of the Catalog.
      Returns:
      capacity in bytes of the Catalog.
      See Also:
    • authenticatorSupplier

      public AuthenticatorSupplier authenticatorSupplier()
      Get the AuthenticatorSupplier that should be used for the Archive.
      Returns:
      the AuthenticatorSupplier to be used for the Archive.
    • authenticatorSupplier

      public Archive.Context authenticatorSupplier(AuthenticatorSupplier authenticatorSupplier)
      Set the AuthenticatorSupplier that will be used for the Archive.
      Parameters:
      authenticatorSupplier - AuthenticatorSupplier to use for the Archive.
      Returns:
      this for a fluent API.
    • authorisationServiceSupplier

      public AuthorisationServiceSupplier authorisationServiceSupplier()
      Get the AuthorisationServiceSupplier that should be used for the Archive.
      Returns:
      the AuthorisationServiceSupplier to be used for the Archive.
    • authorisationServiceSupplier

      public Archive.Context authorisationServiceSupplier(AuthorisationServiceSupplier authorisationServiceSupplier)

      Set the AuthorisationServiceSupplier that will be used for the Archive.

      When using an authorisation service for the ConsensusModule, then the following values for protocolId, actionId, and type should be considered.

      Parameters for authorisation service queries from the Archive
      DescriptionprotocolIdactionIdtype(s)
      Start the recording of a stream MessageHeaderDecoder.SCHEMA_ID StartRecordingRequestDecoder.TEMPLATE_ID (null)
      Start the recording of a stream (version 2) StartRecordingRequest2Decoder.TEMPLATE_ID (null)
      Stop the recording of a stream StopRecordingRequestDecoder.TEMPLATE_ID (null)
      Replay a stream from the archive ReplayRequestDecoder.TEMPLATE_ID (null)
      Stop a replay from the archive StopReplayRequestDecoder.TEMPLATE_ID (null)
      List the recordings from the archive ListRecordingsRequestDecoder.TEMPLATE_ID (null)
      List the recordings from the archive for a specific URI ListRecordingsForUriRequestDecoder.TEMPLATE_ID (null)
      List a specific recording from the archive ListRecordingRequestDecoder.TEMPLATE_ID (null)
      Extend a recording ExtendRecordingRequestDecoder.TEMPLATE_ID (null)
      Extend a recording (version 2) ExtendRecordingRequest2Decoder.TEMPLATE_ID (null)
      Gets the position of a recording RecordingPositionRequestDecoder.TEMPLATE_ID (null)
      Truncate a recording TruncateRecordingRequestDecoder.TEMPLATE_ID (null)
      Stop a recording by subscription StopRecordingSubscriptionRequestDecoder.TEMPLATE_ID (null)
      Extend a recording ExtendRecordingRequestDecoder.TEMPLATE_ID (null)
      Get the stop position for a recording StopPositionRequestDecoder.TEMPLATE_ID (null)
      Find the last recording for a given stream, session and channel fragment FindLastMatchingRecordingRequestDecoder.TEMPLATE_ID (null)
      List subscriptions being used for recordings ListRecordingSubscriptionsRequestDecoder.TEMPLATE_ID (null)
      Stop all replays StopAllReplaysRequestDecoder.TEMPLATE_ID (null)
      Start replicating a recording ReplicateRequestDecoder.TEMPLATE_ID (null)
      Start replicating a recording (version 2) ReplicateRequest2Decoder.TEMPLATE_ID (null)
      Stop replication a recording StopReplicationRequestDecoder.TEMPLATE_ID (null)
      Get the start position of a recording StartRecordingRequestDecoder.TEMPLATE_ID (null)
      Detach segment files from a recording DetachSegmentsRequestDecoder.TEMPLATE_ID (null)
      Delete detached segments DeleteDetachedSegmentsRequestDecoder.TEMPLATE_ID (null)
      Attach new segments for a recording AttachSegmentsRequestDecoder.TEMPLATE_ID (null)
      Migrate segments from one recording to another MigrateSegmentsRequestDecoder.TEMPLATE_ID (null)
      Keep alive the archive connection KeepAliveRequestDecoder.TEMPLATE_ID (null)
      Replicate a recording with a tag TaggedReplicateRequestDecoder.TEMPLATE_ID (null)
      Stop recording by recording id StopRecordingByIdentityRequestDecoder.TEMPLATE_ID (null)
      Purge a recording by recording id PurgeRecordingRequestDecoder.TEMPLATE_ID (null)
      Parameters:
      authorisationServiceSupplier - AuthorisationServiceSupplier to use for the Archive.
      Returns:
      this for a fluent API.
    • secureRandomAlgorithm

      public String secureRandomAlgorithm()
      Get the secure random algorithm should be used by various Aeron components.
      Returns:
      the secure random algorithm to be used.
      See Also:
    • secureRandomAlgorithm

      public Archive.Context secureRandomAlgorithm(String algorithm)
      Define which secure random algorithm should be used by various Aeron components. This string will be passed to SecureRandom.getInstance(String), with one exception. The special case of strong (case-insensitive) will use SecureRandom.getInstanceStrong()
      Parameters:
      algorithm - the algorithm to be used or strong
      Returns:
      this for the fluent API.
      See Also:
    • secureRandom

      public SecureRandom secureRandom()
      Get the configured instance of SecureRandom using SecureRandom.getInstanceStrong() if strong is specified.
      Returns:
      instance of SecureRandom
      Throws:
      AeronException - if there is a problem resolving the algorithm
    • close

      public void close()
      Close the context and free applicable resources.

      If ownsAeronClient() is true then the aeron() client will be closed.

    • toString

      public String toString()
      Overrides:
      toString in class Object