Class AxonServerEventStoreFactory.Builder

java.lang.Object
org.axonframework.axonserver.connector.event.axon.AxonServerEventStoreFactory.Builder
Enclosing class:
AxonServerEventStoreFactory

public static class AxonServerEventStoreFactory.Builder extends Object
Builder class to instantiate an AxonServerEventStoreFactory.

The following fields have sensible defaults:

The AxonServerConfiguration, AxonServerConnectionManager, and SnapshotFilter are hard requirements and as such should be provided.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • configuration

      public AxonServerEventStoreFactory.Builder configuration(@Nonnull AxonServerConfiguration configuration)
      Sets the AxonServerConfiguration describing the servers to connect with and how to manage flow control.

      This object is used by the Axon Server event store's EventStorageEngine implementation.

      Parameters:
      configuration - The AxonServerConfiguration describing the servers to connect with and how to manage flow control.
      Returns:
      The current Builder instance, for fluent interfacing.
    • connectionManager

      public AxonServerEventStoreFactory.Builder connectionManager(@Nonnull AxonServerConnectionManager connectionManager)
      Sets the AxonServerConnectionManager managing the connections to Axon Server.

      This object is used by the Axon Server event store's EventStorageEngine implementation.

      Parameters:
      connectionManager - The AxonServerConnectionManager managing the connections to Axon Server.
      Returns:
      The current Builder instance, for fluent interfacing.
    • snapshotSerializer

      public AxonServerEventStoreFactory.Builder snapshotSerializer(@Nonnull org.axonframework.serialization.Serializer snapshotSerializer)
      Sets the Serializer used to serialize and deserialize snapshots.

      Defaults to a XStreamSerializer.

      This object is used by the Axon Server event store's EventStorageEngine implementation.

      Parameters:
      snapshotSerializer - The Serializer used to de-/serialize snapshot events.
      Returns:
      The current Builder instance, for fluent interfacing.
    • eventSerializer

      public AxonServerEventStoreFactory.Builder eventSerializer(@Nonnull org.axonframework.serialization.Serializer eventSerializer)
      Sets the Serializer used to de-/serialize the event payload and meta data with.

      Defaults to a XStreamSerializer.

      This object is used by the Axon Server event store's EventStorageEngine implementation.

      Parameters:
      eventSerializer - The serializer to de-/serialize the event payload and meta data with.
      Returns:
      The current Builder instance, for fluent interfacing.
    • snapshotFilter

      public AxonServerEventStoreFactory.Builder snapshotFilter(@Nonnull org.axonframework.eventsourcing.snapshotting.SnapshotFilter snapshotFilter)
      Sets the SnapshotFilter used to filter snapshots when returning aggregate events.

      When not set all snapshots are used. Note that SnapshotFilter instances can be combined and should return true if they handle a snapshot they wish to ignore.

      This object is used by the Axon Server event store's EventStorageEngine implementation.

      Parameters:
      snapshotFilter - The SnapshotFilter used to filter snapshots when returning aggregate events.
      Returns:
      The current Builder instance, for fluent interfacing.
    • upcasterChain

      public AxonServerEventStoreFactory.Builder upcasterChain(@Nonnull org.axonframework.serialization.upcasting.event.EventUpcaster upcasterChain)
      Sets the upcaster ch ain used to deserialize events of older revisions.

      Defaults to a NoOpEventUpcaster.

      This object is used by the Axon Server event store's EventStorageEngine implementation.

      Parameters:
      upcasterChain - An EventUpcaster used to deserialize events of older revisions.
      Returns:
      The current Builder instance, for fluent interfacing.
    • messageMonitor

      public AxonServerEventStoreFactory.Builder messageMonitor(@Nonnull org.axonframework.monitoring.MessageMonitor<? super org.axonframework.eventhandling.EventMessage<?>> messageMonitor)
      Sets the MessageMonitor to monitor ingested EventMessages.

      Defaults to a NoOpMessageMonitor.

      Parameters:
      messageMonitor - A MessageMonitor to monitor ingested EventMessages.
      Returns:
      The current Builder instance, for fluent interfacing.
    • spanFactory

      public AxonServerEventStoreFactory.Builder spanFactory(@Nonnull org.axonframework.eventhandling.EventBusSpanFactory spanFactory)
      Sets the EventBusSpanFactory implementation used for providing tracing capabilities.

      Defaults to a DefaultEventBusSpanFactory using a NoOpSpanFactory, providing no tracing capabilities.

      Parameters:
      spanFactory - The SpanFactory implementation used for providing tracing capabilities.
      Returns:
      The current Builder instance, for fluent interfacing.
    • build

      Initializes an AxonServerEventStoreFactory as specified through this builder.
      Returns:
      an AxonServerEventStoreFactory as specified through this builder.
    • validate

      protected void validate()
      Validates whether the fields contained in this Builder are set accordingly.
      Throws:
      org.axonframework.common.AxonConfigurationException - If one field is asserted to be incorrect according to the builder's specifications.