java.lang.Object
java.lang.Enum<Phase>
org.eclipse.emf.cdo.server.db.evolution.phased.Phase
All Implemented Interfaces:
Serializable, Comparable<Phase>, Constable

public enum Phase extends Enum<Phase>
Phases in the model evolution process.

Each phase is associated with a specific trigger that causes its execution. Furthermore, each phase defines the possible transitions to subsequent phases via the transitionTo() method.

The phases are executed in the following order:

  1. ChangeDetection
  2. RepositoryExport
  3. SchemaMigration
  4. StoreProcessing
  5. RepositoryProcessing
Since:
4.14
Author:
Eike Stepper
No Implement
This package is currently considered provisional.
No Extend
This package is currently considered provisional.
No Reference
This package is currently considered provisional.
  • Enum Constant Details

    • ChangeDetection

      public static final Phase ChangeDetection
      The change detection phase identifies model changes between the stored models and the currently registered EPackages.

      This phase is triggered by the activating store event.

      From this phase, transitions are possible to:

      The change detection phase is always the initial phase in the model evolution process. It is also the only phase that can be cancelled, for example, if no model changes are detected.

    • RepositoryExport

      public static final Phase RepositoryExport
      The repository export phase exports the current repository data to the evolution folder before any schema migration takes place.

      This phase is triggered by the activated repository event. At this point in time, the repository is fully configured and active. The repository's package registry is filled with the old models.

      From this phase, a transition is possible to:

      The repository export phase, if applicable, is always the second phase in the model evolution process. It is only executed if model changes were detected during the change detection phase and a phase handler was registered for this phase.

    • SchemaMigration

      public static final Phase SchemaMigration
      The schema migration phase migrates the database schema to match the currently registered EPackages. It also performs any necessary data migrations, such as updating the cdo_feature columns when feature IDs have changed or updating enum literal values when enum literals have changed.

      This phase is triggered by the activating store event.

      From this phase, transitions are possible to:

      The schema migration phase is always executed (i.e., a phase handler must be registered for it) when model changes were detected during the change detection phase.

    • StoreProcessing

      public static final Phase StoreProcessing
      The store processing phase processes the DB store after the schema migration has taken place. This phase is typically used to perform any necessary adjustments to the stored data to ensure consistency with the new schema.

      This phase is triggered by the activating store event. At this point in time, the DB store is fully configured, but not yet active. The repository's package registry is filled with the new models. The store's mapping registry has been updated to match the new models.

      From this phase, a transition is possible to:

      The store processing phase is only executed if a phase handler was registered for it.

    • RepositoryProcessing

      public static final Phase RepositoryProcessing
      The repository processing phase processes the repository after the schema migration has taken place. This phase is typically used to perform any necessary adjustments to the repository data.

      This phase is triggered by the activated repository event. At this point in time, the repository is fully configured and active. The repository's package registry is filled with the new models.

      This is the terminal phase in the model evolution process. It is only executed if a phase handler was registered for it.

  • Method Details

    • values

      public static Phase[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Phase valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • initial

      public boolean initial()
      Returns true if this is the initial phase in the model evolution process. The initial phase is always ChangeDetection.
    • next

      public Phase next()
      Returns the next phase in the model evolution process, or null if this is the terminal phase. The terminal phase is always RepositoryProcessing.
    • trigger

      Returns the trigger that causes the execution of this phase.
    • transitionTo

      public Phase.Transition transitionTo(Phase nextPhase)
      Returns the transition to the given nextPhase, or null if no such transition exists.
    • getTransitionTo

      protected abstract Phase.Transition getTransitionTo(Phase nextPhase)
    • init

      public void init(Context context)
      Called before executing a phase handler.
    • done

      public void done(Context context)
      Called after executing a phase handler.
    • parse

      public static Phase parse(String str)
      Parses the given string into a Phase.