c

akka.serialization.jackson

JacksonMigration

abstract class JacksonMigration extends AnyRef

Data migration of old formats to current format can be implemented in a concrete subclass and configured to be used by the JacksonSerializer for a changed class.

It is used when deserializing data of older version than the JacksonMigration#currentVersion. You implement the transformation of the JSON structure in the JacksonMigration#transform method. If you have changed the class name you should override JacksonMigration#transformClassName and return current class name.

Source
JacksonMigration.scala
Linear Supertypes
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JacksonMigration
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new JacksonMigration()

Abstract Value Members

  1. abstract def currentVersion: Int

    Define current version, that is, the value used when serializing new data.

    Define current version, that is, the value used when serializing new data. The first version, when no migration was used, is always 1.

  2. abstract def transform(fromVersion: Int, json: JsonNode): JsonNode

    Implement the transformation of the old JSON structure to the new JSON structure.

    Implement the transformation of the old JSON structure to the new JSON structure. The JsonNode is mutable so you can add and remove fields, or change values. Note that you have to cast to specific sub-classes such as ObjectNode and ArrayNode to get access to mutators.

    fromVersion

    the version of the old data

    json

    the old JSON data

Concrete Value Members

  1. def supportedForwardVersion: Int

    Define the supported forward version this migration can read (must be greater or equal than currentVersion).

    Define the supported forward version this migration can read (must be greater or equal than currentVersion). If this value is different from currentVersion a JacksonMigration may be required to downcast the received payload to the current schema.

  2. def transformClassName(fromVersion: Int, className: String): String

    Override this method if you have changed the class name.

    Override this method if you have changed the class name. Return current class name.