List of usage examples for com.mongodb ClientSessionOptions builder
public static Builder builder(final ClientSessionOptions options)
From source file:org.restheart.db.sessions.ClientSessionFactory.java
License:Open Source License
ClientSessionImpl createClientSession(UUID sid, final ClientSessionOptions options, final ReadConcern readConcern, final WriteConcern writeConcern, final ReadPreference readPreference) { notNull("readConcern", readConcern); notNull("writeConcern", writeConcern); notNull("readPreference", readPreference); // TODO allow request to specify session and txn options ClientSessionOptions mergedOptions = ClientSessionOptions.builder(options).causallyConsistent(true).build(); ClientSessionImpl cs = new ClientSessionImpl(new SimpleServerSessionPool(SessionsUtils.getCluster(), sid), mClient, mergedOptions, SessionsUtils.getMongoClientDelegate()); return cs;/*w w w.j a va 2 s . c o m*/ }