T
- the operations result type.AsyncWriteOperation<T>
, WriteOperation<T>
public class CommandWriteOperation<T> extends Object implements AsyncWriteOperation<T>, WriteOperation<T>
Constructor | Description |
---|---|
CommandWriteOperation(String databaseName,
BsonDocument command,
Decoder<T> decoder) |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
T |
execute(WriteBinding binding) |
General execute which can return anything of type T
|
void |
executeAsync(AsyncWriteBinding binding,
SingleResultCallback<T> callback) |
General execute which can return anything of type T
|
public CommandWriteOperation(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(WriteBinding binding)
WriteOperation
execute
in interface WriteOperation<T>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<T> callback)
AsyncWriteOperation
executeAsync
in interface AsyncWriteOperation<T>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed