public static class JdbcTokenStore.Builder extends Object
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 and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
JdbcTokenStore |
build()
Initializes a
JdbcTokenStore as specified through this Builder. |
JdbcTokenStore.Builder |
claimTimeout(TemporalAmount claimTimeout)
Sets the
claimTimeout specifying the amount of time this process will wait after which this process
will force a claim of a TrackingToken . |
JdbcTokenStore.Builder |
connectionProvider(ConnectionProvider connectionProvider)
Sets the
ConnectionProvider used to provide connections to the underlying database. |
JdbcTokenStore.Builder |
contentType(Class<?> contentType)
Sets the
contentType to which a TrackingToken should be serialized. |
JdbcTokenStore.Builder |
nodeId(String nodeId)
Sets the
nodeId to identify ownership of the tokens. |
JdbcTokenStore.Builder |
schema(TokenSchema schema)
Sets the
schema which describes a JDBC token entry for this TokenStore . |
JdbcTokenStore.Builder |
serializer(Serializer serializer)
Sets the
Serializer used to de-/serialize TrackingToken s with. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public JdbcTokenStore.Builder connectionProvider(ConnectionProvider connectionProvider)
ConnectionProvider
used to provide connections to the underlying database.connectionProvider
- a ConnectionProvider
used to provide connections to the underlying databasepublic JdbcTokenStore.Builder serializer(Serializer serializer)
Serializer
used to de-/serialize TrackingToken
s with.serializer
- a Serializer
used to de-/serialize TrackingToken
s withpublic JdbcTokenStore.Builder schema(TokenSchema schema)
schema
which describes a JDBC token entry for this TokenStore
. Defaults to a default
TokenSchema
instance.schema
- a TokenSchema
which describes a JDBC token entry for this TokenStore
public JdbcTokenStore.Builder claimTimeout(TemporalAmount claimTimeout)
claimTimeout
specifying the amount of time this process will wait after which this process
will force a claim of a TrackingToken
. Thus if a claim has not been updated for the given
claimTimeout
, this process will 'steal' the claim. Defaults to a duration of 10 seconds.claimTimeout
- a timeout specifying the time after which this process will force a claimpublic JdbcTokenStore.Builder nodeId(String nodeId)
nodeId
to identify ownership of the tokens. Defaults to the name of the managed bean for
the runtime system of the Java virtual machinenodeId
- the id as a String
to identify ownership of the tokenspublic JdbcTokenStore.Builder contentType(Class<?> contentType)
contentType
to which a TrackingToken
should be serialized. Defaults to a
byte[]
Class
type.contentType
- the content type as a Class
to which a TrackingToken
should be serializedpublic JdbcTokenStore build()
JdbcTokenStore
as specified through this Builder.JdbcTokenStore
as specified through this Builderprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2019. All rights reserved.