Class ArchiveProxy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault number of retry attempts to be made when offering requests. -
Constructor Summary
ConstructorsConstructorDescriptionArchiveProxy(ExclusivePublication publication) Create a proxy with aExclusivePublicationfor sending control message requests.ArchiveProxy(ExclusivePublication publication, IdleStrategy retryIdleStrategy, NanoClock nanoClock, long connectTimeoutNs, int retryAttempts, CredentialsSupplier credentialsSupplier) Create a proxy with aExclusivePublicationfor sending control message requests without specifying client details.ArchiveProxy(ExclusivePublication publication, IdleStrategy retryIdleStrategy, NanoClock nanoClock, long connectTimeoutNs, int retryAttempts, CredentialsSupplier credentialsSupplier, String clientInfo) Create a proxy with aExclusivePublicationfor sending control message requests with specified client info.ArchiveProxy(Publication publication) Deprecated, for removal: This API element is subject to removal in a future version.ArchiveProxy(Publication publication, IdleStrategy retryIdleStrategy, NanoClock nanoClock, long connectTimeoutNs, int retryAttempts, CredentialsSupplier credentialsSupplier) Deprecated, for removal: This API element is subject to removal in a future version.Use another constructor with anExclusivePublication. -
Method Summary
Modifier and TypeMethodDescriptionbooleanarchiveId(long correlationId, long controlSessionId) Get the id of the Archive.booleanattachSegments(long recordingId, long correlationId, long controlSessionId) Attach segments to the beginning of a recording to restore history that was previously detached.booleanboundedReplay(long recordingId, long position, long length, int limitCounterId, String replayChannel, int replayStreamId, long correlationId, long controlSessionId) Replay a recording from a given position bounded by a position counter.booleancloseSession(long controlSessionId) Close this control session with the archive.booleanConnect to an archive on its control interface providing the response stream details.booleandeleteDetachedSegments(long recordingId, long correlationId, long controlSessionId) Delete segments which have been previously detached from a recording.booleandetachSegments(long recordingId, long newStartPosition, long correlationId, long controlSessionId) Detach segments from the beginning of a recording up to the provided new start position.booleanextendRecording(String channel, int streamId, io.aeron.archive.codecs.SourceLocation sourceLocation, boolean autoStop, long recordingId, long correlationId, long controlSessionId) Extend an existing, non-active, recorded stream for the same channel and stream id.booleanextendRecording(String channel, int streamId, io.aeron.archive.codecs.SourceLocation sourceLocation, long recordingId, long correlationId, long controlSessionId) Extend an existing, non-active, recorded stream for the same channel and stream id.booleanfindLastMatchingRecording(long minRecordingId, String channelFragment, int streamId, int sessionId, long correlationId, long controlSessionId) Find the last recording that matches the given criteria.booleangetMaxRecordedPosition(long recordingId, long correlationId, long controlSessionId) Get the stop or active recorded position of a recording.booleangetRecordingPosition(long recordingId, long correlationId, long controlSessionId) Get the recorded position of an active recording.booleangetStartPosition(long recordingId, long correlationId, long controlSessionId) Get the start position of a recording.booleangetStopPosition(long recordingId, long correlationId, long controlSessionId) Get the stop position of a recording.booleankeepAlive(long controlSessionId, long correlationId) Keep this archive session alive by notifying the archive.booleanlistRecording(long recordingId, long correlationId, long controlSessionId) List a recording descriptor for a given recording id.booleanlistRecordings(long fromRecordingId, int recordCount, long correlationId, long controlSessionId) List a range of recording descriptors.booleanlistRecordingsForUri(long fromRecordingId, int recordCount, String channelFragment, int streamId, long correlationId, long controlSessionId) List a range of recording descriptors which match a channel URI fragment and stream id.booleanlistRecordingSubscriptions(int pseudoIndex, int subscriptionCount, String channelFragment, int streamId, boolean applyStreamId, long correlationId, long controlSessionId) List registered subscriptions in the archive which have been used to record streams.booleanmigrateSegments(long srcRecordingId, long dstRecordingId, long correlationId, long controlSessionId) Migrate segments from a source recording and attach them to the beginning or end of a destination recording.Get thePublicationused for sending control messages.booleanpurgeRecording(long recordingId, long correlationId, long controlSessionId) Purge a stopped recording, i.e.booleanpurgeSegments(long recordingId, long newStartPosition, long correlationId, long controlSessionId) Purge (detach and delete) segments from the beginning of a recording up to the provided new start position.booleanreplay(long recordingId, long position, long length, String replayChannel, int replayStreamId, long correlationId, long controlSessionId) Replay a recording from a given position.booleanreplay(long recordingId, String replayChannel, int replayStreamId, ReplayParams replayParams, long correlationId, long controlSessionId) Replay a recording from a given position.booleanreplicate(long srcRecordingId, int srcControlStreamId, String srcControlChannel, ReplicationParams replicationParams, long correlationId, long controlSessionId) Replicate a recording from a source archive to a destination which can be considered a backup for a primary archive.booleanreplicate(long srcRecordingId, long dstRecordingId, int srcControlStreamId, String srcControlChannel, String liveDestination, long correlationId, long controlSessionId) Replicate a recording from a source archive to a destination which can be considered a backup for a primary archive.booleanreplicate(long srcRecordingId, long dstRecordingId, long stopPosition, int srcControlStreamId, String srcControlChannel, String liveDestination, String replicationChannel, long correlationId, long controlSessionId) Replicate a recording from a source archive to a destination which can be considered a backup for a primary archive.booleanrequestReplayToken(long lastCorrelationId, long controlSessionId, long recordingId) Request a token for this session that will allow a replay to be initiated from another image without re-authentication.booleanstartRecording(String channel, int streamId, io.aeron.archive.codecs.SourceLocation sourceLocation, boolean autoStop, long correlationId, long controlSessionId) Start recording streams for a given channel and stream id pairing.booleanstartRecording(String channel, int streamId, io.aeron.archive.codecs.SourceLocation sourceLocation, long correlationId, long controlSessionId) Start recording streams for a given channel and stream id pairing.booleanstopAllReplays(long recordingId, long correlationId, long controlSessionId) Stop any existing replay sessions for recording id or all replay sessions regardless of recording id.booleanstopRecording(long subscriptionId, long correlationId, long controlSessionId) Stop a recording by theSubscription.registrationId()it was registered with.booleanstopRecording(String channel, int streamId, long correlationId, long controlSessionId) Stop an active recording.booleanstopRecordingByIdentity(long recordingId, long correlationId, long controlSessionId) Stop an active recording by the recording id.booleanstopReplay(long replaySessionId, long correlationId, long controlSessionId) Stop an existing replay session.booleanstopReplication(long replicationId, long correlationId, long controlSessionId) Stop an active replication by the registration id it was registered with.booleantaggedReplicate(long srcRecordingId, long dstRecordingId, long channelTagId, long subscriptionTagId, int srcControlStreamId, String srcControlChannel, String liveDestination, long correlationId, long controlSessionId) Replicate a recording from a source archive to a destination which can be considered a backup for a primary archive.booleantaggedReplicate(long srcRecordingId, long dstRecordingId, long stopPosition, long channelTagId, long subscriptionTagId, int srcControlStreamId, String srcControlChannel, String liveDestination, String replicationChannel, long correlationId, long controlSessionId) Replicate a recording from a source archive to a destination which can be considered a backup for a primary archive.booleantruncateRecording(long recordingId, long position, long correlationId, long controlSessionId) Truncate a stopped recording to a given position that is less than the stopped position.booleantryChallengeResponse(byte[] encodedCredentials, long correlationId, long controlSessionId) Try and send a ChallengeResponse to an archive on its control interface providing the credentials.booleantryConnect(String responseChannel, int responseStreamId, long correlationId) Try and connect to an archive on its control interface providing the response stream details.booleanupdateChannel(long recordingId, String channel, long correlationId, long controlSessionId) Update the channel for a recording.
-
Field Details
-
DEFAULT_RETRY_ATTEMPTS
public static final int DEFAULT_RETRY_ATTEMPTSDefault number of retry attempts to be made when offering requests.
-
-
Constructor Details
-
ArchiveProxy
Deprecated, for removal: This API element is subject to removal in a future version.Use another constructor with anExclusivePublication.Create a proxy with aExclusivePublicationfor sending control message requests.This provides a default
IdleStrategyof aYieldingIdleStrategywhen offers are back pressured with a defaults ofAeronArchive.Configuration.MESSAGE_TIMEOUT_DEFAULT_NSandAeronArchive.Configuration.MESSAGE_RETRY_ATTEMPTS_DEFAULT.- Parameters:
publication- publication for sending control messages to an archive.- Throws:
ClassCastException- ifpublicationis not an instance ofExclusivePublication.
-
ArchiveProxy
Create a proxy with aExclusivePublicationfor sending control message requests.This provides a default
IdleStrategyof aYieldingIdleStrategywhen offers are back pressured with a defaults ofAeronArchive.Configuration.MESSAGE_TIMEOUT_DEFAULT_NSandDEFAULT_RETRY_ATTEMPTS.- Parameters:
publication- publication for sending control messages to an archive.- Throws:
ClassCastException- ifpublicationis not an instance ofExclusivePublication.
-
ArchiveProxy
@Deprecated(forRemoval=true, since="1.47.0") public ArchiveProxy(Publication publication, IdleStrategy retryIdleStrategy, NanoClock nanoClock, long connectTimeoutNs, int retryAttempts, CredentialsSupplier credentialsSupplier) Deprecated, for removal: This API element is subject to removal in a future version.Use another constructor with anExclusivePublication.Create a proxy with aExclusivePublicationfor sending control message requests.- Parameters:
publication- publication for sending control messages to an archive.retryIdleStrategy- for what should happen between retry attempts at offering messages.nanoClock- to be used for calculating checking deadlines.connectTimeoutNs- for connection requests.retryAttempts- for offering control messages before giving up.credentialsSupplier- for the AuthConnectRequest- Throws:
ClassCastException- ifpublicationis not an instance ofExclusivePublication.
-
ArchiveProxy
public ArchiveProxy(ExclusivePublication publication, IdleStrategy retryIdleStrategy, NanoClock nanoClock, long connectTimeoutNs, int retryAttempts, CredentialsSupplier credentialsSupplier) Create a proxy with aExclusivePublicationfor sending control message requests without specifying client details.- Parameters:
publication- publication for sending control messages to an archive.retryIdleStrategy- for what should happen between retry attempts at offering messages.nanoClock- to be used for calculating checking deadlines.connectTimeoutNs- for connection requests.retryAttempts- for offering control messages before giving up.credentialsSupplier- for the AuthConnectRequest- Since:
- 1.47.0
-
ArchiveProxy
public ArchiveProxy(ExclusivePublication publication, IdleStrategy retryIdleStrategy, NanoClock nanoClock, long connectTimeoutNs, int retryAttempts, CredentialsSupplier credentialsSupplier, String clientInfo) Create a proxy with aExclusivePublicationfor sending control message requests with specified client info.- Parameters:
publication- publication for sending control messages to an archive.retryIdleStrategy- for what should happen between retry attempts at offering messages.nanoClock- to be used for calculating checking deadlines.connectTimeoutNs- for connection requests.retryAttempts- for offering control messages before giving up.credentialsSupplier- for theAuthConnectRequest.clientInfo- for theAuthConnectRequest.- Since:
- 1.49.0
-
-
Method Details
-
publication
Get thePublicationused for sending control messages.- Returns:
- the
Publicationused for sending control messages.
-
connect
Connect to an archive on its control interface providing the response stream details.- Parameters:
responseChannel- for the control message responses.responseStreamId- for the control message responses.correlationId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
tryConnect
Try and connect to an archive on its control interface providing the response stream details. Only one attempt will be made to offer the request.- Parameters:
responseChannel- for the control message responses.responseStreamId- for the control message responses.correlationId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
keepAlive
public boolean keepAlive(long controlSessionId, long correlationId) Keep this archive session alive by notifying the archive.- Parameters:
controlSessionId- with the archive.correlationId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
closeSession
public boolean closeSession(long controlSessionId) Close this control session with the archive.- Parameters:
controlSessionId- with the archive.- Returns:
trueif successfully offered otherwisefalse.
-
tryChallengeResponse
public boolean tryChallengeResponse(byte[] encodedCredentials, long correlationId, long controlSessionId) Try and send a ChallengeResponse to an archive on its control interface providing the credentials. Only one attempt will be made to offer the request.- Parameters:
encodedCredentials- to send.correlationId- for this response.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
startRecording
public boolean startRecording(String channel, int streamId, io.aeron.archive.codecs.SourceLocation sourceLocation, long correlationId, long controlSessionId) Start recording streams for a given channel and stream id pairing.- Parameters:
channel- to be recorded.streamId- to be recorded.sourceLocation- of the publication to be recorded.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
startRecording
public boolean startRecording(String channel, int streamId, io.aeron.archive.codecs.SourceLocation sourceLocation, boolean autoStop, long correlationId, long controlSessionId) Start recording streams for a given channel and stream id pairing.- Parameters:
channel- to be recorded.streamId- to be recorded.sourceLocation- of the publication to be recorded.autoStop- if the recording should be automatically stopped when complete.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
stopRecording
public boolean stopRecording(String channel, int streamId, long correlationId, long controlSessionId) Stop an active recording.- Parameters:
channel- to be stopped.streamId- to be stopped.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
stopRecording
public boolean stopRecording(long subscriptionId, long correlationId, long controlSessionId) Stop a recording by theSubscription.registrationId()it was registered with.- Parameters:
subscriptionId- that identifies the subscription in the archive doing the recording.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
stopRecordingByIdentity
public boolean stopRecordingByIdentity(long recordingId, long correlationId, long controlSessionId) Stop an active recording by the recording id. This is not theSubscription.registrationId().- Parameters:
recordingId- that identifies a recording in the archive.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
replay
public boolean replay(long recordingId, String replayChannel, int replayStreamId, ReplayParams replayParams, long correlationId, long controlSessionId) Replay a recording from a given position. Supports specifyingReplayParamsto change the behaviour of the replay. For example a bounded replay can be requested by specifying the boundingLimitCounterId. The ReplayParams is free to be reused after this call completes.- Parameters:
recordingId- to be replayed.replayChannel- to which the replay should be sent.replayStreamId- to which the replay should be sent.replayParams- optional parameters change the behaviour of the replay.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.- See Also:
-
replay
public boolean replay(long recordingId, long position, long length, String replayChannel, int replayStreamId, long correlationId, long controlSessionId) Replay a recording from a given position.- Parameters:
recordingId- to be replayed.position- from which the replay should be started.length- of the stream to be replayed. UseLong.MAX_VALUEto follow a live stream.replayChannel- to which the replay should be sent.replayStreamId- to which the replay should be sent.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
boundedReplay
public boolean boundedReplay(long recordingId, long position, long length, int limitCounterId, String replayChannel, int replayStreamId, long correlationId, long controlSessionId) Replay a recording from a given position bounded by a position counter.- Parameters:
recordingId- to be replayed.position- from which the replay should be started.length- of the stream to be replayed. UseLong.MAX_VALUEto follow a live stream.limitCounterId- to use as the replay bound.replayChannel- to which the replay should be sent.replayStreamId- to which the replay should be sent.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
stopReplay
public boolean stopReplay(long replaySessionId, long correlationId, long controlSessionId) Stop an existing replay session.- Parameters:
replaySessionId- that should be stopped.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
stopAllReplays
public boolean stopAllReplays(long recordingId, long correlationId, long controlSessionId) Stop any existing replay sessions for recording id or all replay sessions regardless of recording id.- Parameters:
recordingId- that should be stopped.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
listRecordings
public boolean listRecordings(long fromRecordingId, int recordCount, long correlationId, long controlSessionId) List a range of recording descriptors.- Parameters:
fromRecordingId- at which to begin listing.recordCount- for the number of descriptors to be listed.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
listRecordingsForUri
public boolean listRecordingsForUri(long fromRecordingId, int recordCount, String channelFragment, int streamId, long correlationId, long controlSessionId) List a range of recording descriptors which match a channel URI fragment and stream id.- Parameters:
fromRecordingId- at which to begin listing.recordCount- for the number of descriptors to be listed.channelFragment- to match recordings on from the original channel URI in the archive descriptor.streamId- to match recordings on.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
listRecording
public boolean listRecording(long recordingId, long correlationId, long controlSessionId) List a recording descriptor for a given recording id.- Parameters:
recordingId- at which to begin listing.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
extendRecording
public boolean extendRecording(String channel, int streamId, io.aeron.archive.codecs.SourceLocation sourceLocation, long recordingId, long correlationId, long controlSessionId) Extend an existing, non-active, recorded stream for the same channel and stream id.The channel must be configured for the initial position from which it will be extended. This can be done with
ChannelUriStringBuilder.initialPosition(long, int, int). The details required to initialise can be found by callinglistRecording(long, long, long).- Parameters:
channel- to be recorded.streamId- to be recorded.sourceLocation- of the publication to be recorded.recordingId- to be extended.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
extendRecording
public boolean extendRecording(String channel, int streamId, io.aeron.archive.codecs.SourceLocation sourceLocation, boolean autoStop, long recordingId, long correlationId, long controlSessionId) Extend an existing, non-active, recorded stream for the same channel and stream id.The channel must be configured for the initial position from which it will be extended. This can be done with
ChannelUriStringBuilder.initialPosition(long, int, int). The details required to initialise can be found by callinglistRecording(long, long, long).- Parameters:
channel- to be recorded.streamId- to be recorded.sourceLocation- of the publication to be recorded.autoStop- if the recording should be automatically stopped when complete.recordingId- to be extended.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
getRecordingPosition
public boolean getRecordingPosition(long recordingId, long correlationId, long controlSessionId) Get the recorded position of an active recording.- Parameters:
recordingId- of the active recording that the position is being requested for.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
truncateRecording
public boolean truncateRecording(long recordingId, long position, long correlationId, long controlSessionId) Truncate a stopped recording to a given position that is less than the stopped position. The provided position must be on a fragment boundary. Truncating a recording to the start position effectively deletes the recording.- Parameters:
recordingId- of the stopped recording to be truncated.position- to which the recording will be truncated.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
purgeRecording
public boolean purgeRecording(long recordingId, long correlationId, long controlSessionId) Purge a stopped recording, i.e. mark recording asRecordingState.INVALIDand delete the corresponding segment files. The space in the Catalog will be reclaimed upon compaction.- Parameters:
recordingId- of the stopped recording to be purged.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
getStartPosition
public boolean getStartPosition(long recordingId, long correlationId, long controlSessionId) Get the start position of a recording.- Parameters:
recordingId- of the recording that the position is being requested for.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
getStopPosition
public boolean getStopPosition(long recordingId, long correlationId, long controlSessionId) Get the stop position of a recording.- Parameters:
recordingId- of the recording that the stop position is being requested for.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
getMaxRecordedPosition
public boolean getMaxRecordedPosition(long recordingId, long correlationId, long controlSessionId) Get the stop or active recorded position of a recording.- Parameters:
recordingId- of the recording that the stop of active recording position is being requested for.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
archiveId
public boolean archiveId(long correlationId, long controlSessionId) Get the id of the Archive.- Parameters:
correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
findLastMatchingRecording
public boolean findLastMatchingRecording(long minRecordingId, String channelFragment, int streamId, int sessionId, long correlationId, long controlSessionId) Find the last recording that matches the given criteria.- Parameters:
minRecordingId- to search back to.channelFragment- for a contains match on the original channel stored with the archive descriptor.streamId- of the recording to match.sessionId- of the recording to match.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
listRecordingSubscriptions
public boolean listRecordingSubscriptions(int pseudoIndex, int subscriptionCount, String channelFragment, int streamId, boolean applyStreamId, long correlationId, long controlSessionId) List registered subscriptions in the archive which have been used to record streams.- Parameters:
pseudoIndex- in the list of active recording subscriptions.subscriptionCount- for the number of descriptors to be listed.channelFragment- for a contains match on the stripped channel used with the registered subscription.streamId- for the subscription.applyStreamId- when matching.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
replicate
public boolean replicate(long srcRecordingId, long dstRecordingId, int srcControlStreamId, String srcControlChannel, String liveDestination, long correlationId, long controlSessionId) Replicate a recording from a source archive to a destination which can be considered a backup for a primary archive. The source recording will be replayed via the provided replay channel and use the original stream id. If the destination recording id isAeron.NULL_VALUEthen a new destination recording is created, otherwise the provided destination recording id will be extended. The details of the source recording descriptor will be replicated.For a source recording that is still active the replay can merge with the live stream and then follow it directly and no longer require the replay from the source. This would require a multicast live destination.
Errors will be reported asynchronously and can be checked for with
AeronArchive.pollForErrorResponse()orAeronArchive.checkForErrorResponse().- Parameters:
srcRecordingId- recording id which must exist in the source archive.dstRecordingId- recording to extend in the destination, otherwiseAeron.NULL_VALUE.srcControlChannel- remote control channel for the source archive to instruct the replay on.srcControlStreamId- remote control stream id for the source archive to instruct the replay on.liveDestination- destination for the live stream if merge is required. Empty or null for no merge.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
replicate
public boolean replicate(long srcRecordingId, long dstRecordingId, long stopPosition, int srcControlStreamId, String srcControlChannel, String liveDestination, String replicationChannel, long correlationId, long controlSessionId) Replicate a recording from a source archive to a destination which can be considered a backup for a primary archive. The source recording will be replayed via the provided replay channel and use the original stream id. If the destination recording id isAeron.NULL_VALUEthen a new destination recording is created, otherwise the provided destination recording id will be extended. The details of the source recording descriptor will be replicated.For a source recording that is still active the replay can merge with the live stream and then follow it directly and no longer require the replay from the source. This would require a multicast live destination.
Errors will be reported asynchronously and can be checked for with
AeronArchive.pollForErrorResponse()orAeronArchive.checkForErrorResponse().- Parameters:
srcRecordingId- recording id which must exist in the source archive.dstRecordingId- recording to extend in the destination, otherwiseAeron.NULL_VALUE.stopPosition- position to stop the replication.AeronArchive.NULL_POSITIONto stop at end of current recording.srcControlStreamId- remote control stream id for the source archive to instruct the replay on.srcControlChannel- remote control channel for the source archive to instruct the replay on.liveDestination- destination for the live stream if merge is required. Empty or null for no merge.replicationChannel- channel over which the replication will occur. Empty or null for default channel.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
taggedReplicate
public boolean taggedReplicate(long srcRecordingId, long dstRecordingId, long channelTagId, long subscriptionTagId, int srcControlStreamId, String srcControlChannel, String liveDestination, long correlationId, long controlSessionId) Replicate a recording from a source archive to a destination which can be considered a backup for a primary archive. The source recording will be replayed via the provided replay channel and use the original stream id. If the destination recording id isAeron.NULL_VALUEthen a new destination recording is created, otherwise the provided destination recording id will be extended. The details of the source recording descriptor will be replicated. The subscription used in the archive will be tagged with the provided tags.For a source recording that is still active the replay can merge with the live stream and then follow it directly and no longer require the replay from the source. This would require a multicast live destination.
Errors will be reported asynchronously and can be checked for with
AeronArchive.pollForErrorResponse()orAeronArchive.checkForErrorResponse().- Parameters:
srcRecordingId- recording id which must exist in the source archive.dstRecordingId- recording to extend in the destination, otherwiseAeron.NULL_VALUE.channelTagId- used to tag the replication subscription.subscriptionTagId- used to tag the replication subscription.srcControlChannel- remote control channel for the source archive to instruct the replay on.srcControlStreamId- remote control stream id for the source archive to instruct the replay on.liveDestination- destination for the live stream if merge is required. Empty or null for no merge.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
taggedReplicate
public boolean taggedReplicate(long srcRecordingId, long dstRecordingId, long stopPosition, long channelTagId, long subscriptionTagId, int srcControlStreamId, String srcControlChannel, String liveDestination, String replicationChannel, long correlationId, long controlSessionId) Replicate a recording from a source archive to a destination which can be considered a backup for a primary archive. The source recording will be replayed via the provided replay channel and use the original stream id. If the destination recording id isAeron.NULL_VALUEthen a new destination recording is created, otherwise the provided destination recording id will be extended. The details of the source recording descriptor will be replicated. The subscription used in the archive will be tagged with the provided tags.For a source recording that is still active the replay can merge with the live stream and then follow it directly and no longer require the replay from the source. This would require a multicast live destination.
Errors will be reported asynchronously and can be checked for with
AeronArchive.pollForErrorResponse()orAeronArchive.checkForErrorResponse().- Parameters:
srcRecordingId- recording id which must exist in the source archive.dstRecordingId- recording to extend in the destination, otherwiseAeron.NULL_VALUE.stopPosition- position to stop the replication.AeronArchive.NULL_POSITIONto stop at end of current recording.channelTagId- used to tag the replication subscription.subscriptionTagId- used to tag the replication subscription.srcControlChannel- remote control channel for the source archive to instruct the replay on.srcControlStreamId- remote control stream id for the source archive to instruct the replay on.liveDestination- destination for the live stream if merge is required. Empty or null for no merge.replicationChannel- channel over which the replication will occur. Empty or null for default channel.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
replicate
public boolean replicate(long srcRecordingId, int srcControlStreamId, String srcControlChannel, ReplicationParams replicationParams, long correlationId, long controlSessionId) Replicate a recording from a source archive to a destination which can be considered a backup for a primary archive. The behaviour of the replication is controlled through theReplicationParams.For a source recording that is still active the replay can merge with the live stream and then follow it directly and no longer require the replay from the source. This would require a multicast live destination.
Errors will be reported asynchronously and can be checked for with
AeronArchive.pollForErrorResponse()orAeronArchive.checkForErrorResponse().The ReplicationParams is free to be reused when this call completes.
- Parameters:
srcRecordingId- recording id which must exist in the source archive.srcControlChannel- remote control channel for the source archive to instruct the replay on.srcControlStreamId- remote control stream id for the source archive to instruct the replay on.replicationParams- optional parameters to control the behaviour of the replication.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.- See Also:
-
stopReplication
public boolean stopReplication(long replicationId, long correlationId, long controlSessionId) Stop an active replication by the registration id it was registered with.- Parameters:
replicationId- that identifies the session in the archive doing the replication.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
detachSegments
public boolean detachSegments(long recordingId, long newStartPosition, long correlationId, long controlSessionId) Detach segments from the beginning of a recording up to the provided new start position.The new start position must be first byte position of a segment after the existing start position.
It is not possible to detach segments which are active for recording or being replayed.
- Parameters:
recordingId- to which the operation applies.newStartPosition- for the recording after the segments are detached.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.- See Also:
-
deleteDetachedSegments
public boolean deleteDetachedSegments(long recordingId, long correlationId, long controlSessionId) Delete segments which have been previously detached from a recording.- Parameters:
recordingId- to which the operation applies.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.- See Also:
-
purgeSegments
public boolean purgeSegments(long recordingId, long newStartPosition, long correlationId, long controlSessionId) Purge (detach and delete) segments from the beginning of a recording up to the provided new start position.The new start position must be first byte position of a segment after the existing start position.
It is not possible to purge segments which are active for recording or being replayed.
- Parameters:
recordingId- to which the operation applies.newStartPosition- for the recording after the segments are detached.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.- See Also:
-
attachSegments
public boolean attachSegments(long recordingId, long correlationId, long controlSessionId) Attach segments to the beginning of a recording to restore history that was previously detached.Segment files must match the existing recording and join exactly to the start position of the recording they are being attached to.
- Parameters:
recordingId- to which the operation applies.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.- See Also:
-
migrateSegments
public boolean migrateSegments(long srcRecordingId, long dstRecordingId, long correlationId, long controlSessionId) Migrate segments from a source recording and attach them to the beginning or end of a destination recording.The source recording must match the destination recording for segment length, term length, mtu length, and stream id. The source recording must join to the destination recording on a segment boundary and without gaps, i.e., the stop position and term id of one must match the start position and term id of the other.
The source recording must be stopped. The destination recording must be stopped if migrating segments to the end of the destination recording.
The source recording will be effectively truncated back to its start position after the migration.
- Parameters:
srcRecordingId- source recording from which the segments will be migrated.dstRecordingId- destination recording to which the segments will be attached.correlationId- for this request.controlSessionId- for this request.- Returns:
trueif successfully offered otherwisefalse.
-
requestReplayToken
public boolean requestReplayToken(long lastCorrelationId, long controlSessionId, long recordingId) Request a token for this session that will allow a replay to be initiated from another image without re-authentication.- Parameters:
lastCorrelationId- for the requestcontrolSessionId- for the requestrecordingId- that will be replayed.- Returns:
- true if successfully offered
-
updateChannel
public boolean updateChannel(long recordingId, String channel, long correlationId, long controlSessionId) Update the channel for a recording.- Parameters:
recordingId- the recording id to update.channel- the new channel to include in the catalogue.correlationId- for the request.controlSessionId- for the request.- Returns:
- true if successfully offered.
-
ExclusivePublication.