Package com.mongodb.operation
Class ListDatabasesOperation<T>
java.lang.Object
com.mongodb.operation.ListDatabasesOperation<T>
- Type Parameters:
T
- the document type
- All Implemented Interfaces:
AsyncReadOperation<AsyncBatchCursor<T>>
,ReadOperation<BatchCursor<T>>
@Deprecated
public class ListDatabasesOperation<T>
extends Object
implements AsyncReadOperation<AsyncBatchCursor<T>>, ReadOperation<BatchCursor<T>>
Deprecated.
An operation that provides a cursor allowing iteration through the metadata of all the databases for a MongoClient.
- Since:
- 3.0
-
Constructor Summary
ConstructorsConstructorDescriptionListDatabasesOperation
(Decoder<T> decoder) Deprecated.Construct a new instance. -
Method Summary
Modifier and TypeMethodDescriptionexecute
(ReadBinding binding) Deprecated.Executing this will return a list of all the databases names in the MongoDB instance.void
executeAsync
(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback) Deprecated.General execute which can return anything of type Tfilter
(BsonDocument filter) Deprecated.Sets the query filter to apply to the returned database names.Deprecated.Gets the query filter to apply to the returned database names.long
getMaxTime
(TimeUnit timeUnit) Deprecated.Gets the maximum execution time on the server for this operation.Deprecated.Gets the nameOnly flag that indicates whether the command should return just the database names or return the database names and size information.boolean
Deprecated.Gets the value for retryable reads.Deprecated.Sets the maximum execution time on the server for this operation.Deprecated.Sets the nameOnly flag that indicates whether the command should return just the database names or return the database names and size information.retryReads
(boolean retryReads) Deprecated.Enables retryable reads if a read fails due to a network error.
-
Constructor Details
-
ListDatabasesOperation
Deprecated.Construct a new instance.- Parameters:
decoder
- the decoder to use for the results
-
-
Method Details
-
getMaxTime
Deprecated.Gets the maximum execution time on the server for this operation. The default is 0, which places no limit on the execution time.- Parameters:
timeUnit
- the time unit to return the result in- Returns:
- the maximum execution time in the given time unit
-
maxTime
Deprecated.Sets the maximum execution time on the server for this operation.- Parameters:
maxTime
- the max timetimeUnit
- the time unit, which may not be null- Returns:
- this
-
filter
Deprecated.Sets the query filter to apply to the returned database names.- Parameters:
filter
- the filter, which may be null.- Returns:
- this
- Since:
- 3.6
-
getFilter
Deprecated.Gets the query filter to apply to the returned database names.- Returns:
- this
- Since:
- 3.6
-
nameOnly
Deprecated.Sets the nameOnly flag that indicates whether the command should return just the database names or return the database names and size information.- Parameters:
nameOnly
- the nameOnly flag, which may be null- Returns:
- this
- Since:
- 3.6
-
retryReads
Deprecated.Enables retryable reads if a read fails due to a network error.- Parameters:
retryReads
- true if reads should be retried- Returns:
- this
- Since:
- 3.11
-
getRetryReads
public boolean getRetryReads()Deprecated.Gets the value for retryable reads. The default is true.- Returns:
- the retryable reads value
- Since:
- 3.11
-
getNameOnly
Deprecated.Gets the nameOnly flag that indicates whether the command should return just the database names or return the database names and size information.- Returns:
- this
- Since:
- 3.6
-
execute
Deprecated.Executing this will return a list of all the databases names in the MongoDB instance.- Specified by:
execute
in interfaceReadOperation<T>
- Parameters:
binding
- the binding.- Returns:
- a List of Strings of the names of all the databases in the MongoDB instance.
-
executeAsync
public void executeAsync(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback) Deprecated.Description copied from interface:AsyncReadOperation
General execute which can return anything of type T- Specified by:
executeAsync
in interfaceAsyncReadOperation<T>
- Parameters:
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed
-