Class GenericTokenEntry<T>
java.lang.Object
org.axonframework.eventhandling.tokenstore.AbstractTokenEntry<T>
org.axonframework.eventhandling.tokenstore.GenericTokenEntry<T>
- Type Parameters:
T- The serialized data type of the token
Generic implementation of a token entry.
- Author:
- Rene de Waele
-
Field Summary
Fields inherited from class org.axonframework.eventhandling.tokenstore.AbstractTokenEntry
clock -
Constructor Summary
ConstructorsConstructorDescriptionGenericTokenEntry(TrackingToken token, Serializer serializer, Class<T> contentType, String processorName, int segment) Initializes a new token entry for giventoken,processandsegment.GenericTokenEntry(T token, String tokenType, String timestamp, String owner, String processorName, int segment, Class<T> contentType) Initializes a token entry from existing data. -
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the process to which this token belongs.intReturns the segment index of the process to which this token belongs.voidupdateToken(TrackingToken token, Serializer serializer) Update this entry with the giventoken, serializing it using givenserializer.Methods inherited from class org.axonframework.eventhandling.tokenstore.AbstractTokenEntry
claim, getOwner, getSerializedToken, getToken, getTokenType, mayClaim, releaseClaim, timestamp, timestampAsString, updateToken
-
Constructor Details
-
GenericTokenEntry
public GenericTokenEntry(TrackingToken token, Serializer serializer, Class<T> contentType, String processorName, int segment) Initializes a new token entry for giventoken,processandsegment. The givenserializercan be used to serialize the token before it is stored.- Parameters:
token- The tracking token to storeserializer- The serializer to use when storing a serialized tokencontentType- The content type after serializationprocessorName- The name of the processor to which this token belongssegment- The segment of the processor to which this token belongs
-
GenericTokenEntry
public GenericTokenEntry(T token, String tokenType, String timestamp, String owner, String processorName, int segment, Class<T> contentType) Initializes a token entry from existing data.- Parameters:
token- the serialized tokentokenType- the serialized type of the tokentimestamp- the timestamp of the tokenowner- the owner of the tokenprocessorName- The name of the processor to which this token belongssegment- The segment of the processor to which this token belongscontentType- The content type after serialization
-
-
Method Details
-
getProcessorName
Description copied from class:AbstractTokenEntryReturns the name of the process to which this token belongs.- Specified by:
getProcessorNamein classAbstractTokenEntry<T>- Returns:
- the process name
-
getSegment
public int getSegment()Description copied from class:AbstractTokenEntryReturns the segment index of the process to which this token belongs.- Specified by:
getSegmentin classAbstractTokenEntry<T>- Returns:
- the segment index
-
updateToken
Description copied from class:AbstractTokenEntryUpdate this entry with the giventoken, serializing it using givenserializer.- Specified by:
updateTokenin classAbstractTokenEntry<T>- Parameters:
token- The token to update the entry withserializer- The serializer to serialize data with
-