Class JdbcTokenStore.Builder
java.lang.Object
org.axonframework.eventhandling.tokenstore.jdbc.JdbcTokenStore.Builder
- Enclosing class:
JdbcTokenStore
Builder class to instantiate a
JdbcTokenStore.
The schema is defaulted to an TokenSchema, the claimTimeout to a 10 seconds duration,
nodeId is defaulted to the name of the managed bean for the runtime system of the Java virtual machine
and the contentType to a byte[] Class. The ConnectionProvider and
Serializer are hard requirements and as such should be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aJdbcTokenStoreas specified through this Builder.claimTimeout(TemporalAmount claimTimeout) Sets theclaimTimeoutspecifying the amount of time this process will wait after which this process will force a claim of aTrackingToken.connectionProvider(ConnectionProvider connectionProvider) Sets theConnectionProviderused to provide connections to the underlying database.contentType(Class<?> contentType) Sets thecontentTypeto which aTrackingTokenshould be serialized.Sets thenodeIdto identify ownership of the tokens.schema(TokenSchema schema) Sets theschemawhich describes a JDBC token entry for thisTokenStore.serializer(Serializer serializer) Sets theSerializerused to de-/serializeTrackingTokens with.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
connectionProvider
Sets theConnectionProviderused to provide connections to the underlying database.- Parameters:
connectionProvider- aConnectionProviderused to provide connections to the underlying database- Returns:
- the current Builder instance, for fluent interfacing
-
serializer
Sets theSerializerused to de-/serializeTrackingTokens with.- Parameters:
serializer- aSerializerused to de-/serializeTrackingTokens with- Returns:
- the current Builder instance, for fluent interfacing
-
schema
Sets theschemawhich describes a JDBC token entry for thisTokenStore. Defaults to a defaultTokenSchemainstance.- Parameters:
schema- aTokenSchemawhich describes a JDBC token entry for thisTokenStore- Returns:
- the current Builder instance, for fluent interfacing
-
claimTimeout
Sets theclaimTimeoutspecifying the amount of time this process will wait after which this process will force a claim of aTrackingToken. Thus if a claim has not been updated for the givenclaimTimeout, this process will 'steal' the claim. Defaults to a duration of 10 seconds.- Parameters:
claimTimeout- a timeout specifying the time after which this process will force a claim- Returns:
- the current Builder instance, for fluent interfacing
-
nodeId
Sets thenodeIdto identify ownership of the tokens. Defaults to the name of the managed bean for the runtime system of the Java virtual machine- Parameters:
nodeId- the id as aStringto identify ownership of the tokens- Returns:
- the current Builder instance, for fluent interfacing
-
contentType
Sets thecontentTypeto which aTrackingTokenshould be serialized. Defaults to abyte[]Classtype.- Parameters:
contentType- the content type as aClassto which aTrackingTokenshould be serialized- Returns:
- the current Builder instance, for fluent interfacing
-
build
Initializes aJdbcTokenStoreas specified through this Builder.- Returns:
- a
JdbcTokenStoreas 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
-