migration.isConfigurationCustomized()) {
try {
LOG.log(Level.INFO, "starting server");
setCurrentProgressStep(
UpgradeProgressStep.PREPARING_CUSTOMIZATIONS);
InProcessServerController ipsc =
new InProcessServerController(getInstallation());
InProcessServerController.disableConnectionHandlers(true);
InProcessServerController.disableAdminDataSynchronization(true);
InProcessServerController.disableSynchronization(true);
ipsc.startServer();
LOG.log(Level.INFO, "start server finished");
notifyListeners(getFormattedDoneWithLineBreak());
} catch (Exception e) {
LOG.log(Level.INFO,
"Error starting server in order to apply custom" +
"schema and/or configuration", e);
throw new ApplicationException(
ReturnCode.APPLICATION_ERROR,
INFO_ERROR_STARTING_SERVER.get(), e);
}
checkAbort();
if (migration.isSchemaCustomized()) {
try {
LOG.log(Level.INFO, "Applying schema customizations");
setCurrentProgressStep(
UpgradeProgressStep.APPLYING_SCHEMA_CUSTOMIZATIONS);
migration.migrateSchema();
notifyListeners(getFormattedDoneWithLineBreak());
LOG.log(Level.INFO, "custom schema application finished");
} catch (ApplicationException e) {
LOG.log(Level.INFO,
"Error applying schema customizations", e);
throw e;
}
}
checkAbort();
if (migration.isConfigurationCustomized()) {
try {
LOG.log(Level.INFO, "Applying config customizations");
setCurrentProgressStep(
UpgradeProgressStep.APPLYING_CONFIGURATION_CUSTOMIZATIONS);
migration.migrateConfiguration();
notifyListeners(getFormattedDoneWithLineBreak());
LOG.log(Level.INFO, "custom config application finished");
} catch (ApplicationException e) {
LOG.log(Level.INFO,
"Error applying configuration customizations", e);
throw e;
}
}
checkAbort();
if (migration.mustMigrateADS())
{
try {
LOG.log(Level.INFO, "Applying registration changes");
if (isVerbose())
{
setCurrentProgressStep(
UpgradeProgressStep.APPLYING_ADS_CUSTOMIZATIONS);
}
migration.migrateADS(
getStagedInstallation().getADSBackendFile());
if (isVerbose())
{
notifyListeners(getFormattedDone());
}
LOG.log(Level.INFO, "custom registration application finished");
} catch (ApplicationException e) {
LOG.log(Level.INFO,
"Error applying registration customizations", e);
throw e;
}
}
checkAbort();
if (migration.mustMigrateToolProperties())
{
try {
LOG.log(Level.INFO, "Applying tools properties");
migration.migrateToolPropertiesFile(
getStagedInstallation().getToolsPropertiesFile());
LOG.log(Level.INFO, "tools properties application finished");
} catch (ApplicationException e) {
LOG.log(Level.INFO,
"Error applying tools properties changes", e);
throw e;
}
}
if (migration.mustRunDSJavaProperties())
{
try {
LOG.log(Level.INFO, "Upgrading script with java properties");
// Launch the script
String propertiesFile = new File(
getInstallation().getConfigurationDirectory(),
Installation.DEFAULT_JAVA_PROPERTIES_FILE).getAbsolutePath();
String setJavaFile =
getInstallation().getSetJavaHomeFile().getAbsolutePath();
String[] args =
{
"--propertiesFile", propertiesFile,
"--destinationFile", setJavaFile,
"--quiet"
};
int returnValue = JavaPropertiesTool.mainCLI(args);
if ((returnValue !=
JavaPropertiesTool.ErrorReturnCode.SUCCESSFUL.getReturnCode()) &&
returnValue !=
JavaPropertiesTool.ErrorReturnCode.SUCCESSFUL_NOP.getReturnCode())
{
throw new ApplicationException(ReturnCode.APPLICATION_ERROR,
ERR_ERROR_CREATING_JAVA_HOME_SCRIPTS.get(returnValue), null);
}
LOG.log(Level.INFO, "scripts successfully upgraded");
} catch (ApplicationException e) {
LOG.log(Level.INFO,
"Error upgrading scripts", e);
throw e;
}
}
checkAbort();
try {
LOG.log(Level.INFO, "stopping server");
// This class imports classes from the server
if (isVerbose())
{
notifyListeners(INFO_PROGRESS_UPGRADE_INTERNAL_STOP.get());
}
new InProcessServerController(
getInstallation()).stopServer();
InProcessServerController.disableConnectionHandlers(false);
if (isVerbose())
{
notifyListeners(getFormattedDone());