Class MongoSagaStore.Builder
java.lang.Object
org.axonframework.extensions.mongo.eventhandling.saga.repository.MongoSagaStore.Builder
- Enclosing class:
MongoSagaStore
Builder class to instantiate a
MongoSagaStore.
The MongoTemplate and Converter are hard requirements and as such should be provided. The
TransactionManager is defaulted to a NoTransactionManager.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aMongoSagaStoreas specified through this Builder.Sets theConverterused to convert a Saga instance to and from its stored form.mongoTemplate(MongoTemplate mongoTemplate) Sets theMongoTemplateproviding access to the collections.transactionManager(TransactionManager transactionManager) Sets theTransactionManagerused to manage transaction around fetching tokens.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
mongoTemplate
Sets theMongoTemplateproviding access to the collections.- Parameters:
mongoTemplate- theMongoTemplateproviding access to the collections- Returns:
- the current Builder instance, for fluent interfacing
-
converter
Sets theConverterused to convert a Saga instance to and from its stored form.- Parameters:
converter- aConverterused to convert a Saga instance to and from its stored form- Returns:
- the current Builder instance, for fluent interfacing
-
transactionManager
Sets theTransactionManagerused to manage transaction around fetching tokens. Will default toNoTransactionManager, which effectively will not use transactions.- Parameters:
transactionManager- aTransactionManagerused to manage transaction around fetching event data- Returns:
- the current Builder instance, for fluent interfacing
-
build
Initializes aMongoSagaStoreas specified through this Builder.- Returns:
- a
MongoSagaStoreas specified through this Builder
-
validate
Validates whether the fields contained in this Builder are set accordingly.- Throws:
AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-