| | |
| | | |
| | | import static javax.security.auth.callback.ConfirmationCallback.NO; |
| | | import static javax.security.auth.callback.ConfirmationCallback.YES; |
| | | import static javax.security.auth.callback.TextOutputCallback.*; |
| | | |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.server.tools.upgrade.FileManager.copy; |
| | | import static org.opends.server.tools.upgrade.Installation.CURRENT_CONFIG_FILE_NAME; |
| | |
| | | final LocalizableMessage msg = INFO_UPGRADE_TASK_REPLACE_SCHEMA_FILE.get(fileName); |
| | | logger.debug(msg); |
| | | |
| | | final ProgressNotificationCallback pnc = |
| | | new ProgressNotificationCallback(0, msg, 0); |
| | | final ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, msg, 0); |
| | | |
| | | final File schemaFileTemplate = |
| | | new File(templateConfigSchemaDirectory, fileName); |
| | |
| | | final LocalizableMessage msg = INFO_UPGRADE_TASK_ADD_CONFIG_FILE.get(fileName); |
| | | logger.debug(msg); |
| | | |
| | | final ProgressNotificationCallback pnc = |
| | | new ProgressNotificationCallback(0, msg, 0); |
| | | final ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, msg, 0); |
| | | |
| | | final File configFile = new File(templateConfigDirectory, fileName); |
| | | |
| | |
| | | { |
| | | logger.debug(summary); |
| | | |
| | | final ProgressNotificationCallback pnc = |
| | | new ProgressNotificationCallback(0, summary, 20); |
| | | final ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, summary, 20); |
| | | context.notifyProgress(pnc); |
| | | |
| | | final File schemaFileTemplate = |
| | |
| | | { |
| | | logger.debug(summary); |
| | | |
| | | final ProgressNotificationCallback pnc = |
| | | new ProgressNotificationCallback(0, summary, 20); |
| | | final ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, summary, 20); |
| | | context.notifyProgress(pnc); |
| | | |
| | | final File schemaFileTemplate = |
| | |
| | | { |
| | | logger.debug(summary); |
| | | |
| | | final ProgressNotificationCallback pnc = new ProgressNotificationCallback(0, summary, 50); |
| | | final ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, summary, 50); |
| | | context.notifyProgress(pnc); |
| | | |
| | | int returnValue = JavaPropertiesTool.mainCLI("--quiet"); |
| | |
| | | return; |
| | | } |
| | | // Startup message. |
| | | ProgressNotificationCallback pnc = |
| | | new ProgressNotificationCallback(0, message, 25); |
| | | ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, message, 25); |
| | | logger.debug(message); |
| | | context.notifyProgress(pnc); |
| | | |
| | |
| | | final LocalizableMessage msg = INFO_UPGRADE_TASK_REFRESH_UPGRADE_DIRECTORY.get(); |
| | | logger.debug(msg); |
| | | |
| | | final ProgressNotificationCallback pnc = new ProgressNotificationCallback(0, msg, 20); |
| | | final ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, msg, 20); |
| | | context.notifyProgress(pnc); |
| | | |
| | | try |
| | |
| | | final File snmpDir = UpgradeUtils.configSnmpSecurityDirectory; |
| | | if (snmpDir.exists()) |
| | | { |
| | | ProgressNotificationCallback pnc = |
| | | new ProgressNotificationCallback(0, summary, 0); |
| | | ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, summary, 0); |
| | | try |
| | | { |
| | | final File oldSnmpConfig = new File(snmpDir, "opends-snmp.security"); |
| | |
| | | public void perform(UpgradeContext context) throws ClientException |
| | | { |
| | | LocalizableMessage msg = UPGRADE_TASK_DELETE_FILE.get(file); |
| | | ProgressNotificationCallback pnc = new ProgressNotificationCallback(0, msg, 0); |
| | | ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, msg, 0); |
| | | context.notifyProgress(pnc); |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.error(LocalizableMessage.raw(e.getMessage())); |
| | | context.notifyProgress(pnc.setProgress(-1)); |
| | | manageTaskException(context, LocalizableMessage.raw(e.getMessage()), pnc); |
| | | } |
| | | } |
| | | }; |
| | |
| | | backends.add(backend); |
| | | } |
| | | } catch (IOException e) { |
| | | throw new ClientException(ReturnCode.APPLICATION_ERROR, |
| | | INFO_UPGRADE_TASK_MIGRATE_JE_CONFIG_READ_FAIL.get(), e); |
| | | throw new ClientException(ReturnCode.APPLICATION_ERROR, INFO_UPGRADE_TASK_MIGRATE_CONFIG_READ_FAIL.get(), e); |
| | | } |
| | | } |
| | | |
| | |
| | | for (DN baseDN : backend.baseDNs) { |
| | | final String oldName = oldName(baseDN); |
| | | if (!existingDatabases.contains(oldName)) { |
| | | throw new ClientException(ReturnCode.CONSTRAINT_VIOLATION, |
| | | INFO_UPGRADE_TASK_MIGRATE_JE_UGLY_DN.get(backend.id, baseDN)); |
| | | LocalizableMessage msg = INFO_UPGRADE_TASK_MIGRATE_JE_UGLY_DN.get(backend.id, baseDN); |
| | | throw new ClientException(ReturnCode.CONSTRAINT_VIOLATION, msg); |
| | | } |
| | | } |
| | | } |
| | |
| | | for (Backend backend : backends) { |
| | | if (backend.isEnabled) { |
| | | ProgressNotificationCallback pnc = new ProgressNotificationCallback( |
| | | 0, INFO_UPGRADE_TASK_MIGRATE_JE_SUMMARY_1.get(backend.id), 0); |
| | | INFORMATION, INFO_UPGRADE_TASK_MIGRATE_JE_SUMMARY_1.get(backend.id), 0); |
| | | context.notifyProgress(pnc); |
| | | try { |
| | | JEHelper.migrateDatabases(backend.envDir, backend.renamedDbs); |
| | |
| | | } else { |
| | | // Skip backends which have been disabled. |
| | | final ProgressNotificationCallback pnc = new ProgressNotificationCallback( |
| | | 0, INFO_UPGRADE_TASK_MIGRATE_JE_SUMMARY_5.get(backend.id), 0); |
| | | INFORMATION, INFO_UPGRADE_TASK_MIGRATE_JE_SUMMARY_5.get(backend.id), 0); |
| | | context.notifyProgress(pnc); |
| | | context.notifyProgress(pnc.setProgress(100)); |
| | | } |
| | |
| | | { |
| | | displayTaskLogInformation(summary.toString(), filter, ldif); |
| | | |
| | | final ProgressNotificationCallback pnc = |
| | | new ProgressNotificationCallback(0, summary, 20); |
| | | |
| | | final ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, summary, 20); |
| | | context.notifyProgress(pnc); |
| | | |
| | | try |
| | |
| | | } |
| | | |
| | | LocalizableMessage msg = INFO_UPGRADE_TASK_DELETE_CHANGELOG_SUMMARY.get(replicationDbDir); |
| | | ProgressNotificationCallback pnc = |
| | | new ProgressNotificationCallback(0, msg, 0); |
| | | ProgressNotificationCallback pnc = new ProgressNotificationCallback(INFORMATION, msg, 0); |
| | | context.notifyProgress(pnc); |
| | | try |
| | | { |