Interface SubscriptionRequest.RequestOptions
- All Known Implementing Classes:
ChangeStreamRequest.ChangeStreamRequestOptions
,TailableCursorRequest.TailableCursorRequestOptions
- Enclosing interface:
- SubscriptionRequest<S,
T, O extends SubscriptionRequest.RequestOptions>
public static interface SubscriptionRequest.RequestOptions
Options for specifying the behaviour of the
SubscriptionRequest
.- Since:
- 2.1
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionGet the collection name.default String
Get the database name of the db.justCollection
(String collection) Create options with the provided collection.justDatabase
(String database) Create options with the provided database.default Duration
Get the maximum wait time (the time till the next Document is emitted) to apply when reading from the collection.none()
Create empty options.Create options with the provided database and collection.
-
Method Details
-
getDatabaseName
Get the database name of the db.- Returns:
- the name of the database to subscribe to. Can be null in which case the default
database
is used.
-
getCollectionName
Get the collection name.- Returns:
- the name of the collection to subscribe to. Can be null.
-
maxAwaitTime
Get the maximum wait time (the time till the next Document is emitted) to apply when reading from the collection.- Returns:
- never null.
Duration.ZERO
by default. - Since:
- 3.0
-
none
Create empty options.- Returns:
- new instance of empty
SubscriptionRequest.RequestOptions
.
-
justDatabase
Create options with the provided database.- Parameters:
database
- must not be null.- Returns:
- new instance of empty
SubscriptionRequest.RequestOptions
.
-
justCollection
Create options with the provided collection.- Parameters:
collection
- must not be null.- Returns:
- new instance of empty
SubscriptionRequest.RequestOptions
.
-
of
Create options with the provided database and collection.- Parameters:
database
- must not be null.collection
- must not be null.- Returns:
- new instance of empty
SubscriptionRequest.RequestOptions
.
-