Package com.mongodb.internal.session
Class ClientSessionContext
- java.lang.Object
-
- com.mongodb.internal.session.ClientSessionContext
-
- All Implemented Interfaces:
SessionContext
@Deprecated(since="2021-05-27") public abstract class ClientSessionContext extends java.lang.Object implements SessionContext
Deprecated.
-
-
Constructor Summary
Constructors Constructor Description ClientSessionContext(ClientSession clientSession)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadvanceClusterTime(BsonDocument clusterTime)Deprecated.Advance the cluster time.voidadvanceOperationTime(BsonTimestamp operationTime)Deprecated.Advance the operation time.longadvanceTransactionNumber()Deprecated.Advance the transaction number.ClientSessiongetClientSession()Deprecated.BsonDocumentgetClusterTime()Deprecated.Gets the current cluster time for this session context.BsonTimestampgetOperationTime()Deprecated.Gets the current operation time for this session contextBsonDocumentgetSessionId()Deprecated.Gets the session identifier if this context has a session backing it.longgetTransactionNumber()Deprecated.Gets the current transaction number.booleanhasSession()Deprecated.Returns true if there is a true server session associated with this context.booleanisCausallyConsistent()Deprecated.Gets whether this context is associated with a causally consistent session.booleanisSessionMarkedDirty()Deprecated.Whether the server session is marked dirty.voidmarkSessionDirty()Deprecated.Mark the session as dirty.voidsetRecoveryToken(BsonDocument recoveryToken)Deprecated.Sets the recovery token in the session.voidunpinServerAddress()Deprecated.Unpin a mongos from a session.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.mongodb.session.SessionContext
getReadConcern, hasActiveTransaction, isImplicitSession, notifyMessageSent
-
-
-
-
Constructor Detail
-
ClientSessionContext
public ClientSessionContext(ClientSession clientSession)
Deprecated.
-
-
Method Detail
-
getClientSession
public ClientSession getClientSession()
Deprecated.
-
hasSession
public boolean hasSession()
Deprecated.Description copied from interface:SessionContextReturns true if there is a true server session associated with this context.- Specified by:
hasSessionin interfaceSessionContext- Returns:
- true if there is a true server session associated with this context.
-
getSessionId
public BsonDocument getSessionId()
Deprecated.Description copied from interface:SessionContextGets the session identifier if this context has a session backing it.- Specified by:
getSessionIdin interfaceSessionContext- Returns:
- the session id
-
isCausallyConsistent
public boolean isCausallyConsistent()
Deprecated.Description copied from interface:SessionContextGets whether this context is associated with a causally consistent session.- Specified by:
isCausallyConsistentin interfaceSessionContext- Returns:
- true ift his context is associated with a causally consistent session
-
getTransactionNumber
public long getTransactionNumber()
Deprecated.Description copied from interface:SessionContextGets the current transaction number.- Specified by:
getTransactionNumberin interfaceSessionContext- Returns:
- the current transaction number
-
advanceTransactionNumber
public long advanceTransactionNumber()
Deprecated.Description copied from interface:SessionContextAdvance the transaction number.- Specified by:
advanceTransactionNumberin interfaceSessionContext- Returns:
- the next transaction number for the session
-
getOperationTime
public BsonTimestamp getOperationTime()
Deprecated.Description copied from interface:SessionContextGets the current operation time for this session context- Specified by:
getOperationTimein interfaceSessionContext- Returns:
- the current operation time, which may be null
-
advanceOperationTime
public void advanceOperationTime(BsonTimestamp operationTime)
Deprecated.Description copied from interface:SessionContextAdvance the operation time. If the current operation time is greater than the given operation time, this method has no effect.- Specified by:
advanceOperationTimein interfaceSessionContext- Parameters:
operationTime- the new operation time time
-
getClusterTime
public BsonDocument getClusterTime()
Deprecated.Description copied from interface:SessionContextGets the current cluster time for this session context.- Specified by:
getClusterTimein interfaceSessionContext- Returns:
- the cluster time, which may be null
-
advanceClusterTime
public void advanceClusterTime(BsonDocument clusterTime)
Deprecated.Description copied from interface:SessionContextAdvance the cluster time. If the current cluster time is greater than the given cluster time, this method has no effect.- Specified by:
advanceClusterTimein interfaceSessionContext- Parameters:
clusterTime- the new cluster time
-
setRecoveryToken
public void setRecoveryToken(BsonDocument recoveryToken)
Deprecated.Description copied from interface:SessionContextSets the recovery token in the session.- Specified by:
setRecoveryTokenin interfaceSessionContext- Parameters:
recoveryToken- the recovery token
-
unpinServerAddress
public void unpinServerAddress()
Deprecated.Description copied from interface:SessionContextUnpin a mongos from a session.- Specified by:
unpinServerAddressin interfaceSessionContext
-
markSessionDirty
public void markSessionDirty()
Deprecated.Description copied from interface:SessionContextMark the session as dirty. This happens when a command fails with a network error. Dirty sessions are later discarded from the server session pool.- Specified by:
markSessionDirtyin interfaceSessionContext
-
isSessionMarkedDirty
public boolean isSessionMarkedDirty()
Deprecated.Description copied from interface:SessionContextWhether the server session is marked dirty.- Specified by:
isSessionMarkedDirtyin interfaceSessionContext- Returns:
- true if the session has been marked dirty
-
-