Module spring.data.mongodb
Class ChangeStreamRequest.ChangeStreamRequestOptions
java.lang.Object
org.springframework.data.mongodb.core.messaging.ChangeStreamRequest.ChangeStreamRequestOptions
- All Implemented Interfaces:
SubscriptionRequest.RequestOptions
- Enclosing class:
- ChangeStreamRequest<T>
public static class ChangeStreamRequest.ChangeStreamRequestOptions
extends Object
implements SubscriptionRequest.RequestOptions
SubscriptionRequest.RequestOptions implementation specific to a ChangeStreamRequest.- Since:
- 2.1
- Author:
- Christoph Strobl
-
Constructor Summary
ConstructorsConstructorDescriptionChangeStreamRequestOptions(String databaseName, String collectionName, Duration maxAwaitTime, ChangeStreamOptions options) Create newChangeStreamRequest.ChangeStreamRequestOptions.ChangeStreamRequestOptions(String databaseName, String collectionName, ChangeStreamOptions options) Create newChangeStreamRequest.ChangeStreamRequestOptions. -
Method Summary
Modifier and TypeMethodDescriptionGet theChangeStreamOptionsdefined.Get the collection name.Get the database name of the db.Get the maximum wait time (the time till the next Document is emitted) to apply when reading from the collection.of(SubscriptionRequest.RequestOptions options)
-
Constructor Details
-
ChangeStreamRequestOptions
public ChangeStreamRequestOptions(@Nullable String databaseName, @Nullable String collectionName, ChangeStreamOptions options) Create newChangeStreamRequest.ChangeStreamRequestOptions.- Parameters:
databaseName- can be null.collectionName- can be null.options- must not be null.
-
ChangeStreamRequestOptions
public ChangeStreamRequestOptions(@Nullable String databaseName, @Nullable String collectionName, @Nullable Duration maxAwaitTime, ChangeStreamOptions options) Create newChangeStreamRequest.ChangeStreamRequestOptions.- Parameters:
databaseName- can be null.collectionName- can be null.maxAwaitTime- can be null.options- must not be null.- Since:
- 3.0
-
-
Method Details
-
of
public static ChangeStreamRequest.ChangeStreamRequestOptions of(SubscriptionRequest.RequestOptions options) -
getChangeStreamOptions
Get theChangeStreamOptionsdefined.- Returns:
- never null.
-
getCollectionName
Description copied from interface:SubscriptionRequest.RequestOptionsGet the collection name.- Specified by:
getCollectionNamein interfaceSubscriptionRequest.RequestOptions- Returns:
- the name of the collection to subscribe to. Can be null.
-
getDatabaseName
Description copied from interface:SubscriptionRequest.RequestOptionsGet the database name of the db.- Specified by:
getDatabaseNamein interfaceSubscriptionRequest.RequestOptions- Returns:
- the name of the database to subscribe to. Can be null in which case the default
databaseis used.
-
maxAwaitTime
Description copied from interface:SubscriptionRequest.RequestOptionsGet the maximum wait time (the time till the next Document is emitted) to apply when reading from the collection.- Specified by:
maxAwaitTimein interfaceSubscriptionRequest.RequestOptions- Returns:
- never null.
Duration.ZEROby default.
-