Class AbstractMongoTemplate
java.lang.Object
org.axonframework.extensions.mongo.AbstractMongoTemplate
- Direct Known Subclasses:
DefaultMongoTemplate
Abstract implementation for Mongo templates. Mongo templates give access to the collections in a Mongo Database used
by components of the Axon Framework.
- Since:
- 2.0
- Author:
- Allard Buijze
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAbstract Builder class to instantiate aAbstractMongoTemplate. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiate aAbstractMongoTemplatebased on the fields contained in theAbstractMongoTemplate.Builder. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.mongodb.client.MongoDatabasedatabase()Returns a reference to the Database with the configured database name.
-
Constructor Details
-
AbstractMongoTemplate
Instantiate aAbstractMongoTemplatebased on the fields contained in theAbstractMongoTemplate.Builder.Will assert that the
MongoDatabaseis notnull, and will throw anAxonConfigurationExceptionif any of them isnull.- Parameters:
builder- theAbstractMongoTemplate.Builderused to instantiate aAbstractMongoTemplateinstance
-
-
Method Details
-
database
protected com.mongodb.client.MongoDatabase database()Returns a reference to the Database with the configured database name. If a username and/or password have been provided, these are used to authenticate against the database.Note that the configured
userNameandpasswordare ignored if the database is already in an authenticated state.- Returns:
- a DB instance, referring to the database with configured name.
-