Class CachingSagaStore.Builder<T>

java.lang.Object
org.axonframework.modelling.saga.repository.CachingSagaStore.Builder<T>
Type Parameters:
T - a generic specifying the Saga type contained in this SagaRepository implementation
Enclosing class:
CachingSagaStore<T>

public static class CachingSagaStore.Builder<T> extends Object
Builder class to instantiate a CachingSagaStore.

The delegateSagaStore of type SagaStore, the associationsCache and sagaCache (both of type Cache) are hard requirements and as such should be provided.

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • delegateSagaStore

      public CachingSagaStore.Builder<T> delegateSagaStore(SagaStore<T> delegateSagaStore)
      Sets the SagaStore instance providing access to (persisted) entries.
      Parameters:
      delegateSagaStore - the SagaStore instance providing access to (persisted) entries
      Returns:
      the current Builder instance, for fluent interfacing
    • associationsCache

      public CachingSagaStore.Builder<T> associationsCache(Cache associationsCache)
      Sets the associationsCache of type Cache used to store Saga associations with.
      Parameters:
      associationsCache - a Cache used to store Saga associations with
      Returns:
      the current Builder instance, for fluent interfacing
    • sagaCache

      public CachingSagaStore.Builder<T> sagaCache(Cache sagaCache)
      Sets the sagaCache of type Cache used to store Sagas with.
      Parameters:
      sagaCache - a Cache used to store Sagas with
      Returns:
      the current Builder instance, for fluent interfacing
    • build

      public CachingSagaStore<T> build()
      Initializes a CachingSagaStore as specified through this Builder.
      Returns:
      a CachingSagaStore as specified through this Builder
    • validate

      protected void validate() throws AxonConfigurationException
      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