Class DefaultDeadLetterStatementFactory.Builder<E extends EventMessage<?>>
java.lang.Object
org.axonframework.eventhandling.deadletter.jdbc.DefaultDeadLetterStatementFactory.Builder<E>
- Type Parameters:
E- An implementation ofEventMessagewithin theDeadLetterthis factory constructsPreparedStatementsfor.
- Enclosing class:
DefaultDeadLetterStatementFactory<E extends EventMessage<?>>
protected static class DefaultDeadLetterStatementFactory.Builder<E extends EventMessage<?>>
extends Object
Builder class to instantiate a
DefaultDeadLetterStatementFactory.
The schema is defaulted to a DeadLetterSchema.defaultSchema().
The generic Serializer and
event Serializer are hard requirements and should be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aDefaultDeadLetterStatementFactoryas specified through this Builder.eventSerializer(Serializer eventSerializer) Sets theSerializerto serialize theevent payload,MetaData, anddiagnosticsof theDeadLetterwhen storing it to a database.genericSerializer(Serializer genericSerializer) Sets theSerializerto serialize theTrackingTokenof aTrackedEventMessageinstance in theDeadLetterwhen storing it to the database.schema(DeadLetterSchema schema) Sets the givenschemaused to define the table and column names used when constructing allPreparedStatements.protected voidvalidate()Validate whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
schema
Sets the givenschemaused to define the table and column names used when constructing allPreparedStatements. Defaults to aDeadLetterSchema.defaultSchema().- Parameters:
schema- TheDeadLetterSchemaused to define the table and column names used when constructing allPreparedStatements.- Returns:
- The current Builder, for fluent interfacing.
-
genericSerializer
Sets theSerializerto serialize theTrackingTokenof aTrackedEventMessageinstance in theDeadLetterwhen storing it to the database.- Parameters:
genericSerializer- The serializer to use forTrackingTokensin aTrackedEventMessage.- Returns:
- The current Builder, for fluent interfacing.
-
eventSerializer
Sets theSerializerto serialize theevent payload,MetaData, anddiagnosticsof theDeadLetterwhen storing it to a database.- Parameters:
eventSerializer- The serializer to use forevent payloads,MetaDatainstances, anddiagnostics.- Returns:
- The current Builder, for fluent interfacing.
-
build
Initializes aDefaultDeadLetterStatementFactoryas specified through this Builder.- Returns:
- A
DefaultDeadLetterStatementFactoryas specified through this Builder.
-
validate
protected void validate()Validate whether the fields contained in this Builder are set accordingly.- Throws:
AxonConfigurationException- When one field asserts to be incorrect according to the Builder's specifications.
-