Package com.mongodb.operation
Class TransactionOperation
- java.lang.Object
-
- com.mongodb.operation.TransactionOperation
-
- All Implemented Interfaces:
AsyncWriteOperation<java.lang.Void>
,WriteOperation<java.lang.Void>
- Direct Known Subclasses:
AbortTransactionOperation
,CommitTransactionOperation
public abstract class TransactionOperation extends java.lang.Object implements WriteOperation<java.lang.Void>, AsyncWriteOperation<java.lang.Void>
A base class for transaction-related operations- Since:
- 3.8
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Void
execute(WriteBinding binding)
General execute which can return anything of type Tvoid
executeAsync(AsyncWriteBinding binding, SingleResultCallback<java.lang.Void> callback)
General execute which can return anything of type TWriteConcern
getWriteConcern()
Gets the write concern.
-
-
-
Method Detail
-
getWriteConcern
public WriteConcern getWriteConcern()
Gets the write concern.- Returns:
- the write concern
-
execute
public java.lang.Void execute(WriteBinding binding)
Description copied from interface:WriteOperation
General execute which can return anything of type T- Specified by:
execute
in interfaceWriteOperation<java.lang.Void>
- Parameters:
binding
- the binding to execute in the context of- Returns:
- T, the result of the execution
-
executeAsync
public void executeAsync(AsyncWriteBinding binding, SingleResultCallback<java.lang.Void> callback)
Description copied from interface:AsyncWriteOperation
General execute which can return anything of type T- Specified by:
executeAsync
in interfaceAsyncWriteOperation<java.lang.Void>
- Parameters:
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed
-
-