| | |
| | | |
| | | 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; |
| | | import static org.opends.server.tools.upgrade.UpgradeUtils.*; |
| | | import static org.opends.server.util.StaticUtils.isClassAvailable; |
| | | |
| | |
| | | @Override |
| | | public void postUpgrade(final UpgradeContext context) throws ClientException |
| | | { |
| | | LocalizableMessage message = null; |
| | | LocalizableMessage message; |
| | | final List<String> args = new LinkedList<>(); |
| | | |
| | | if (isRebuildAllIndexesIsPresent && isRebuildAllIndexesTaskAccepted) |
| | | if (isRebuildAllIndexesTaskAccepted) |
| | | { |
| | | args.add("--rebuildAll"); |
| | | message = INFO_UPGRADE_REBUILD_ALL.get(); |
| | | } |
| | | else if (!indexesToRebuild.isEmpty() |
| | | && !isRebuildAllIndexesTaskAccepted) |
| | | else if (!indexesToRebuild.isEmpty()) |
| | | { |
| | | message = INFO_UPGRADE_REBUILD_INDEX_STARTS.get(indexesToRebuild); |
| | | |
| | |
| | | context.notifyProgress(pnc); |
| | | |
| | | // Sets the arguments like the rebuild index command line. |
| | | args.addAll(Arrays.asList("-f", getConfigLdifFile().getAbsolutePath())); |
| | | args.addAll(Arrays.asList("-f", CONFIG_FILE_PATH)); |
| | | |
| | | /* |
| | | * Index(es) could be contained in several backends or none, If none, |
| | |
| | | |
| | | try |
| | | { |
| | | final File configFile = getConfigLdifFile(); |
| | | |
| | | final Filter filterVal = filter != null ? Filter.valueOf(filter) : null; |
| | | final int changeCount = updateConfigFile( |
| | | configFile.getPath(), filterVal, changeOperationType, ldif); |
| | | |
| | | displayChangeCount(configFile.getPath(), changeCount); |
| | | final int changeCount = updateConfigFile(CONFIG_FILE_PATH, filterVal, changeOperationType, ldif); |
| | | displayChangeCount(CONFIG_FILE_PATH, changeCount); |
| | | |
| | | context.notifyProgress(pnc.setProgress(100)); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private static File getConfigLdifFile() |
| | | { |
| | | return new File(configDirectory, CURRENT_CONFIG_FILE_NAME); |
| | | } |
| | | |
| | | static UpgradeTask clearReplicationDbDirectory() |
| | | { |
| | | return new AbstractUpgradeTask() |