T
- the operations result type.@Deprecated public class ChangeStreamOperation<T> extends java.lang.Object implements AsyncReadOperation<AsyncBatchCursor<T>>, ReadOperation<BatchCursor<T>>
$changeStream
aggregation.Constructor and Description |
---|
ChangeStreamOperation(MongoNamespace namespace,
FullDocument fullDocument,
java.util.List<BsonDocument> pipeline,
Decoder<T> decoder)
Deprecated.
Construct a new instance.
|
ChangeStreamOperation(MongoNamespace namespace,
FullDocument fullDocument,
java.util.List<BsonDocument> pipeline,
Decoder<T> decoder,
ChangeStreamLevel changeStreamLevel)
Deprecated.
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
ChangeStreamOperation<T> |
batchSize(java.lang.Integer batchSize)
Deprecated.
Sets the number of documents to return per batch.
|
ChangeStreamOperation<T> |
collation(Collation collation)
Deprecated.
Sets the collation options
|
BatchCursor<T> |
execute(ReadBinding binding)
Deprecated.
General execute which can return anything of type T
|
void |
executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback)
Deprecated.
General execute which can return anything of type T
|
java.lang.Integer |
getBatchSize()
Deprecated.
Gets the number of documents to return per batch.
|
Collation |
getCollation()
Deprecated.
Returns the collation options
|
Decoder<T> |
getDecoder()
Deprecated.
|
FullDocument |
getFullDocument()
Deprecated.
Returns the fullDocument value, in 3.6
|
long |
getMaxAwaitTime(java.util.concurrent.TimeUnit timeUnit)
Deprecated.
The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor
query.
|
MongoNamespace |
getNamespace()
Deprecated.
|
java.util.List<BsonDocument> |
getPipeline()
Deprecated.
Gets the aggregation pipeline.
|
BsonDocument |
getResumeAfter()
Deprecated.
Returns the logical starting point for the new change stream.
|
BsonDocument |
getResumeToken()
Deprecated.
use
getResumeAfter() instead |
boolean |
getRetryReads()
Deprecated.
Gets the value for retryable reads.
|
BsonDocument |
getStartAfter()
Deprecated.
Returns the logical starting point for the new change stream returning the first notification after the token.
|
BsonTimestamp |
getStartAtOperationTime()
Deprecated.
Returns the start at operation time
|
ChangeStreamOperation<T> |
maxAwaitTime(long maxAwaitTime,
java.util.concurrent.TimeUnit timeUnit)
Deprecated.
Sets the maximum await execution time on the server for this operation.
|
ChangeStreamOperation<T> |
resumeAfter(BsonDocument resumeAfter)
Deprecated.
Sets the logical starting point for the new change stream.
|
ChangeStreamOperation<T> |
retryReads(boolean retryReads)
Deprecated.
Enables retryable reads if a read fails due to a network error.
|
void |
setChangeStreamOptionsForResume(BsonDocument resumeToken,
int maxWireVersion)
Deprecated.
Set the change stream operation options for a resumeable operation.
|
ChangeStreamOperation<T> |
startAfter(BsonDocument startAfter)
Deprecated.
Similar to
resumeAfter , this option takes a resume token and starts a
new change stream returning the first notification after the token. |
ChangeStreamOperation<T> |
startAtOperationTime(BsonTimestamp startAtOperationTime)
Deprecated.
The change stream will only provides changes that occurred after the specified timestamp.
|
public ChangeStreamOperation(MongoNamespace namespace, FullDocument fullDocument, java.util.List<BsonDocument> pipeline, Decoder<T> decoder)
namespace
- the database and collection namespace for the operation.fullDocument
- the fullDocument valuepipeline
- the aggregation pipeline.decoder
- the decoder for the result documents.public ChangeStreamOperation(MongoNamespace namespace, FullDocument fullDocument, java.util.List<BsonDocument> pipeline, Decoder<T> decoder, ChangeStreamLevel changeStreamLevel)
namespace
- the database and collection namespace for the operation.fullDocument
- the fullDocument valuepipeline
- the aggregation pipeline.decoder
- the decoder for the result documents.changeStreamLevel
- the level at which the change stream is observingpublic MongoNamespace getNamespace()
public FullDocument getFullDocument()
@Deprecated public BsonDocument getResumeToken()
getResumeAfter()
insteadA null value represents the server default.
public BsonDocument getResumeAfter()
A null value represents the server default.
public ChangeStreamOperation<T> resumeAfter(BsonDocument resumeAfter)
resumeAfter
- the resumeTokenpublic BsonDocument getStartAfter()
A null value represents the server default.
public ChangeStreamOperation<T> startAfter(BsonDocument startAfter)
resumeAfter
, this option takes a resume token and starts a
new change stream returning the first notification after the token.
This will allow users to watch collections that have been dropped and recreated or newly renamed collections without missing any notifications.
Note: The server will report an error if both startAfter
and resumeAfter
are specified.
startAfter
- the startAfter resumeTokenpublic java.util.List<BsonDocument> getPipeline()
public java.lang.Integer getBatchSize()
public ChangeStreamOperation<T> batchSize(java.lang.Integer batchSize)
batchSize
- the batch sizepublic long getMaxAwaitTime(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the time unit to return the result inpublic ChangeStreamOperation<T> maxAwaitTime(long maxAwaitTime, java.util.concurrent.TimeUnit timeUnit)
maxAwaitTime
- the max await time. A value less than one will be ignored, and indicates that the driver should respect the
server's default valuetimeUnit
- the time unit, which may not be nullpublic Collation getCollation()
public ChangeStreamOperation<T> collation(Collation collation)
A null value represents the server default.
collation
- the collation options to usepublic ChangeStreamOperation<T> startAtOperationTime(BsonTimestamp startAtOperationTime)
Any command run against the server will return an operation time that can be used here.
The default value is an operation time obtained from the server before the change stream was created.
startAtOperationTime
- the start at operation timepublic BsonTimestamp getStartAtOperationTime()
public ChangeStreamOperation<T> retryReads(boolean retryReads)
retryReads
- true if reads should be retriedpublic boolean getRetryReads()
public BatchCursor<T> execute(ReadBinding binding)
ReadOperation
execute
in interface ReadOperation<BatchCursor<T>>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback)
AsyncReadOperation
executeAsync
in interface AsyncReadOperation<AsyncBatchCursor<T>>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executedpublic void setChangeStreamOptionsForResume(BsonDocument resumeToken, int maxWireVersion)
resumeToken
- the resume token cached prior to resumemaxWireVersion
- the max wire version reported by the server descriptionCopyright © 2010 - 2023 Adobe. All Rights Reserved