final class ListDatabasesIterableImpl<TResult> extends java.lang.Object implements ListDatabasesIterable<TResult>
Modifier and Type | Field and Description |
---|---|
private CodecRegistry |
codecRegistry |
private AsyncOperationExecutor |
executor |
private long |
maxTimeMS |
private ReadPreference |
readPreference |
private java.lang.Class<TResult> |
resultClass |
Constructor and Description |
---|
ListDatabasesIterableImpl(java.lang.Class<TResult> resultClass,
CodecRegistry codecRegistry,
ReadPreference readPreference,
AsyncOperationExecutor executor) |
Modifier and Type | Method and Description |
---|---|
void |
batchCursor(SingleResultCallback<AsyncBatchCursor<TResult>> callback)
Provide the underlying
AsyncBatchCursor allowing fine grained control of the cursor. |
ListDatabasesIterableImpl<TResult> |
batchSize(int batchSize)
Sets the number of documents to return per batch.
|
private ListDatabasesOperation<TResult> |
createListDatabasesOperation() |
private MongoIterable<TResult> |
execute() |
private MongoIterable<TResult> |
execute(ListDatabasesOperation<TResult> operation) |
void |
first(SingleResultCallback<TResult> callback)
Helper to return the first item in the iterator or null.
|
void |
forEach(Block<? super TResult> block,
SingleResultCallback<java.lang.Void> callback)
Iterates over all documents in the view, applying the given block to each, and completing the returned future after all documents
have been iterated, or an exception has occurred.
|
<A extends java.util.Collection<? super TResult>> |
into(A target,
SingleResultCallback<A> callback)
Iterates over all the documents, adding each to the given target.
|
<U> MongoIterable<U> |
map(Function<TResult,U> mapper)
Maps this iterable from the source document type to the target document type.
|
ListDatabasesIterable<TResult> |
maxTime(long maxTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.
|
private final java.lang.Class<TResult> resultClass
private final ReadPreference readPreference
private final CodecRegistry codecRegistry
private final AsyncOperationExecutor executor
private long maxTimeMS
ListDatabasesIterableImpl(java.lang.Class<TResult> resultClass, CodecRegistry codecRegistry, ReadPreference readPreference, AsyncOperationExecutor executor)
public ListDatabasesIterable<TResult> maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
ListDatabasesIterable
maxTime
in interface ListDatabasesIterable<TResult>
maxTime
- the max timetimeUnit
- the time unit, which may not be nullpublic void first(SingleResultCallback<TResult> callback)
MongoIterable
first
in interface MongoIterable<TResult>
callback
- a callback that is passed the first item or null.public void forEach(Block<? super TResult> block, SingleResultCallback<java.lang.Void> callback)
MongoIterable
forEach
in interface MongoIterable<TResult>
block
- the block to apply to each documentcallback
- a callback that completed once the iteration has completedpublic <A extends java.util.Collection<? super TResult>> void into(A target, SingleResultCallback<A> callback)
MongoIterable
into
in interface MongoIterable<TResult>
A
- the collection typetarget
- the collection to insert intocallback
- a callback that will be passed the target containing all documentspublic <U> MongoIterable<U> map(Function<TResult,U> mapper)
MongoIterable
map
in interface MongoIterable<TResult>
U
- the target document typemapper
- a function that maps from the source to the target document typepublic ListDatabasesIterableImpl<TResult> batchSize(int batchSize)
ListDatabasesIterable
batchSize
in interface ListDatabasesIterable<TResult>
batchSize
in interface MongoIterable<TResult>
batchSize
- the batch sizepublic void batchCursor(SingleResultCallback<AsyncBatchCursor<TResult>> callback)
MongoIterable
AsyncBatchCursor
allowing fine grained control of the cursor.batchCursor
in interface MongoIterable<TResult>
callback
- a callback that will be passed the AsyncBatchCursorprivate MongoIterable<TResult> execute()
private MongoIterable<TResult> execute(ListDatabasesOperation<TResult> operation)
private ListDatabasesOperation<TResult> createListDatabasesOperation()