T
- the document typepublic class ListCollectionsOperation<T> extends java.lang.Object implements AsyncReadOperation<AsyncBatchCursor<T>>, ReadOperation<BatchCursor<T>>
name
field of each returned document is the simple name of the collection rather than the full
namespace.Modifier and Type | Class and Description |
---|---|
private class |
ListCollectionsOperation.ProjectingAsyncBatchCursor |
private class |
ListCollectionsOperation.ProjectingBatchCursor |
Modifier and Type | Field and Description |
---|---|
private int |
batchSize |
private java.lang.String |
databaseName |
private Decoder<T> |
decoder |
private BsonDocument |
filter |
private long |
maxTimeMS |
Constructor and Description |
---|
ListCollectionsOperation(java.lang.String databaseName,
Decoder<T> decoder)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
private BsonDocument |
asQueryDocument(ConnectionDescription connectionDescription,
ReadPreference readPreference) |
private CommandOperationHelper.CommandTransformer<BsonDocument,AsyncBatchCursor<T>> |
asyncTransformer(AsyncConnectionSource source,
AsyncConnection connection) |
ListCollectionsOperation<T> |
batchSize(int batchSize)
Sets the number of documents to return per batch.
|
private CommandOperationHelper.CommandTransformer<BsonDocument,BatchCursor<T>> |
commandTransformer(ConnectionSource source) |
private Codec<BsonDocument> |
createCommandDecoder() |
private MongoNamespace |
createNamespace() |
private AsyncBatchCursor<T> |
emptyAsyncCursor(AsyncConnectionSource source) |
BatchCursor<T> |
execute(ReadBinding binding)
General execute which can return anything of type T
|
void |
executeAsync(AsyncReadBinding binding,
SingleResultCallback<AsyncBatchCursor<T>> callback)
General execute which can return anything of type T
|
ListCollectionsOperation<T> |
filter(BsonDocument filter)
Sets the query filter to apply to the query.
|
java.lang.Integer |
getBatchSize()
Gets the number of documents to return per batch.
|
private BsonDocument |
getCommand() |
BsonDocument |
getFilter()
Gets the query filter.
|
long |
getMaxTime(java.util.concurrent.TimeUnit timeUnit)
Gets the maximum execution time on the server for this operation.
|
private MongoNamespace |
getNamespace() |
ListCollectionsOperation<T> |
maxTime(long maxTime,
java.util.concurrent.TimeUnit timeUnit)
Sets the maximum execution time on the server for this operation.
|
private java.util.List<T> |
projectFromFullNamespaceToCollectionName(java.util.List<BsonDocument> unstripped) |
private final java.lang.String databaseName
private BsonDocument filter
private int batchSize
private long maxTimeMS
public BsonDocument getFilter()
public ListCollectionsOperation<T> filter(BsonDocument filter)
filter
- the filter, which may be null.public java.lang.Integer getBatchSize()
public ListCollectionsOperation<T> batchSize(int batchSize)
batchSize
- the batch sizepublic long getMaxTime(java.util.concurrent.TimeUnit timeUnit)
timeUnit
- the time unit to return the result inpublic ListCollectionsOperation<T> maxTime(long maxTime, java.util.concurrent.TimeUnit timeUnit)
maxTime
- the max timetimeUnit
- the time unit, which may not be nullpublic BatchCursor<T> execute(ReadBinding binding)
ReadOperation
execute
in interface ReadOperation<BatchCursor<T>>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncReadBinding binding, SingleResultCallback<AsyncBatchCursor<T>> callback)
AsyncReadOperation
executeAsync
in interface AsyncReadOperation<AsyncBatchCursor<T>>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executedprivate AsyncBatchCursor<T> emptyAsyncCursor(AsyncConnectionSource source)
private MongoNamespace createNamespace()
private CommandOperationHelper.CommandTransformer<BsonDocument,AsyncBatchCursor<T>> asyncTransformer(AsyncConnectionSource source, AsyncConnection connection)
private CommandOperationHelper.CommandTransformer<BsonDocument,BatchCursor<T>> commandTransformer(ConnectionSource source)
private MongoNamespace getNamespace()
private BsonDocument getCommand()
private BsonDocument asQueryDocument(ConnectionDescription connectionDescription, ReadPreference readPreference)
private Codec<BsonDocument> createCommandDecoder()
private java.util.List<T> projectFromFullNamespaceToCollectionName(java.util.List<BsonDocument> unstripped)