Package com.mongodb.internal.connection
Class ClusterClockAdvancingSessionContext
- java.lang.Object
-
- com.mongodb.internal.connection.ClusterClockAdvancingSessionContext
-
- All Implemented Interfaces:
SessionContext
@Deprecated(since="2021-05-27") public final class ClusterClockAdvancingSessionContext extends java.lang.Object implements SessionContext
Deprecated.
-
-
Constructor Summary
Constructors Constructor Description ClusterClockAdvancingSessionContext(SessionContext wrapped, ClusterClock clusterClock)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
advanceClusterTime(BsonDocument clusterTime)
Deprecated.Advance the cluster time.void
advanceOperationTime(BsonTimestamp operationTime)
Deprecated.Advance the operation time.long
advanceTransactionNumber()
Deprecated.Advance the transaction number.BsonDocument
getClusterTime()
Deprecated.Gets the current cluster time for this session context.BsonTimestamp
getOperationTime()
Deprecated.Gets the current operation time for this session contextReadConcern
getReadConcern()
Deprecated.Gets the read concern to apply to operations on this binding.BsonDocument
getSessionId()
Deprecated.Gets the session identifier if this context has a session backing it.long
getTransactionNumber()
Deprecated.Gets the current transaction number.boolean
hasActiveTransaction()
Deprecated.Gets whether the session has an active transactionboolean
hasSession()
Deprecated.Returns true if there is a true server session associated with this context.boolean
isCausallyConsistent()
Deprecated.Gets whether this context is associated with a causally consistent session.boolean
isImplicitSession()
Deprecated.Returns true if the session is implicit, and false if the application started the session explicity.boolean
isSessionMarkedDirty()
Deprecated.Whether the server session is marked dirty.void
markSessionDirty()
Deprecated.Mark the session as dirty.boolean
notifyMessageSent()
Deprecated.Notify the session context that a message has been sent.void
setRecoveryToken(BsonDocument recoveryToken)
Deprecated.Sets the recovery token in the session.void
unpinServerAddress()
Deprecated.Unpin a mongos from a session.
-
-
-
Constructor Detail
-
ClusterClockAdvancingSessionContext
public ClusterClockAdvancingSessionContext(SessionContext wrapped, ClusterClock clusterClock)
Deprecated.
-
-
Method Detail
-
hasSession
public boolean hasSession()
Deprecated.Description copied from interface:SessionContext
Returns true if there is a true server session associated with this context.- Specified by:
hasSession
in interfaceSessionContext
- Returns:
- true if there is a true server session associated with this context.
-
isImplicitSession
public boolean isImplicitSession()
Deprecated.Description copied from interface:SessionContext
Returns true if the session is implicit, and false if the application started the session explicity.- Specified by:
isImplicitSession
in interfaceSessionContext
- Returns:
- true if the session is implicit
-
getSessionId
public BsonDocument getSessionId()
Deprecated.Description copied from interface:SessionContext
Gets the session identifier if this context has a session backing it.- Specified by:
getSessionId
in interfaceSessionContext
- Returns:
- the session id
-
isCausallyConsistent
public boolean isCausallyConsistent()
Deprecated.Description copied from interface:SessionContext
Gets whether this context is associated with a causally consistent session.- Specified by:
isCausallyConsistent
in interfaceSessionContext
- Returns:
- true ift his context is associated with a causally consistent session
-
getTransactionNumber
public long getTransactionNumber()
Deprecated.Description copied from interface:SessionContext
Gets the current transaction number.- Specified by:
getTransactionNumber
in interfaceSessionContext
- Returns:
- the current transaction number
-
advanceTransactionNumber
public long advanceTransactionNumber()
Deprecated.Description copied from interface:SessionContext
Advance the transaction number.- Specified by:
advanceTransactionNumber
in interfaceSessionContext
- Returns:
- the next transaction number for the session
-
notifyMessageSent
public boolean notifyMessageSent()
Deprecated.Description copied from interface:SessionContext
Notify the session context that a message has been sent.- Specified by:
notifyMessageSent
in interfaceSessionContext
- Returns:
- true if this is the first message sent, false otherwise
-
getOperationTime
public BsonTimestamp getOperationTime()
Deprecated.Description copied from interface:SessionContext
Gets the current operation time for this session context- Specified by:
getOperationTime
in interfaceSessionContext
- Returns:
- the current operation time, which may be null
-
advanceOperationTime
public void advanceOperationTime(BsonTimestamp operationTime)
Deprecated.Description copied from interface:SessionContext
Advance the operation time. If the current operation time is greater than the given operation time, this method has no effect.- Specified by:
advanceOperationTime
in interfaceSessionContext
- Parameters:
operationTime
- the new operation time time
-
getClusterTime
public BsonDocument getClusterTime()
Deprecated.Description copied from interface:SessionContext
Gets the current cluster time for this session context.- Specified by:
getClusterTime
in interfaceSessionContext
- Returns:
- the cluster time, which may be null
-
advanceClusterTime
public void advanceClusterTime(BsonDocument clusterTime)
Deprecated.Description copied from interface:SessionContext
Advance the cluster time. If the current cluster time is greater than the given cluster time, this method has no effect.- Specified by:
advanceClusterTime
in interfaceSessionContext
- Parameters:
clusterTime
- the new cluster time
-
hasActiveTransaction
public boolean hasActiveTransaction()
Deprecated.Description copied from interface:SessionContext
Gets whether the session has an active transaction- Specified by:
hasActiveTransaction
in interfaceSessionContext
- Returns:
- true if the session has an active transaction
-
getReadConcern
public ReadConcern getReadConcern()
Deprecated.Description copied from interface:SessionContext
Gets the read concern to apply to operations on this binding.- Specified by:
getReadConcern
in interfaceSessionContext
- Returns:
- the read concern to apply to operations on this binding
-
setRecoveryToken
public void setRecoveryToken(BsonDocument recoveryToken)
Deprecated.Description copied from interface:SessionContext
Sets the recovery token in the session.- Specified by:
setRecoveryToken
in interfaceSessionContext
- Parameters:
recoveryToken
- the recovery token
-
unpinServerAddress
public void unpinServerAddress()
Deprecated.Description copied from interface:SessionContext
Unpin a mongos from a session.- Specified by:
unpinServerAddress
in interfaceSessionContext
-
markSessionDirty
public void markSessionDirty()
Deprecated.Description copied from interface:SessionContext
Mark 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:
markSessionDirty
in interfaceSessionContext
-
isSessionMarkedDirty
public boolean isSessionMarkedDirty()
Deprecated.Description copied from interface:SessionContext
Whether the server session is marked dirty.- Specified by:
isSessionMarkedDirty
in interfaceSessionContext
- Returns:
- true if the session has been marked dirty
-
-