class MigrationManager extends Object
| Modifier and Type | Class and Description |
|---|---|
private class |
MigrationManager.MigrationInfo
Collects the info required to run a migration.
|
private static class |
MigrationManager.MigrationRunMode |
| Modifier and Type | Field and Description |
|---|---|
private static String |
CORE_MIGRATIONS_PACKAGE |
private static int |
CORE_MODEL_VERSION |
private CoreServiceImpl |
dmx |
private Logger |
logger |
private ModelFactory |
mf |
| Constructor and Description |
|---|
MigrationManager(CoreServiceImpl dmx) |
| Modifier and Type | Method and Description |
|---|---|
private void |
_runMigration(MigrationManager.MigrationInfo mi,
boolean isCleanInstall)
Runs a migration.
|
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.
|
(package private) void |
runCoreMigrations(boolean isCleanInstall)
Determines the core migrations to be run, and runs them.
|
private void |
runMigration(int migrationNr,
PluginImpl plugin,
boolean isCleanInstall)
Collects the info needed to run a migration, runs it, and then updates the version number in the DB.
|
(package private) void |
runPluginMigrations(PluginImpl plugin,
boolean isCleanInstall)
Determines the migrations to be run for the specified plugin, and runs them.
|
private void |
updateVersionNumber(MigrationManager.MigrationInfo mi) |
private static final String CORE_MIGRATIONS_PACKAGE
private static final int CORE_MODEL_VERSION
private CoreServiceImpl dmx
private ModelFactory mf
MigrationManager(CoreServiceImpl dmx)
void runPluginMigrations(PluginImpl plugin, boolean isCleanInstall)
void runCoreMigrations(boolean isCleanInstall)
private void runMigration(int migrationNr, PluginImpl plugin, boolean isCleanInstall)
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.private void _runMigration(MigrationManager.MigrationInfo mi, boolean isCleanInstall) throws Exception
Exceptionprivate void updateVersionNumber(MigrationManager.MigrationInfo mi)
private void injectServices(Migration migration, String migrationInfo, PluginImpl plugin)
private void readMigrationFile(InputStream in, String migrationFileName)
migrationFileName - The origin migration file. Used for logging only.private void readEntities(org.codehaus.jettison.json.JSONArray entities) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONExceptionprivate void readEntities(org.codehaus.jettison.json.JSONObject entities) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONExceptionprivate void createTopicTypes(org.codehaus.jettison.json.JSONArray topicTypes) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONExceptionprivate void createAssociationTypes(org.codehaus.jettison.json.JSONArray assocTypes) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONExceptionprivate void createTopics(org.codehaus.jettison.json.JSONArray topics) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONExceptionprivate void createAssociations(org.codehaus.jettison.json.JSONArray assocs) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONExceptionCopyright © 2018. All Rights Reserved.