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 Details

    • ListDatabasesOperation

      public ListDatabasesOperation(Decoder<T> decoder)
      Deprecated.
      Construct a new instance.
      Parameters:
      decoder - the decoder to use for the results
  • Method Details

    • getMaxTime

      public long getMaxTime(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, TimeUnit timeUnit)
      Deprecated.
      Sets the maximum execution time on the server for this operation.
      Parameters:
      maxTime - the max time
      timeUnit - 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(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 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 interface ReadOperation<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 interface AsyncReadOperation<T>
      Parameters:
      binding - the binding to execute in the context of
      callback - the callback to be called when the operation has been executed