Class BaseMorphiaSession

  • All Implemented Interfaces:
    com.mongodb.client.ClientSession, com.mongodb.session.ClientSession, AdvancedDatastore, Datastore, MorphiaSession, Closeable, AutoCloseable
    Direct Known Subclasses:
    MorphiaSessionImpl

    public abstract class BaseMorphiaSession
    extends DatastoreImpl
    implements MorphiaSession
    Developer note.
    This is an experimental item. Its function and presence are subject to change. Feedback on features and usability extremely welcome.
    Developer note.
    This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Method Detail

      • getPinnedServerAddress

        @Nullable
        public com.mongodb.ServerAddress getPinnedServerAddress()
        Specified by:
        getPinnedServerAddress in interface com.mongodb.client.ClientSession
        Specified by:
        getPinnedServerAddress in interface com.mongodb.session.ClientSession
      • setPinnedServerAddress

        public void setPinnedServerAddress​(@Nullable
                                           com.mongodb.ServerAddress address)
        Specified by:
        setPinnedServerAddress in interface com.mongodb.client.ClientSession
        Specified by:
        setPinnedServerAddress in interface com.mongodb.session.ClientSession
      • hasActiveTransaction

        public boolean hasActiveTransaction()
        Specified by:
        hasActiveTransaction in interface com.mongodb.client.ClientSession
      • notifyMessageSent

        public boolean notifyMessageSent()
        Specified by:
        notifyMessageSent in interface com.mongodb.client.ClientSession
      • getTransactionOptions

        public com.mongodb.TransactionOptions getTransactionOptions()
        Specified by:
        getTransactionOptions in interface com.mongodb.client.ClientSession
      • startTransaction

        public void startTransaction()
        Specified by:
        startTransaction in interface com.mongodb.client.ClientSession
      • startTransaction

        public void startTransaction​(com.mongodb.TransactionOptions transactionOptions)
        Specified by:
        startTransaction in interface com.mongodb.client.ClientSession
      • commitTransaction

        public void commitTransaction()
        Specified by:
        commitTransaction in interface com.mongodb.client.ClientSession
      • abortTransaction

        public void abortTransaction()
        Specified by:
        abortTransaction in interface com.mongodb.client.ClientSession
      • withTransaction

        public <T> T withTransaction​(com.mongodb.client.TransactionBody<T> transactionBody)
        Specified by:
        withTransaction in interface com.mongodb.client.ClientSession
      • withTransaction

        public <T> T withTransaction​(com.mongodb.client.TransactionBody<T> transactionBody,
                                     com.mongodb.TransactionOptions options)
        Specified by:
        withTransaction in interface com.mongodb.client.ClientSession
      • getRecoveryToken

        @Nullable
        public org.bson.BsonDocument getRecoveryToken()
        Specified by:
        getRecoveryToken in interface com.mongodb.session.ClientSession
      • setRecoveryToken

        public void setRecoveryToken​(org.bson.BsonDocument recoveryToken)
        Specified by:
        setRecoveryToken in interface com.mongodb.session.ClientSession
      • getOptions

        public com.mongodb.ClientSessionOptions getOptions()
        Specified by:
        getOptions in interface com.mongodb.session.ClientSession
      • isCausallyConsistent

        public boolean isCausallyConsistent()
        Specified by:
        isCausallyConsistent in interface com.mongodb.session.ClientSession
      • getOriginator

        public Object getOriginator()
        Specified by:
        getOriginator in interface com.mongodb.session.ClientSession
      • getServerSession

        public com.mongodb.session.ServerSession getServerSession()
        Specified by:
        getServerSession in interface com.mongodb.session.ClientSession
      • getOperationTime

        public org.bson.BsonTimestamp getOperationTime()
        Specified by:
        getOperationTime in interface com.mongodb.session.ClientSession
      • advanceOperationTime

        public void advanceOperationTime​(org.bson.BsonTimestamp operationTime)
        Specified by:
        advanceOperationTime in interface com.mongodb.session.ClientSession
      • advanceClusterTime

        public void advanceClusterTime​(org.bson.BsonDocument clusterTime)
        Specified by:
        advanceClusterTime in interface com.mongodb.session.ClientSession
      • getClusterTime

        public org.bson.BsonDocument getClusterTime()
        Specified by:
        getClusterTime in interface com.mongodb.session.ClientSession
      • close

        public void close()
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface com.mongodb.session.ClientSession
        Specified by:
        close in interface Closeable
      • getSession

        @NonNull
        public com.mongodb.client.ClientSession getSession()
        Description copied from interface: Datastore
        Returns the session this datastore is attached to or null if none is attached.
        Specified by:
        getSession in interface Datastore
        Returns:
        the session