Class LegacyTokenTypes
java.lang.Object
org.axonframework.messaging.eventhandling.processing.streaming.token.store.LegacyTokenTypes
@Internal
@Deprecated(since="5.2.0",
forRemoval=true)
public final class LegacyTokenTypes
extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Temporary bridge for reading Axon Framework 4 token stores after upgrading. Scheduled for removal in
5.5.0, once existing stores have migrated to the Axon Framework 5 token class names.
Maps Axon Framework 4
TrackingToken class names to their Axon Framework 5 counterparts, so a token store
written by Axon Framework 4 can be read after upgrading. Reading yields an Axon Framework 5 token, so the next save
stores the new name and the store migrates itself.
Modules that ship their own tracking token add its mapping through LegacyTokenTypeMapper, which is discovered
with ServiceLoader.
Marked Internal because it exists purely as a migration bridge for upgrading applications: it is invoked by
the token stores while reading, never by application code, and its mapping table is the only thing keeping an Axon
Framework 4 store readable. The set of mapped names may change between releases as tokens are added or as the
migration window for older stores closes, so callers must not depend on it.
- Since:
- 5.2.0
- Author:
- Laura Devriendt
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable Class<? extends TrackingToken> currentTypeFor(String tokenType) Deprecated, for removal: This API element is subject to removal in a future version.Returns the Axon Framework 5 token class for the given Axon Framework 4tokenType, ornullif it is not a known Axon Framework 4 token name.static TrackingTokendeserialize(Converter converter, byte[] token, String tokenType) Deprecated, for removal: This API element is subject to removal in a future version.Deserializes the giventokenbytes into aTrackingToken, resolving the target class from the giventokenType.
-
Method Details
-
currentTypeFor
Deprecated, for removal: This API element is subject to removal in a future version.Returns the Axon Framework 5 token class for the given Axon Framework 4tokenType, ornullif it is not a known Axon Framework 4 token name.- Parameters:
tokenType- the token class name read from the store- Returns:
- the matching Axon Framework 5 token class, or
nullif unknown
-
deserialize
Deprecated, for removal: This API element is subject to removal in a future version.Deserializes the giventokenbytes into aTrackingToken, resolving the target class from the giventokenType. A known Axon Framework 4 token name is remapped to its Axon Framework 5 counterpart before deserializing; any other name is loaded as-is.- Parameters:
converter- the converter to deserialize the token withtoken- the serialized token bytestokenType- the token class name read from the store- Returns:
- the deserialized tracking token
- Since:
- 5.2.0
-