Package io.vertx.mongo.client
Interface ClientSession
-
public interface ClientSessionA client session that supports transactions.- Since:
- 1.9
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Future<java.lang.Void>abortTransaction()Abort a transaction in the context of this session.voidabortTransaction(Handler<AsyncResult<java.lang.Void>> resultHandler)Abort a transaction in the context of this session.Future<java.lang.Void>commitTransaction()Commit a transaction in the context of this session.voidcommitTransaction(Handler<AsyncResult<java.lang.Void>> resultHandler)Commit a transaction in the context of this session.TransactionOptionsgetTransactionOptions()Gets the transaction options.booleanhasActiveTransaction()Returns true if there is an active transaction on this session, and false otherwisebooleannotifyMessageSent()Notify the client session that a message has been sent.voidstartTransaction()Start a transaction in the context of this session with default transaction options.voidstartTransaction(TransactionOptions transactionOptions)Start a transaction in the context of this session with the given transaction options.
-
-
-
Method Detail
-
hasActiveTransaction
boolean hasActiveTransaction()
Returns true if there is an active transaction on this session, and false otherwise- Returns:
- true if there is an active transaction on this session
- Since server release
- 4.0
-
notifyMessageSent
boolean notifyMessageSent()
Notify the client session that a message has been sent.For internal use only
- Returns:
- true if this is the first message sent, false otherwise
- Since:
- 4.0
-
getTransactionOptions
TransactionOptions getTransactionOptions()
Gets the transaction options. Only call this method of the session has an active transaction- Returns:
- the transaction options
-
startTransaction
void startTransaction()
Start a transaction in the context of this session with default transaction options. A transaction can not be started if there is already an active transaction on this session.- Since server release
- 4.0
-
startTransaction
void startTransaction(TransactionOptions transactionOptions)
Start a transaction in the context of this session with the given transaction options. A transaction can not be started if there is already an active transaction on this session.- Parameters:
transactionOptions- the options to apply to the transaction- Since server release
- 4.0
-
commitTransaction
Future<java.lang.Void> commitTransaction()
Commit a transaction in the context of this session. A transaction can only be commmited if one has first been started.- Returns:
- an empty future that indicates when the operation has completed
- Since server release
- 4.0
-
commitTransaction
void commitTransaction(Handler<AsyncResult<java.lang.Void>> resultHandler)
Commit a transaction in the context of this session. A transaction can only be commmited if one has first been started.- Parameters:
resultHandler- an empty async result that indicates when the operation has completed- Since server release
- 4.0
-
abortTransaction
Future<java.lang.Void> abortTransaction()
Abort a transaction in the context of this session. A transaction can only be aborted if one has first been started.- Returns:
- an empty future that indicates when the operation has completed
- Since server release
- 4.0
-
abortTransaction
void abortTransaction(Handler<AsyncResult<java.lang.Void>> resultHandler)
Abort a transaction in the context of this session. A transaction can only be aborted if one has first been started.- Parameters:
resultHandler- an empty async result that indicates when the operation has completed- Since server release
- 4.0
-
-