public class MongoTokenStore extends Object implements org.axonframework.eventhandling.tokenstore.TokenStore
| Modifier and Type | Class and Description |
|---|---|
static class |
MongoTokenStore.Builder
Builder class to instantiate a
MongoTokenStore. |
| Modifier | Constructor and Description |
|---|---|
protected |
MongoTokenStore(MongoTokenStore.Builder builder)
Instantiate a
MongoTokenStore based on the fields contained in the MongoTokenStore.Builder. |
| Modifier and Type | Method and Description |
|---|---|
static MongoTokenStore.Builder |
builder()
Instantiate a Builder to be able to create a
MongoTokenStore. |
void |
deleteToken(String processorName,
int segment) |
void |
ensureIndexes()
Deprecated.
this method is now called by the constructor instead of the dependency injection framework running
the @PostConstruct. i.e. You no longer have to call it manually if you don't use a dependency injection
framework.
|
void |
extendClaim(String processorName,
int segment) |
int[] |
fetchSegments(String processorName) |
org.axonframework.eventhandling.TrackingToken |
fetchToken(String processorName,
int segment) |
void |
initializeSegment(org.axonframework.eventhandling.TrackingToken token,
String processorName,
int segment) |
void |
initializeTokenSegments(String processorName,
int segmentCount) |
void |
initializeTokenSegments(String processorName,
int segmentCount,
org.axonframework.eventhandling.TrackingToken initialToken) |
void |
releaseClaim(String processorName,
int segment) |
boolean |
requiresExplicitSegmentInitialization() |
Optional<String> |
retrieveStorageIdentifier() |
void |
storeToken(org.axonframework.eventhandling.TrackingToken token,
String processorName,
int segment) |
protected MongoTokenStore(MongoTokenStore.Builder builder)
MongoTokenStore based on the fields contained in the MongoTokenStore.Builder.
Will assert that the MongoTemplate and Serializer are not null, and will throw an AxonConfigurationException if any of them is null.
builder - the MongoTokenStore.Builder used to instantiate a MongoTokenStore instancepublic static MongoTokenStore.Builder builder()
MongoTokenStore.
The claimTimeout is defaulted to a 10 seconds duration (by using Duration.ofSeconds(long), nodeId is defaulted to the ManagementFactory#getRuntimeMXBean#getName output and the contentType
to a byte[] Class. The MongoTemplate and Serializer are
hard requirements and as such should be provided.
MongoTokenStorepublic void storeToken(org.axonframework.eventhandling.TrackingToken token,
String processorName,
int segment)
throws org.axonframework.eventhandling.tokenstore.UnableToClaimTokenException
storeToken in interface org.axonframework.eventhandling.tokenstore.TokenStoreorg.axonframework.eventhandling.tokenstore.UnableToClaimTokenExceptionpublic void initializeTokenSegments(String processorName, int segmentCount) throws org.axonframework.eventhandling.tokenstore.UnableToClaimTokenException
initializeTokenSegments in interface org.axonframework.eventhandling.tokenstore.TokenStoreorg.axonframework.eventhandling.tokenstore.UnableToClaimTokenExceptionpublic void initializeTokenSegments(String processorName, int segmentCount, org.axonframework.eventhandling.TrackingToken initialToken) throws org.axonframework.eventhandling.tokenstore.UnableToClaimTokenException
initializeTokenSegments in interface org.axonframework.eventhandling.tokenstore.TokenStoreorg.axonframework.eventhandling.tokenstore.UnableToClaimTokenExceptionpublic org.axonframework.eventhandling.TrackingToken fetchToken(String processorName, int segment) throws org.axonframework.eventhandling.tokenstore.UnableToClaimTokenException
fetchToken in interface org.axonframework.eventhandling.tokenstore.TokenStoreorg.axonframework.eventhandling.tokenstore.UnableToClaimTokenExceptionpublic void extendClaim(String processorName, int segment) throws org.axonframework.eventhandling.tokenstore.UnableToClaimTokenException
extendClaim in interface org.axonframework.eventhandling.tokenstore.TokenStoreorg.axonframework.eventhandling.tokenstore.UnableToClaimTokenExceptionpublic void releaseClaim(String processorName, int segment)
releaseClaim in interface org.axonframework.eventhandling.tokenstore.TokenStorepublic void initializeSegment(org.axonframework.eventhandling.TrackingToken token,
String processorName,
int segment)
throws org.axonframework.eventhandling.tokenstore.UnableToInitializeTokenException
initializeSegment in interface org.axonframework.eventhandling.tokenstore.TokenStoreorg.axonframework.eventhandling.tokenstore.UnableToInitializeTokenExceptionpublic void deleteToken(String processorName, int segment) throws org.axonframework.eventhandling.tokenstore.UnableToClaimTokenException
deleteToken in interface org.axonframework.eventhandling.tokenstore.TokenStoreorg.axonframework.eventhandling.tokenstore.UnableToClaimTokenExceptionpublic boolean requiresExplicitSegmentInitialization()
requiresExplicitSegmentInitialization in interface org.axonframework.eventhandling.tokenstore.TokenStorepublic int[] fetchSegments(String processorName)
fetchSegments in interface org.axonframework.eventhandling.tokenstore.TokenStorepublic Optional<String> retrieveStorageIdentifier() throws org.axonframework.eventhandling.tokenstore.UnableToRetrieveIdentifierException
retrieveStorageIdentifier in interface org.axonframework.eventhandling.tokenstore.TokenStoreorg.axonframework.eventhandling.tokenstore.UnableToRetrieveIdentifierException@Deprecated public void ensureIndexes()
Copyright © 2010–2021. All rights reserved.