Package dev.morphia.experimental
Class BaseMorphiaSession
- java.lang.Object
-
- dev.morphia.DatastoreImpl
-
- dev.morphia.experimental.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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortTransaction()
void
advanceClusterTime(org.bson.BsonDocument clusterTime)
void
advanceOperationTime(org.bson.BsonTimestamp operationTime)
void
close()
void
commitTransaction()
org.bson.BsonDocument
getClusterTime()
org.bson.BsonTimestamp
getOperationTime()
com.mongodb.ClientSessionOptions
getOptions()
Object
getOriginator()
com.mongodb.ServerAddress
getPinnedServerAddress()
org.bson.BsonDocument
getRecoveryToken()
com.mongodb.session.ServerSession
getServerSession()
com.mongodb.client.ClientSession
getSession()
Returns the session this datastore is attached to or null if none is attached.com.mongodb.TransactionOptions
getTransactionOptions()
boolean
hasActiveTransaction()
boolean
isCausallyConsistent()
boolean
notifyMessageSent()
void
setPinnedServerAddress(com.mongodb.ServerAddress address)
void
setRecoveryToken(org.bson.BsonDocument recoveryToken)
void
startTransaction()
void
startTransaction(com.mongodb.TransactionOptions transactionOptions)
<T> T
withTransaction(com.mongodb.client.TransactionBody<T> transactionBody)
<T> T
withTransaction(com.mongodb.client.TransactionBody<T> transactionBody, com.mongodb.TransactionOptions options)
-
Methods inherited from class dev.morphia.DatastoreImpl
aggregate, aggregate, createAggregation, createAggregation, createQuery, delete, delete, enableDocumentValidation, enableValidation, ensureCaps, ensureIndexes, ensureIndexes, find, find, find, findSession, getDatabase, getLoggedQuery, getMapper, insert, insert, insert, merge, merge, queryByExample, queryByExample, refresh, save, save, save, startSession, startSession, withTransaction, withTransaction
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface dev.morphia.AdvancedDatastore
createAggregation, createQuery, createRef, createRef, createUpdateOperations, insert, insert, queryByExample
-
Methods inherited from interface dev.morphia.Datastore
aggregate, aggregate, createAggregation, createQuery, createUpdateOperations, delete, delete, delete, delete, enableDocumentValidation, ensureCaps, ensureIndexes, ensureIndexes, find, find, find, findAndDelete, findAndDelete, findAndModify, findAndModify, findSession, getDatabase, getLoggedQuery, getMapper, insert, insert, insert, insert, merge, merge, merge, queryByExample, refresh, save, save, save, save, save, save, save, startSession, startSession, update, update, withTransaction, withTransaction
-
-
-
-
Method Detail
-
getPinnedServerAddress
@Nullable public com.mongodb.ServerAddress getPinnedServerAddress()
- Specified by:
getPinnedServerAddress
in interfacecom.mongodb.client.ClientSession
- Specified by:
getPinnedServerAddress
in interfacecom.mongodb.session.ClientSession
-
setPinnedServerAddress
public void setPinnedServerAddress(@Nullable com.mongodb.ServerAddress address)
- Specified by:
setPinnedServerAddress
in interfacecom.mongodb.client.ClientSession
- Specified by:
setPinnedServerAddress
in interfacecom.mongodb.session.ClientSession
-
hasActiveTransaction
public boolean hasActiveTransaction()
- Specified by:
hasActiveTransaction
in interfacecom.mongodb.client.ClientSession
-
notifyMessageSent
public boolean notifyMessageSent()
- Specified by:
notifyMessageSent
in interfacecom.mongodb.client.ClientSession
-
getTransactionOptions
public com.mongodb.TransactionOptions getTransactionOptions()
- Specified by:
getTransactionOptions
in interfacecom.mongodb.client.ClientSession
-
startTransaction
public void startTransaction()
- Specified by:
startTransaction
in interfacecom.mongodb.client.ClientSession
-
startTransaction
public void startTransaction(com.mongodb.TransactionOptions transactionOptions)
- Specified by:
startTransaction
in interfacecom.mongodb.client.ClientSession
-
commitTransaction
public void commitTransaction()
- Specified by:
commitTransaction
in interfacecom.mongodb.client.ClientSession
-
abortTransaction
public void abortTransaction()
- Specified by:
abortTransaction
in interfacecom.mongodb.client.ClientSession
-
withTransaction
public <T> T withTransaction(com.mongodb.client.TransactionBody<T> transactionBody)
- Specified by:
withTransaction
in interfacecom.mongodb.client.ClientSession
-
withTransaction
public <T> T withTransaction(com.mongodb.client.TransactionBody<T> transactionBody, com.mongodb.TransactionOptions options)
- Specified by:
withTransaction
in interfacecom.mongodb.client.ClientSession
-
getRecoveryToken
@Nullable public org.bson.BsonDocument getRecoveryToken()
- Specified by:
getRecoveryToken
in interfacecom.mongodb.session.ClientSession
-
setRecoveryToken
public void setRecoveryToken(org.bson.BsonDocument recoveryToken)
- Specified by:
setRecoveryToken
in interfacecom.mongodb.session.ClientSession
-
getOptions
public com.mongodb.ClientSessionOptions getOptions()
- Specified by:
getOptions
in interfacecom.mongodb.session.ClientSession
-
isCausallyConsistent
public boolean isCausallyConsistent()
- Specified by:
isCausallyConsistent
in interfacecom.mongodb.session.ClientSession
-
getOriginator
public Object getOriginator()
- Specified by:
getOriginator
in interfacecom.mongodb.session.ClientSession
-
getServerSession
public com.mongodb.session.ServerSession getServerSession()
- Specified by:
getServerSession
in interfacecom.mongodb.session.ClientSession
-
getOperationTime
public org.bson.BsonTimestamp getOperationTime()
- Specified by:
getOperationTime
in interfacecom.mongodb.session.ClientSession
-
advanceOperationTime
public void advanceOperationTime(org.bson.BsonTimestamp operationTime)
- Specified by:
advanceOperationTime
in interfacecom.mongodb.session.ClientSession
-
advanceClusterTime
public void advanceClusterTime(org.bson.BsonDocument clusterTime)
- Specified by:
advanceClusterTime
in interfacecom.mongodb.session.ClientSession
-
getClusterTime
public org.bson.BsonDocument getClusterTime()
- Specified by:
getClusterTime
in interfacecom.mongodb.session.ClientSession
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacecom.mongodb.session.ClientSession
- Specified by:
close
in interfaceCloseable
-
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 interfaceDatastore
- Returns:
- the session
-
-