public class BaseClientSessionImpl extends java.lang.Object implements ClientSession
| Constructor and Description |
|---|
BaseClientSessionImpl(ServerSessionPool serverSessionPool,
java.lang.Object originator,
ClientSessionOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
advanceClusterTime(BsonDocument newClusterTime) |
void |
advanceOperationTime(BsonTimestamp newOperationTime)
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.
|
java.lang.Object |
getOriginator()
Gets the originator for the session.
|
ServerAddress |
getPinnedServerAddress()
Get the server address of the pinned mongos on this session.
|
BsonDocument |
getRecoveryToken()
Get the recovery token from the latest outcome in a sharded transaction.
|
ServerSession |
getServerSession() |
boolean |
isCausallyConsistent()
Returns true if operations in this session must be causally consistent
|
void |
setPinnedServerAddress(ServerAddress address)
Set the server address of the pinned mongos.
|
void |
setRecoveryToken(BsonDocument recoveryToken)
Set the recovery token.
|
public BaseClientSessionImpl(ServerSessionPool serverSessionPool, java.lang.Object originator, ClientSessionOptions options)
@Nullable public ServerAddress getPinnedServerAddress()
ClientSessiongetPinnedServerAddress in interface ClientSessionpublic void setPinnedServerAddress(@Nullable
ServerAddress address)
ClientSessionsetPinnedServerAddress in interface ClientSessionaddress - the server address to pinpublic BsonDocument getRecoveryToken()
ClientSessiongetRecoveryToken in interface ClientSessionpublic void setRecoveryToken(BsonDocument recoveryToken)
ClientSessionsetRecoveryToken in interface ClientSessionrecoveryToken - the recovery tokenpublic ClientSessionOptions getOptions()
ClientSessiongetOptions in interface ClientSessionpublic boolean isCausallyConsistent()
ClientSessionisCausallyConsistent in interface ClientSessionpublic java.lang.Object getOriginator()
ClientSessionImportant because sessions must only be used by their own originator.
getOriginator in interface ClientSessionpublic BsonDocument getClusterTime()
getClusterTime in interface ClientSessionpublic BsonTimestamp getOperationTime()
ClientSessiongetOperationTime in interface ClientSessionpublic ServerSession getServerSession()
getServerSession in interface ClientSessionpublic void advanceOperationTime(BsonTimestamp newOperationTime)
ClientSessionadvanceOperationTime in interface ClientSessionnewOperationTime - the operation timepublic void advanceClusterTime(BsonDocument newClusterTime)
advanceClusterTime in interface ClientSessionnewClusterTime - the cluster time to advance topublic void close()
close in interface ClientSessionclose in interface java.io.Closeableclose in interface java.lang.AutoCloseableCopyright © 2010 - 2023 Adobe. All Rights Reserved