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 |
dm4 |
private Logger |
logger |
private ModelFactory |
mf |
Constructor and Description |
---|
MigrationManager(CoreServiceImpl dm4) |
Modifier and Type | Method and Description |
---|---|
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 runs 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 runs them.
|
private static final String CORE_MIGRATIONS_PACKAGE
private static final int CORE_MODEL_VERSION
private CoreServiceImpl dm4
private ModelFactory mf
MigrationManager(CoreServiceImpl dm4)
void runPluginMigrations(PluginImpl plugin, boolean isCleanInstall)
void runCoreMigrations(boolean isCleanInstall)
private void runCoreMigration(int migrationNr, boolean isCleanInstall)
private void runPluginMigration(PluginImpl plugin, int migrationNr, 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 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.JSONException
private void readEntities(org.codehaus.jettison.json.JSONObject entities) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONException
private void createTopicTypes(org.codehaus.jettison.json.JSONArray topicTypes) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONException
private void createAssociationTypes(org.codehaus.jettison.json.JSONArray assocTypes) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONException
private void createTopics(org.codehaus.jettison.json.JSONArray topics) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONException
private void createAssociations(org.codehaus.jettison.json.JSONArray assocs) throws org.codehaus.jettison.json.JSONException
org.codehaus.jettison.json.JSONException
Copyright © 2017. All Rights Reserved.