Package io.vertx.mongo
Class TransactionOptions
- java.lang.Object
-
- io.vertx.mongo.TransactionOptions
-
public class TransactionOptions extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description TransactionOptions()
TransactionOptions(JsonObject json)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Long
getMaxCommitTime()
Gets the maximum amount of time to allow a single commitTransaction command to execute.ReadConcern
getReadConcern()
Gets the read concern.ReadPreference
getReadPreference()
Gets the read preference.WriteConcern
getWriteConcern()
Gets the write concern.TransactionOptions
setMaxCommitTime(java.lang.Long maxCommitTime)
Sets the maximum execution time on the server for the commitTransaction operation.TransactionOptions
setReadConcern(ReadConcern readConcern)
Sets the read concern.TransactionOptions
setReadPreference(ReadPreference readPreference)
Sets the read preference.TransactionOptions
setWriteConcern(WriteConcern writeConcern)
Sets the write concern.JsonObject
toJson()
-
-
-
Constructor Detail
-
TransactionOptions
public TransactionOptions()
-
TransactionOptions
public TransactionOptions(JsonObject json)
-
-
Method Detail
-
toJson
public JsonObject toJson()
-
setReadConcern
public TransactionOptions setReadConcern(ReadConcern readConcern)
Sets the read concern.- Parameters:
readConcern
- the read concern- Returns:
- this
-
getReadConcern
public ReadConcern getReadConcern()
Gets the read concern.- Returns:
- the read concern
-
setWriteConcern
public TransactionOptions setWriteConcern(WriteConcern writeConcern)
Sets the write concern.- Parameters:
writeConcern
- the write concern, which must be acknowledged- Returns:
- this
-
getWriteConcern
public WriteConcern getWriteConcern()
Gets the write concern.- Returns:
- the write concern
-
setReadPreference
public TransactionOptions setReadPreference(ReadPreference readPreference)
Sets the read preference.- Parameters:
readPreference
- the read preference, which currently must be primary. This restriction may be relaxed in future versions.- Returns:
- this
-
getReadPreference
public ReadPreference getReadPreference()
Gets the read preference.- Returns:
- the write concern
-
setMaxCommitTime
public TransactionOptions setMaxCommitTime(java.lang.Long maxCommitTime)
Sets the maximum execution time on the server for the commitTransaction operation.- Parameters:
maxCommitTime
- the max commit time, which must be either null or greater than zero, in the given time unit (in milliseconds)- Returns:
- this
- Since:
- 3.11
- Since server release
- 4.2
-
getMaxCommitTime
public java.lang.Long getMaxCommitTime()
Gets the maximum amount of time to allow a single commitTransaction command to execute. The default is null, which places no limit on the execution time.- Returns:
- the maximum execution time (in milliseconds)
- Since:
- 3.11
- Since server release
- 4.2
-
-