@NotThreadSafe public interface ClientSession extends Closeable
Modifier and Type | Method and Description |
---|---|
void |
advanceClusterTime(BsonDocument clusterTime) |
void |
advanceOperationTime(BsonTimestamp operationTime)
Set the operation time of the last operation executed in this session.
|
void |
close() |
BsonDocument |
getClusterTime() |
MongoClient |
getMongoClient()
Gets the MongoClient on which this is a session.
|
BsonTimestamp |
getOperationTime()
Gets the operation time of the last operation executed in this session.
|
ClientSessionOptions |
getOptions()
Get the options for this session.
|
ServerSession |
getServerSession() |
boolean |
isCausallyConsistent()
Returns true if operations in this session must be causally consistent
|
ClientSessionOptions getOptions()
boolean isCausallyConsistent()
MongoClient getMongoClient()
Important so that the MongoClient can check that the session is from the same MongoClient instance to which it's passed
ServerSession getServerSession()
BsonTimestamp getOperationTime()
void advanceOperationTime(BsonTimestamp operationTime)
operationTime
- the operation timevoid advanceClusterTime(BsonDocument clusterTime)
clusterTime
- the cluster time to advance toBsonDocument getClusterTime()
void close()
close
in interface AutoCloseable
close
in interface Closeable