T
- the operations result type.public class CommandReadOperation<T> extends java.lang.Object implements AsyncReadOperation<T>, ReadOperation<T>
Modifier and Type | Field and Description |
---|---|
private BsonDocument |
command |
private java.lang.String |
databaseName |
private Decoder<T> |
decoder |
Constructor and Description |
---|
CommandReadOperation(java.lang.String databaseName,
BsonDocument command,
Decoder<T> decoder)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
T |
execute(ReadBinding binding)
General execute which can return anything of type T
|
void |
executeAsync(AsyncReadBinding binding,
SingleResultCallback<T> callback)
General execute which can return anything of type T
|
private final java.lang.String databaseName
private final BsonDocument command
public CommandReadOperation(java.lang.String databaseName, BsonDocument command, Decoder<T> decoder)
databaseName
- the name of the database for the operation.command
- the command to execute.decoder
- the decoder for the result documents.public T execute(ReadBinding binding)
ReadOperation
execute
in interface ReadOperation<T>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncReadBinding binding, SingleResultCallback<T> callback)
AsyncReadOperation
executeAsync
in interface AsyncReadOperation<T>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed