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.LonggetMaxCommitTime()Gets the maximum amount of time to allow a single commitTransaction command to execute.ReadConcerngetReadConcern()Gets the read concern.ReadPreferencegetReadPreference()Gets the read preference.WriteConcerngetWriteConcern()Gets the write concern.TransactionOptionssetMaxCommitTime(java.lang.Long maxCommitTime)Sets the maximum execution time on the server for the commitTransaction operation.TransactionOptionssetReadConcern(ReadConcern readConcern)Sets the read concern.TransactionOptionssetReadPreference(ReadPreference readPreference)Sets the read preference.TransactionOptionssetWriteConcern(WriteConcern writeConcern)Sets the write concern.JsonObjecttoJson()
-
-
-
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
-
-