public class MongoTokenStore extends Object implements org.axonframework.eventhandling.tokenstore.TokenStore
| Constructor and Description |
|---|
MongoTokenStore(MongoTemplate mongoTemplate,
org.axonframework.serialization.Serializer serializer)
Creates a MongoTokenStore with a default claim timeout of 10 seconds, a default owner identifier and a default
content type.
|
MongoTokenStore(MongoTemplate mongoTemplate,
org.axonframework.serialization.Serializer serializer,
TemporalAmount claimTimeout,
String nodeId,
Class<?> contentType)
Creates a MongoTokenStore by using the given values.
|
| Modifier and Type | Method and Description |
|---|---|
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.eventsourcing.eventstore.TrackingToken |
fetchToken(String processorName,
int segment) |
void |
initializeTokenSegments(String processorName,
int segmentCount) |
void |
initializeTokenSegments(String processorName,
int segmentCount,
org.axonframework.eventsourcing.eventstore.TrackingToken initialToken) |
void |
releaseClaim(String processorName,
int segment) |
void |
storeToken(org.axonframework.eventsourcing.eventstore.TrackingToken token,
String processorName,
int segment) |
public MongoTokenStore(MongoTemplate mongoTemplate, org.axonframework.serialization.Serializer serializer)
mongoTemplate - used to access the collection in which tracking tokens are storedserializer - serializer used to serialize tracking tokenspublic MongoTokenStore(MongoTemplate mongoTemplate, org.axonframework.serialization.Serializer serializer, TemporalAmount claimTimeout, String nodeId, Class<?> contentType)
mongoTemplate - used to access the collection in which tracking tokens are storedserializer - serializer used to serialize TrackingTokenclaimTimeout - the amount of time after which a claim is automatically releasednodeId - the owner identifier that this token store usescontentType - the data type of the serialized tracking tokenpublic void storeToken(org.axonframework.eventsourcing.eventstore.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.eventsourcing.eventstore.TrackingToken initialToken) throws org.axonframework.eventhandling.tokenstore.UnableToClaimTokenException
initializeTokenSegments in interface org.axonframework.eventhandling.tokenstore.TokenStoreorg.axonframework.eventhandling.tokenstore.UnableToClaimTokenExceptionpublic org.axonframework.eventsourcing.eventstore.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 int[] fetchSegments(String processorName)
fetchSegments in interface org.axonframework.eventhandling.tokenstore.TokenStore@Deprecated public void ensureIndexes()
Copyright © 2010–2019. All rights reserved.