Interface SessionContext

    • Method Detail

      • 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

        void advanceOperationTime​(BsonTimestamp operationTime)
        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

        void advanceClusterTime​(BsonDocument clusterTime)
        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

        void setRecoveryToken​(BsonDocument recoveryToken)
        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