| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2013-2015 ForgeRock AS |
| | | * Portions Copyright 2013-2016 ForgeRock AS |
| | | */ |
| | | package org.opends.server.tools.upgrade; |
| | | |
| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.core.LockFileManager; |
| | | import org.opends.server.util.BuildVersion; |
| | | import org.opends.server.util.StaticUtils; |
| | | |
| | | import com.forgerock.opendj.cli.ClientException; |
| | | import com.forgerock.opendj.cli.ReturnCode; |
| | |
| | | public boolean shouldPerformUpgradeTasks(UpgradeContext context) throws ClientException { |
| | | return !isOEMVersion(); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "!isOEMVersion"; |
| | | } |
| | | }, |
| | | migrateLocalDBBackendsToJEBackends(), |
| | | modifyConfigEntry(INFO_UPGRADE_TASK_MIGRATE_JE_SUMMARY_2.get(), |
| | |
| | | public boolean shouldPerformUpgradeTasks(UpgradeContext context) throws ClientException { |
| | | return isOEMVersion(); |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "isOEMVersion"; |
| | | } |
| | | }, |
| | | deleteFile(new File(libDirectory, "je.jar")), |
| | | requireConfirmation(INFO_UPGRADE_TASK_LOCAL_DB_TO_PDB_1_SUMMARY.get(), NO, |
| | |
| | | private static void changeBuildInfoVersion(final UpgradeContext context) |
| | | throws ClientException |
| | | { |
| | | FileWriter buildInfo = null; |
| | | try |
| | | File buildInfoFile = new File(UpgradeUtils.configDirectory, Installation.BUILDINFO_RELATIVE_PATH); |
| | | try (FileWriter buildInfo = new FileWriter(buildInfoFile, false)) |
| | | { |
| | | buildInfo = |
| | | new FileWriter(new File(UpgradeUtils.configDirectory, Installation.BUILDINFO_RELATIVE_PATH), false); |
| | | |
| | | // Write the new version |
| | | buildInfo.write(context.getToVersion().toString()); |
| | |
| | | context.notify(message, ERROR_CALLBACK); |
| | | throw new ClientException(ReturnCode.ERROR_UNEXPECTED, message); |
| | | } |
| | | finally |
| | | { |
| | | StaticUtils.close(buildInfo); |
| | | } |
| | | } |
| | | |
| | | private static void checkLicence(final UpgradeContext context) |
| | |
| | | } |
| | | } |
| | | } |
| | | catch (SecurityException se) |
| | | catch (SecurityException e) |
| | | { |
| | | logger.debug(LocalizableMessage.raw(se.getMessage())); |
| | | logger.debug(LocalizableMessage.raw(e.getMessage()), e); |
| | | } |
| | | } |
| | | |