Package com.mongodb.session
Interface SessionContext
- All Known Implementing Classes:
ClientSessionContext,ClusterClockAdvancingSessionContext,NoOpSessionContext,ReadConcernAwareNoOpSessionContext
Deprecated.
there is no replacement for this class
The session context.
- Since:
- 3.6
-
Method Summary
Modifier and TypeMethodDescriptionvoidadvanceClusterTime(BsonDocument clusterTime) Deprecated.Advance the cluster time.voidadvanceOperationTime(BsonTimestamp operationTime) Deprecated.Advance the operation time.longDeprecated.Advance the transaction number.Deprecated.Gets the current cluster time for this session context.Deprecated.Gets the current operation time for this session contextDeprecated.Gets the read concern to apply to operations on this binding.Deprecated.Gets the session identifier if this context has a session backing it.longDeprecated.Gets the current transaction number.booleanDeprecated.Gets whether the session has an active transactionbooleanDeprecated.Returns true if there is a true server session associated with this context.booleanDeprecated.Gets whether this context is associated with a causally consistent session.booleanDeprecated.Returns true if the session is implicit, and false if the application started the session explicity.booleanDeprecated.Whether the server session is marked dirty.voidDeprecated.Mark the session as dirty.booleanDeprecated.Notify the session context that a message has been sent.voidsetRecoveryToken(BsonDocument recoveryToken) Deprecated.Sets the recovery token in the session.voidDeprecated.Unpin a mongos from a session.
-
Method Details
-
hasSession
boolean hasSession()Deprecated.Returns true if there is a true server session associated with this context.- Returns:
- true if there is a true server session associated with this context.
-
isImplicitSession
boolean isImplicitSession()Deprecated.Returns true if the session is implicit, and false if the application started the session explicity.- Returns:
- true if the session is implicit
- Since:
- 3.8
-
getSessionId
BsonDocument getSessionId()Deprecated.Gets the session identifier if this context has a session backing it.- Returns:
- the session id
-
isCausallyConsistent
boolean isCausallyConsistent()Deprecated.Gets whether this context is associated with a causally consistent session.- Returns:
- true ift his context is associated with a causally consistent session
-
getTransactionNumber
long getTransactionNumber()Deprecated.Gets the current transaction number.- Returns:
- the current transaction number
- Since:
- 3.8
-
advanceTransactionNumber
long advanceTransactionNumber()Deprecated.Advance the transaction number.- Returns:
- the next transaction number for the session
-
notifyMessageSent
boolean notifyMessageSent()Deprecated.Notify the session context that a message has been sent.- Returns:
- true if this is the first message sent, false otherwise
- Since:
- 3.8
-
getOperationTime
BsonTimestamp getOperationTime()Deprecated.Gets the current operation time for this session context- Returns:
- the current operation time, which may be null
-
advanceOperationTime
Deprecated.Advance the operation time. If the current operation time is greater than the given operation time, this method has no effect.- Parameters:
operationTime- the new operation time time
-
getClusterTime
BsonDocument getClusterTime()Deprecated.Gets the current cluster time for this session context.- Returns:
- the cluster time, which may be null
-
advanceClusterTime
Deprecated.Advance the cluster time. If the current cluster time is greater than the given cluster time, this method has no effect.- Parameters:
clusterTime- the new cluster time
-
hasActiveTransaction
boolean hasActiveTransaction()Deprecated.Gets whether the session has an active transaction- Returns:
- true if the session has an active transaction
- Since:
- 3.8
-
getReadConcern
ReadConcern getReadConcern()Deprecated.Gets the read concern to apply to operations on this binding.- Returns:
- the read concern to apply to operations on this binding
- Since:
- 3.8
-
setRecoveryToken
Deprecated.Sets the recovery token in the session.- Parameters:
recoveryToken- the recovery token- Since:
- 3.11
-
unpinServerAddress
void unpinServerAddress()Deprecated.Unpin a mongos from a session.- Since:
- 3.11
-
markSessionDirty
void markSessionDirty()Deprecated.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.- Since:
- 3.12
-
isSessionMarkedDirty
boolean isSessionMarkedDirty()Deprecated.Whether the server session is marked dirty.- Returns:
- true if the session has been marked dirty
- Since:
- 3.12
-