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 java.lang.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
Constructors Constructor Description ListDatabasesOperation(Decoder<T> decoder)
Deprecated.Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description BatchCursor<T>
execute(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 TListDatabasesOperation<T>
filter(BsonDocument filter)
Deprecated.Sets the query filter to apply to the returned database names.BsonDocument
getFilter()
Deprecated.Gets the query filter to apply to the returned database names.long
getMaxTime(java.util.concurrent.TimeUnit timeUnit)
Deprecated.Gets the maximum execution time on the server for this operation.java.lang.Boolean
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.boolean
getRetryReads()
Deprecated.Gets the value for retryable reads.ListDatabasesOperation<T>
maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Sets the maximum execution time on the server for this operation.ListDatabasesOperation<T>
nameOnly(java.lang.Boolean 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.ListDatabasesOperation<T>
retryReads(boolean retryReads)
Deprecated.Enables retryable reads if a read fails due to a network error.
-
-
-
Method Detail
-
getMaxTime
public long getMaxTime(java.util.concurrent.TimeUnit timeUnit)
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
public ListDatabasesOperation<T> maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
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
public ListDatabasesOperation<T> filter(BsonDocument 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
public BsonDocument getFilter()
Deprecated.Gets the query filter to apply to the returned database names.- Returns:
- this
- Since:
- 3.6
-
nameOnly
public ListDatabasesOperation<T> nameOnly(java.lang.Boolean 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
public ListDatabasesOperation<T> retryReads(boolean 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
public java.lang.Boolean 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
public BatchCursor<T> execute(ReadBinding binding)
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
-
-