public class ClientSessionContext extends java.lang.Object implements SessionContext
| Modifier and Type | Field and Description |
|---|---|
private ClientSession |
clientSession |
| Constructor and Description |
|---|
ClientSessionContext(ClientSession clientSession) |
| Modifier and Type | Method and Description |
|---|---|
void |
advanceClusterTime(BsonDocument clusterTime)
Advance the cluster time.
|
void |
advanceOperationTime(BsonTimestamp operationTime)
Advance the operation time.
|
long |
advanceTransactionNumber()
Advance the transaction number.
|
ClientSession |
getClientSession() |
BsonDocument |
getClusterTime()
Gets the current cluster time for this session context.
|
BsonTimestamp |
getOperationTime()
Gets the current operation time for this session context
|
BsonDocument |
getSessionId()
Gets the session identifier if this context has a session backing it.
|
boolean |
hasSession()
Returns true if there is a true server session associated with this context.
|
boolean |
isCausallyConsistent()
Gets whether this context is associated with a causally consistent session.
|
private ClientSession clientSession
public ClientSessionContext(ClientSession clientSession)
public ClientSession getClientSession()
public boolean hasSession()
SessionContexthasSession in interface SessionContextpublic BsonDocument getSessionId()
SessionContextgetSessionId in interface SessionContextpublic boolean isCausallyConsistent()
SessionContextisCausallyConsistent in interface SessionContextpublic long advanceTransactionNumber()
SessionContextadvanceTransactionNumber in interface SessionContextpublic BsonTimestamp getOperationTime()
SessionContextgetOperationTime in interface SessionContextpublic void advanceOperationTime(BsonTimestamp operationTime)
SessionContextadvanceOperationTime in interface SessionContextoperationTime - the new operation time timepublic BsonDocument getClusterTime()
SessionContextgetClusterTime in interface SessionContextpublic void advanceClusterTime(BsonDocument clusterTime)
SessionContextadvanceClusterTime in interface SessionContextclusterTime - the new cluster time