de.deepamehta.core.impl
Class MigrationManager

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.impl.MigrationManager

 class MigrationManager
extends Object


Nested Class Summary
private  class MigrationManager.MigrationInfo
          Collects the info required to run a migration.
private static class MigrationManager.MigrationRunMode
           
 
Field Summary
private static String CORE_MIGRATIONS_PACKAGE
           
private  EmbeddedService dms
           
private  Logger logger
           
private static int REQUIRED_CORE_MIGRATION
           
 
Constructor Summary
MigrationManager(EmbeddedService dms)
           
 
Method Summary
private  void createAssociations(org.codehaus.jettison.json.JSONArray assocs)
           
private  void createAssociationTypes(org.codehaus.jettison.json.JSONArray assocTypes)
           
private  void createTopics(org.codehaus.jettison.json.JSONArray topics)
           
private  void createTopicTypes(org.codehaus.jettison.json.JSONArray topicTypes)
           
private  void injectServices(Migration migration, String migrationInfo, PluginImpl plugin)
           
private  void readEntities(org.codehaus.jettison.json.JSONArray entities)
           
private  void readEntities(org.codehaus.jettison.json.JSONObject entities)
           
private  void readMigrationFile(InputStream in, String migrationFileName)
          Creates types and topics from a JSON formatted input stream.
private  void runCoreMigration(int migrationNr, boolean isCleanInstall)
           
(package private)  void runCoreMigrations(boolean isCleanInstall)
          Determines the core migrations to be run and run them.
private  void runMigration(int migrationNr, PluginImpl plugin, boolean isCleanInstall)
          Runs a core migration or a plugin migration.
private  void runPluginMigration(PluginImpl plugin, int migrationNr, boolean isCleanInstall)
           
(package private)  void runPluginMigrations(PluginImpl plugin, boolean isCleanInstall)
          Determines the migrations to be run for the specified plugin and run them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORE_MIGRATIONS_PACKAGE

private static final String CORE_MIGRATIONS_PACKAGE
See Also:
Constant Field Values

REQUIRED_CORE_MIGRATION

private static final int REQUIRED_CORE_MIGRATION
See Also:
Constant Field Values

dms

private EmbeddedService dms

logger

private Logger logger
Constructor Detail

MigrationManager

MigrationManager(EmbeddedService dms)
Method Detail

runPluginMigrations

void runPluginMigrations(PluginImpl plugin,
                         boolean isCleanInstall)
Determines the migrations to be run for the specified plugin and run them.


runCoreMigrations

void runCoreMigrations(boolean isCleanInstall)
Determines the core migrations to be run and run them.


runCoreMigration

private void runCoreMigration(int migrationNr,
                              boolean isCleanInstall)

runPluginMigration

private void runPluginMigration(PluginImpl plugin,
                                int migrationNr,
                                boolean isCleanInstall)

runMigration

private void runMigration(int migrationNr,
                          PluginImpl plugin,
                          boolean isCleanInstall)
Runs a core migration or a plugin migration.

Parameters:
migrationNr - Number of the migration to run.
plugin - The plugin that provides the migration to run. null for a core migration.
isCleanInstall - true if the migration is run as part of a clean install, false if the migration is run as part of an update.

injectServices

private void injectServices(Migration migration,
                            String migrationInfo,
                            PluginImpl plugin)

readMigrationFile

private void readMigrationFile(InputStream in,
                               String migrationFileName)
Creates types and topics from a JSON formatted input stream.

Parameters:
migrationFileName - The origin migration file. Used for logging only.

readEntities

private void readEntities(org.codehaus.jettison.json.JSONArray entities)
                   throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException

readEntities

private void readEntities(org.codehaus.jettison.json.JSONObject entities)
                   throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException

createTopicTypes

private void createTopicTypes(org.codehaus.jettison.json.JSONArray topicTypes)
                       throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException

createAssociationTypes

private void createAssociationTypes(org.codehaus.jettison.json.JSONArray assocTypes)
                             throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException

createTopics

private void createTopics(org.codehaus.jettison.json.JSONArray topics)
                   throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException

createAssociations

private void createAssociations(org.codehaus.jettison.json.JSONArray assocs)
                         throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException


Copyright © 2015. All Rights Reserved.