AutoCloseable
, Closeable
ClientSession
, ClientSession
@NotThreadSafe public interface ClientSession extends Closeable
ClientSessionOptions
Modifier and Type | Method | 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() |
|
BsonTimestamp |
getOperationTime() |
Gets the operation time of the last operation executed in this session.
|
ClientSessionOptions |
getOptions() |
Get the options for this session.
|
Object |
getOriginator() |
Gets the originator for the session.
|
ServerSession |
getServerSession() |
|
boolean |
isCausallyConsistent() |
Returns true if operations in this session must be causally consistent
|
ClientSessionOptions getOptions()
boolean isCausallyConsistent()
Object getOriginator()
Important because sessions must only be used by their own originator.
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