mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
09.12.2015 f2ed2687b95fc639e35208731e0968957b9204f6
OPENDJ-2054: Remove dsframework tool during 2.6.x to 2.8.0 upgrade
4 files modified
46 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/Upgrade.java 7 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java 31 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/messages/org/opends/messages/tool.properties 1 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/Upgrade.java
@@ -51,6 +51,8 @@
import static org.opends.server.tools.upgrade.FormattedNotificationCallback.*;
import static org.opends.server.tools.upgrade.LicenseFile.*;
import static org.opends.server.tools.upgrade.UpgradeTasks.*;
import static org.opends.server.tools.upgrade.UpgradeUtils.batDirectory;
import static org.opends.server.tools.upgrade.UpgradeUtils.binDirectory;
/**
 * This class contains the table of upgrade tasks that need performing when
@@ -398,6 +400,11 @@
            "(objectclass=ds-cfg-root-config)",
            "delete: ds-cfg-entry-cache-preload"));
    /** See OPENDJ-2054 */
    register("2.8.0.12451",
        deleteFile(new File(binDirectory, "dsframework")),
        deleteFile(new File(batDirectory, "dsframework.bat")));
    /*
     * All upgrades will refresh the server configuration schema and generate
     * a new upgrade folder.
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeTasks.java
@@ -737,6 +737,37 @@
    };
  }
  /**
   * Removes the specified file from the file-system.
   *
   * @param file
   *          The file to be removed.
   * @return An upgrade task which removes the specified file from the file-system.
   */
  public static UpgradeTask deleteFile(final File file)
  {
    return new AbstractUpgradeTask()
    {
      @Override
      public void perform(UpgradeContext context) throws ClientException
      {
        LocalizableMessage msg = UPGRADE_TASK_DELETE_FILE.get(file);
        ProgressNotificationCallback pnc = new ProgressNotificationCallback(0, msg, 0);
        context.notifyProgress(pnc);
        try
        {
          FileManager.deleteRecursively(file);
          context.notifyProgress(pnc.setProgress(100));
        }
        catch (Exception e)
        {
          logger.error(LocalizableMessage.raw(e.getMessage()));
          context.notifyProgress(pnc.setProgress(-1));
        }
      }
    };
  }
  private static void displayChangeCount(final String fileName,
      final int changeCount)
  {
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeUtils.java
@@ -31,7 +31,6 @@
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.forgerock.opendj.ldap.*;
import org.forgerock.opendj.ldap.requests.AddRequest;
import org.forgerock.opendj.ldap.requests.ModifyRequest;
@@ -92,6 +91,12 @@
      configDirectory + File.separator + Installation.SNMP_PATH_RELATIVE
          + File.separator + Installation.SECURITY_PATH_RELATIVE);
  /** The bin folder of the current installation. */
  static final File binDirectory = new File(getInstallationPath(), Installation.UNIX_BINARIES_PATH_RELATIVE);
  /** The bat folder of the current installation. */
  static final File batDirectory = new File(getInstallationPath(), Installation.WINDOWS_BINARIES_PATH_RELATIVE);
  /**
   * Returns the path of the installation of the directory server. Note that
   * this method assumes that this code is being run locally.
opendj-server-legacy/src/messages/org/opends/messages/tool.properties
@@ -2649,6 +2649,7 @@
REF_SHORT_DESC_UPGRADE_15028=upgrade OpenDJ configuration and application data
REF_SHORT_DESC_VERIFY_INDEX_15029=check index for consistency or errors
REF_SHORT_DESC_WINDOWS_SERVICE_15030=register OpenDJ as a Windows Service
UPGRADE_TASK_DELETE_FILE_10035=Removing file '%s'
# Supplements to descriptions for generated reference documentation.
SUPPLEMENT_DESCRIPTION_DBTEST_SUBCMD_LIST_INDEX_STATUS_20001=\