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 Type
    Method
    Description
    static @Nullable Class<? extends TrackingToken>
    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 4 tokenType, or null if it is not a known Axon Framework 4 token name.
    deserialize(Converter converter, byte[] token, String tokenType)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Deserializes the given token bytes into a TrackingToken, resolving the target class from the given tokenType.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • currentTypeFor

      public static @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 4 tokenType, or null if 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 null if unknown
    • deserialize

      public static TrackingToken deserialize(Converter converter, byte[] token, String tokenType)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Deserializes the given token bytes into a TrackingToken, resolving the target class from the given tokenType. 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 with
      token - the serialized token bytes
      tokenType - the token class name read from the store
      Returns:
      the deserialized tracking token
      Since:
      5.2.0