opends/build.xml
@@ -77,13 +77,13 @@ <property name="quicksetup.src.dir" location="src/quicksetup" /> <property name="quicksetup.classes.dir" location="${build.dir}/quicksetup/classes" /> <property name="quicksetup.globalcompile.classes.dir" location="${classes.dir}/org/opends/quicksetup" /> <property name="ads.src.dir" location="src/ads" /> <property name="ads.class.dir" location="${classes.dir}/org/opends/admin/ads"/> <property name="ads.classes.dir" location="${classes.dir}/org/opends/admin/ads"/> <!-- Properties for use with the Status Panel. --> <property name="statuspanel.src.dir" location="src/statuspanel" /> <property name="statuspanel.classes.dir" location="${build.dir}/statuspanel/classes" /> <!-- Properties for use with the GUI Tools that go in OpenDS jar. --> <property name="guitools.src.dir" location="src/guitools" /> <!-- Properties for coverage diff reports --> <property name="cvgdiff.dir" location="build/diff" /> @@ -391,7 +391,7 @@ <checkstyle config="${checkstyle.dir}/opends-checkstyle.xml" failOnViolation="true"> <fileset dir="${statuspanel.src.dir}" includes="**/*.java" /> <fileset dir="${guitools.src.dir}" includes="**/*.java" /> <formatter type="plain" /> </checkstyle> @@ -422,7 +422,7 @@ <!-- Compile the Directory Server source files. --> <target name="cleancompile" depends="cleaninit,compilequicksetup,weave,compilestatuspanel" depends="cleaninit,compilequicksetup,weave" description="Recompile the Directory Server source files."> </target> @@ -433,7 +433,7 @@ description="Compile the Directory Server source files."> <mkdir dir="${classes.dir}" /> <javac srcdir="${src.dir}:${admin.src.dir}:${ads.src.dir}" destdir="${classes.dir}" <javac srcdir="${src.dir}:${admin.src.dir}:${ads.src.dir}:${quicksetup.src.dir}:${guitools.src.dir}" destdir="${classes.dir}" excludes="**/package-info.java" debug="on" debuglevel="${build.debuglevel}" source="1.5" target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}" @@ -444,11 +444,16 @@ <fileset dir="${lib.dir}"> <include name="*.jar" /> </fileset> <fileset dir="${build.dir}/build-tools"> <include name="build-tools.jar" /> </fileset> </classpath> </javac> <copy todir="${classes.dir}"> <fileset dir="${src.dir}" includes="**/*.properties" /> <fileset dir="${quicksetup.src.dir}" includes="**/*.properties, **/*.gif, **/*.png" /> <fileset dir="${guitools.src.dir}" includes="**/*.properties, **/*.gif, **/*.png" /> </copy> </target> @@ -462,7 +467,7 @@ <target name="weave" if="weave.enabled" depends="compilestatuspanel, prepweave"> <target name="weave" if="weave.enabled" depends="prepweave"> <echo message=" Weaving the source code with automatic AspectJ debug logging."/> <echo message=" Build with -DWEAVE_ENABLED=false to turn this off."/> <taskdef resource="org/aspectj/tools/ant/taskdefs/aspectjTaskdefs.properties"> @@ -530,30 +535,6 @@ </target> <!-- Compile the Status Panel source files. --> <target name="compilestatuspanel" depends="compilequicksetup" description="Compile the Status Panel source files."> <mkdir dir="${statuspanel.classes.dir}" /> <javac srcdir="${statuspanel.src.dir}" destdir="${statuspanel.classes.dir}" debug="on" debuglevel="${build.debuglevel}" source="1.5" target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}" memoryMaximumSize="${MEM}"> <compilerarg value="-Xlint:all" /> <classpath> <pathelement path="${classes.dir}"/> <pathelement path="${quicksetup.classes.dir}"/> </classpath> </javac> <copy todir="${statuspanel.classes.dir}"> <fileset dir="${statuspanel.src.dir}" includes="**/*.properties, **/*.gif, **/*.png" /> </copy> </target> <!-- ! Rebuild the Directory Server without destroying any existing configuration ! or data. It will only overwrite the libraries, classes, and scripts, and @@ -591,14 +572,13 @@ <delete file="${pdir}.zip" /> <delete dir="${quicksetup.classes.dir}" /> <delete file="${package.dir}/lib/quicksetup.jar" /> <delete file="${package.dir}/lib/statuspanel.jar" /> <!-- Regenerate configuration files if necessary --> <antcall target="compileadmin" /> <!-- Recreate the classes directory and recompile into it. --> <mkdir dir="${classes.dir}" /> <javac srcdir="${src.dir}:${admin.src.dir}:${ads.src.dir}" <javac srcdir="${src.dir}:${admin.src.dir}:${ads.src.dir}:${quicksetup.src.dir}:${guitools.src.dir}" destdir="${classes.dir}" debug="on" debuglevel="${build.debuglevel}" source="1.5" target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}" @@ -609,16 +589,23 @@ <fileset dir="${lib.dir}"> <include name="*.jar" /> </fileset> <fileset dir="${build.dir}/build-tools"> <include name="build-tools.jar" /> </fileset> </classpath> </javac> <copy todir="${classes.dir}"> <fileset dir="${src.dir}" includes="**/*.properties" /> <fileset dir="${quicksetup.src.dir}" includes="**/*.properties, **/*.gif, **/*.png" /> <fileset dir="${guitools.src.dir}" includes="**/*.properties, **/*.gif, **/*.png" /> </copy> <!-- Generate the OpenDS.jar file --> <jar jarfile="${pdir}/lib/${SHORT_NAME}.jar" basedir="${classes.dir}" compress="true" index="true" /> basedir="${classes.dir}" excludes="${ads.classes.dir}, ${quicksetup.globalcompile.classes.dir}" compress="true" index="true" /> <!-- Recreate the quicksetup classes directory and recompile into it. --> <mkdir dir="${quicksetup.classes.dir}" /> @@ -668,29 +655,6 @@ <jar jarfile="${pdir}/lib/quicksetup.jar" basedir="${quicksetup.classes.dir}" compress="true" index="true" /> <!-- Recreate the statuspanel classes directory and recompile into it. --> <mkdir dir="${statuspanel.classes.dir}" /> <javac srcdir="${statuspanel.src.dir}" destdir="${statuspanel.classes.dir}" debug="on" debuglevel="${build.debuglevel}" source="1.5" target="1.5" deprecation="true" fork="true" memoryInitialSize="${MEM}" memoryMaximumSize="${MEM}"> <compilerarg value="-Xlint:all" /> <classpath> <fileset dir="${pdir}/lib"> <include name="${SHORT_NAME}.jar" /> </fileset> </classpath> </javac> <copy todir="${statuspanel.classes.dir}"> <fileset dir="${statuspanel.src.dir}" includes="**/*.properties, **/*.gif, **/*.png"/> </copy> <!-- Generate the statuspanel.jar file --> <jar jarfile="${pdir}/lib/statuspanel.jar" basedir="${statuspanel.classes.dir}" compress="true" index="true" /> <!-- Regenerate example plugin. --> <antcall target="example-plugin" /> </target> @@ -724,16 +688,14 @@ <mkdir dir="${pdir}/locks" /> <mkdir dir="${pdir}/logs" /> <delete dir="${ads.class.dir}" /> <jar jarfile="${pdir}/lib/${SHORT_NAME}.jar" basedir="${classes.dir}" compress="true" index="true" /> basedir="${classes.dir}" excludes="${ads.classes.dir}, ${quicksetup.globalcompile.classes.dir}" compress="true" index="true" /> <jar jarfile="${pdir}/lib/quicksetup.jar" basedir="${quicksetup.classes.dir}" compress="true" index="true" /> <jar jarfile="${pdir}/lib/statuspanel.jar" basedir="${statuspanel.classes.dir}" compress="true" index="true" /> <copy todir="${pdir}/lib"> <fileset file="${lib.dir}/*.jar" /> </copy> @@ -1624,7 +1586,7 @@ dirmode="755" /> <zipfileset dir="${quicksetup.src.dir}" excludes="**/.svn" filemode="644" dirmode="755" /> <zipfileset dir="${statuspanel.src.dir}" excludes="**/.svn" filemode="644" <zipfileset dir="${guitools.src.dir}" excludes="**/.svn" filemode="644" dirmode="755" /> </zip> </target> opends/resource/bin/status
@@ -27,7 +27,7 @@ # This script may be used to display the status panel. OPENDS_INVOKE_CLASS="org.opends.statuspanel.StatusCli" OPENDS_INVOKE_CLASS="org.opends.guitools.statuspanel.StatusCli" export OPENDS_INVOKE_CLASS SCRIPT_DIR=`dirname "${0}"` opends/resource/bin/status-panel
@@ -27,7 +27,7 @@ # This script may be used to display the status panel. OPENDS_INVOKE_CLASS="org.opends.statuspanel.StatusPanelLauncher" OPENDS_INVOKE_CLASS="org.opends.guitools.statuspanel.StatusPanelLauncher" export OPENDS_INVOKE_CLASS SCRIPT_DIR=`dirname "${0}"` opends/resource/bin/status-panel.bat
@@ -57,7 +57,7 @@ set PATH=%SystemRoot% "%DIR_HOME%\lib\winlauncher.exe" launch "%JAVA_BIN%" %JAVA_ARGS% org.opends.statuspanel.StatusPanelLauncher %* "%DIR_HOME%\lib\winlauncher.exe" launch "%JAVA_BIN%" %JAVA_ARGS% org.opends.guitools.statuspanel.StatusPanelLauncher %* goto end opends/resource/bin/status.bat
@@ -27,6 +27,6 @@ setlocal set OPENDS_INVOKE_CLASS="org.opends.statuspanel.StatusCli" set OPENDS_INVOKE_CLASS="org.opends.guitools.statuspanel.StatusCli" set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=status" for %%i in (%~sf0) do call "%%~dPsi\..\lib\_server-script.bat" %* opends/resource/uninstall
@@ -117,7 +117,7 @@ # Launch the uninstall process. "${JAVA_BIN}" org.opends.quicksetup.uninstaller.UninstallLauncher "${@}" "${JAVA_BIN}" org.opends.guitools.uninstaller.UninstallLauncher "${@}" RETURN_CODE=$? if test ${RETURN_CODE} -eq 50 @@ -126,4 +126,4 @@ exit 0 else exit ${RETURN_CODE} fi fi opends/resource/uninstall.bat
@@ -72,11 +72,11 @@ goto callJava :callLaunch "%DIR_HOME%\lib\winlauncher.exe" launch "%JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.uninstaller.UninstallLauncher "%DIR_HOME%\lib\winlauncher.exe" launch "%JAVA_BIN%" %JAVA_ARGS% org.opends.guitools.uninstaller.UninstallLauncher goto end :callJava "%JAVA_BIN%" %JAVA_ARGS% org.opends.quicksetup.uninstaller.UninstallLauncher %* "%JAVA_BIN%" %JAVA_ARGS% org.opends.guitools.uninstaller.UninstallLauncher %* rem return part if %errorlevel% == 50 goto version opends/src/ads/org/opends/admin/ads/ServerDescriptor.java
@@ -723,6 +723,9 @@ v = getFirstValue(sr, "ds-cfg-replication-server-id"); desc.serverProperties.put(ServerProperty.REPLICATION_SERVER_ID, Integer.parseInt(v)); Set<String> values = getValues(sr, "ds-cfg-replication-server"); desc.serverProperties.put(ServerProperty.EXTERNAL_REPLICATION_SERVERS, values); } } catch (NameNotFoundException nse) opends/src/ads/org/opends/admin/ads/util/ConnectionUtils.java
@@ -133,6 +133,7 @@ } catch (Throwable t) { t.printStackTrace(); pair[1] = t; } } opends/src/guitools/org/opends/guitools/statuspanel/BaseDNDescriptor.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/BaseDNDescriptor.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import org.opends.quicksetup.util.Utils; opends/src/guitools/org/opends/guitools/statuspanel/ConfigException.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/ConfigException.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; /** opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromFile.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/ConfigFromFile.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import java.io.IOException; import java.util.HashSet; @@ -45,9 +45,9 @@ import org.opends.server.types.Entry; import org.opends.server.types.LDIFImportConfig; import org.opends.server.types.ObjectClass; import org.opends.guitools.i18n.ResourceProvider; import org.opends.quicksetup.util.Utils; import org.opends.quicksetup.Installation; import org.opends.statuspanel.i18n.ResourceProvider; /** * This class is used to retrieve configuration information directly from the opends/src/guitools/org/opends/guitools/statuspanel/ConfigFromLDAP.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/ConfigFromLDAP.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import java.util.HashMap; import java.util.HashSet; @@ -42,8 +42,8 @@ import javax.naming.ldap.InitialLdapContext; import javax.naming.ldap.LdapName; import org.opends.statuspanel.i18n.ResourceProvider; import org.opends.admin.ads.util.ApplicationTrustManager; import org.opends.guitools.i18n.ResourceProvider; import org.opends.quicksetup.util.Utils; /** opends/src/guitools/org/opends/guitools/statuspanel/ConnectionProtocolPolicy.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/ConnectionProtocolPolicy.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; /** Policy to follow to choose the protocol to be used. */ public enum ConnectionProtocolPolicy opends/src/guitools/org/opends/guitools/statuspanel/DatabaseDescriptor.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/DatabaseDescriptor.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import java.util.SortedSet; opends/src/guitools/org/opends/guitools/statuspanel/ListenerDescriptor.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/ListenerDescriptor.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; /** * This class is used to represent a Listener and is aimed to be used by the opends/src/guitools/org/opends/guitools/statuspanel/ServerStatusDescriptor.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/ServerStatusDescriptor.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import java.io.File; import java.util.Set; opends/src/guitools/org/opends/guitools/statuspanel/ServerStatusPooler.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/ServerStatusPooler.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import java.io.File; import java.util.HashSet; @@ -33,11 +33,11 @@ import java.util.logging.Logger; import org.opends.admin.ads.util.ApplicationTrustManager; import org.opends.guitools.i18n.ResourceProvider; import org.opends.guitools.statuspanel.event.ServerStatusChangeEvent; import org.opends.guitools.statuspanel.event.ServerStatusChangeListener; import org.opends.quicksetup.Installation; import org.opends.quicksetup.util.Utils; import org.opends.statuspanel.event.ServerStatusChangeEvent; import org.opends.statuspanel.event.ServerStatusChangeListener; import org.opends.statuspanel.i18n.ResourceProvider; /** opends/src/guitools/org/opends/guitools/statuspanel/SplashScreen.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/SplashScreen.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import javax.swing.SwingUtilities; @@ -65,7 +65,7 @@ try { statusPanelClass = Class.forName( "org.opends.statuspanel.StatusPanelController"); "org.opends.guitools.statuspanel.StatusPanelController"); statusPanel = statusPanelClass.newInstance(); statusPanelClass.getMethod("initialize", new Class[] { String[].class }).invoke(statusPanel, new Object[] opends/src/guitools/org/opends/guitools/statuspanel/StatusCli.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/StatusCli.java @@ -25,7 +25,7 @@ * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import java.io.BufferedReader; import java.io.File; @@ -49,15 +49,15 @@ import org.opends.admin.ads.util.ApplicationKeyManager; import org.opends.admin.ads.util.ApplicationTrustManager; import org.opends.guitools.i18n.ResourceProvider; import org.opends.guitools.statuspanel.ui.DatabasesTableModel; import org.opends.guitools.statuspanel.ui.ListenersTableModel; import org.opends.quicksetup.Installation; import org.opends.quicksetup.QuickSetupLog; import org.opends.quicksetup.util.Utils; import org.opends.server.core.DirectoryServer; import org.opends.statuspanel.i18n.ResourceProvider; import org.opends.statuspanel.ui.DatabasesTableModel; import org.opends.statuspanel.ui.ListenersTableModel; import static org.opends.server.messages.MessageHandler.getMessage; import static org.opends.server.messages.ToolMessages.*; opends/src/guitools/org/opends/guitools/statuspanel/StatusLog.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/StatusLog.java @@ -24,7 +24,7 @@ * * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import java.io.File; import java.io.IOException; opends/src/guitools/org/opends/guitools/statuspanel/StatusPanelController.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/StatusPanelController.java @@ -25,7 +25,7 @@ * Portions Copyright 2006-2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @@ -40,6 +40,12 @@ import org.opends.server.core.DirectoryServer; import org.opends.admin.ads.util.ApplicationTrustManager; import org.opends.guitools.i18n.ResourceProvider; import org.opends.guitools.statuspanel.event.ServerStatusChangeEvent; import org.opends.guitools.statuspanel.event.ServerStatusChangeListener; import org.opends.guitools.statuspanel.event.StatusPanelButtonListener; import org.opends.guitools.statuspanel.ui.LoginDialog; import org.opends.guitools.statuspanel.ui.StatusPanelDialog; import org.opends.quicksetup.Installation; import org.opends.quicksetup.ui.ProgressDialog; import org.opends.quicksetup.ui.UIFactory; @@ -48,12 +54,6 @@ import org.opends.quicksetup.util.HtmlProgressMessageFormatter; import org.opends.quicksetup.util.Utils; import org.opends.statuspanel.event.ServerStatusChangeEvent; import org.opends.statuspanel.event.ServerStatusChangeListener; import org.opends.statuspanel.event.StatusPanelButtonListener; import org.opends.statuspanel.i18n.ResourceProvider; import org.opends.statuspanel.ui.LoginDialog; import org.opends.statuspanel.ui.StatusPanelDialog; /** * This is the main class of the status panel. opends/src/guitools/org/opends/guitools/statuspanel/StatusPanelLauncher.java
File was renamed from opends/src/statuspanel/org/opends/statuspanel/StatusPanelLauncher.java @@ -24,7 +24,7 @@ * * Portions Copyright 2006-2007 Sun Microsystems, Inc. */ package org.opends.statuspanel; package org.opends.guitools.statuspanel; import java.io.ByteArrayOutputStream; import java.io.File; @@ -33,13 +33,13 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.opends.guitools.i18n.ResourceProvider; import org.opends.quicksetup.util.Utils; import org.opends.quicksetup.Installation; import org.opends.server.core.DirectoryServer; import org.opends.server.util.ServerConstants; import org.opends.server.util.args.ArgumentParser; import org.opends.server.util.args.BooleanArgument; import org.opends.statuspanel.i18n.ResourceProvider; import static org.opends.server.messages.ToolMessages.*; import static org.opends.server.tools.ToolConstants.*; opends/src/guitools/org/opends/guitools/uninstaller/UninstallCliHelper.java
File was renamed from opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallCliHelper.java @@ -25,9 +25,9 @@ * Portions Copyright 2006-2007 Sun Microsystems, Inc. */ package org.opends.quicksetup.uninstaller; package org.opends.guitools.uninstaller; import org.opends.guitools.i18n.ResourceProvider; import org.opends.quicksetup.*; import org.opends.quicksetup.util.Utils; @@ -143,6 +143,15 @@ } /** * Gets the resource provider instance. * @return ResourceProvider instance */ protected ResourceProvider getI18n() { return ResourceProvider.getInstance(); } /** * Commodity method used to ask the user to confirm the deletion of certain * parts of the server. It updates the provided UserData object * accordingly. Returns <CODE>true</CODE> if the user cancels and <CODE> @@ -402,5 +411,4 @@ } return confirm; } } opends/src/guitools/org/opends/guitools/uninstaller/UninstallData.java
New file @@ -0,0 +1,111 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at * trunk/opends/resource/legal-notices/OpenDS.LICENSE * or https://OpenDS.dev.java.net/OpenDS.LICENSE. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, * add the following below this CDDL HEADER, with the fields enclosed * by brackets "[]" replaced with your own identifying information: * Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END * * * Portions Copyright 2007 Sun Microsystems, Inc. */ package org.opends.guitools.uninstaller; import java.io.IOException; import java.util.Iterator; import org.opends.admin.ads.ADSContext; import org.opends.quicksetup.Configuration; import org.opends.quicksetup.Installation; import org.opends.quicksetup.util.Utils; /** * This is a convenience class used to represent the current configuraton and * status of the server to know which kind of questions we must ask to the user * (the server is running, it is configured for replication, it contains an * ADS...). * * The difference with Installation class is that it provides read only * information that is computed in the constructor of the class and not * on demand. This way we can construct the object outside the event thread * and then read it inside the event thread without blocking the display. */ public class UninstallData { private boolean isServerRunning; private boolean isADS; private boolean isReplicationServer; private int replicationServerPort; /** * The constructor for UninstallData. * @param installation the object describing the installation. * @throws IOException if there was an error retrieving the current * installation configuration. */ public UninstallData(Installation installation) throws IOException { isServerRunning = installation.getStatus().isServerRunning(); Configuration conf = new Configuration(installation, installation.getCurrentConfigurationFile()); Iterator<String> it = conf.getBaseDNs().iterator(); while (it.hasNext() && !isADS) { isADS = Utils.areDnsEqual(it.next(), ADSContext.getAdministrationSuffixDN()); } isReplicationServer = conf.isReplicationServer(); replicationServerPort = conf.getReplicationPort(); } /** * Returns whether this server is configured as an ADS or not. * @return <CODE>true</CODE> if the server is configured as an ADS and * <CODE>false</CODE> otherwise. */ public boolean isADS() { return isADS; } /** * Returns whether this server is configured as a replication server or not. * @return <CODE>true</CODE> if the server is configured as a replication * server and <CODE>false</CODE> otherwise. */ public boolean isReplicationServer() { return isReplicationServer; } /** * Returns whether this server is running or not. * @return <CODE>true</CODE> if the server is running and <CODE>false</CODE> * otherwise. */ public boolean isServerRunning() { return isServerRunning; } /** * Returns the port of the replication server. -1 if it is not defined. * @return the port of the replication server. -1 if it is not defined. */ public int getReplicationServerPort() { return replicationServerPort; } } opends/src/guitools/org/opends/guitools/uninstaller/UninstallLauncher.java
File was renamed from opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallLauncher.java @@ -25,7 +25,7 @@ * Portions Copyright 2006-2007 Sun Microsystems, Inc. */ package org.opends.quicksetup.uninstaller; package org.opends.guitools.uninstaller; import static org.opends.server.messages.ToolMessages.*; import static org.opends.server.tools.ToolConstants.*; @@ -33,6 +33,7 @@ import java.io.File; import java.util.logging.Logger; import org.opends.guitools.i18n.ResourceProvider; import org.opends.quicksetup.CliApplication; import org.opends.quicksetup.Launcher; import org.opends.quicksetup.Installation; @@ -69,7 +70,9 @@ public static void main(String[] args) { try { QuickSetupLog.initLogFileHandler( File.createTempFile(LOG_FILE_PREFIX, LOG_FILE_SUFFIX)); File.createTempFile(LOG_FILE_PREFIX, LOG_FILE_SUFFIX), "org.opends.guitools.uninstaller"); } catch (Throwable t) { System.err.println("Unable to initialize log"); t.printStackTrace(); @@ -149,7 +152,7 @@ protected void willLaunchGui() { System.out.println(getMsg("uninstall-launcher-launching-gui")); System.setProperty("org.opends.quicksetup.Application.class", "org.opends.quicksetup.uninstaller.Uninstaller"); org.opends.guitools.uninstaller.Uninstaller.class.getName()); } /** @@ -166,4 +169,11 @@ return getI18n().getMsg("frame-uninstall-title"); } /** * {@inheritDoc} */ protected ResourceProvider getI18n() { return ResourceProvider.getInstance(); } } opends/src/guitools/org/opends/guitools/uninstaller/UninstallProgressStep.java
File was renamed from opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallProgressStep.java @@ -25,7 +25,7 @@ * Portions Copyright 2006-2007 Sun Microsystems, Inc. */ package org.opends.quicksetup.uninstaller; package org.opends.guitools.uninstaller; import org.opends.quicksetup.ProgressStep; @@ -40,6 +40,11 @@ NOT_STARTED, /** * Unconfiguring replication in remote servers. */ UNCONFIGURING_REPLICATION, /** * Stopping server. */ STOPPING_SERVER, @@ -75,6 +80,11 @@ FINISHED_SUCCESSFULLY, /** * Installation finished with a non critical error updating remote servers. */ FINISHED_WITH_ERROR_ON_REMOTE, /** * Installation finished with an error. */ FINISHED_WITH_ERROR; @@ -84,7 +94,8 @@ */ public boolean isLast() { return this == FINISHED_SUCCESSFULLY || this == FINISHED_WITH_ERROR; this == FINISHED_WITH_ERROR || this == FINISHED_WITH_ERROR_ON_REMOTE; } /** opends/src/guitools/org/opends/guitools/uninstaller/UninstallUserData.java
File was renamed from opends/src/quicksetup/org/opends/quicksetup/uninstaller/UninstallUserData.java @@ -25,7 +25,7 @@ * Portions Copyright 2006-2007 Sun Microsystems, Inc. */ package org.opends.quicksetup.uninstaller; package org.opends.guitools.uninstaller; import org.opends.quicksetup.UserData; @@ -45,6 +45,7 @@ private boolean removeBackups; private boolean removeLDIFs; private boolean removeConfigurationAndSchema; private boolean updateRemoteReplication; /** * Sets the database directories located outside the installation which must @@ -206,4 +207,25 @@ { return removeConfigurationAndSchema; } /** * Sets whether to update remote replication configuration or not. * @param updateRemoteReplication update remote replication configuration * or not. */ public void setUpdateRemoteReplication(boolean updateRemoteReplication) { this.updateRemoteReplication = updateRemoteReplication; } /** * Returns whether the user wants to update remote replication configuration * or not. * @return <CODE>true</CODE> if the user wants to update remote replication * configuration and <CODE>false</CODE> otherwise. */ public boolean getUpdateRemoteReplication() { return updateRemoteReplication; } } opends/src/guitools/org/opends/guitools/uninstaller/Uninstaller.java
New file @@ -0,0 +1,1958 @@ /* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at * trunk/opends/resource/legal-notices/OpenDS.LICENSE * or https://OpenDS.dev.java.net/OpenDS.LICENSE. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, * add the following below this CDDL HEADER, with the fields enclosed * by brackets "[]" replaced with your own identifying information: * Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END * * * Portions Copyright 2006-2007 Sun Microsystems, Inc. */ package org.opends.guitools.uninstaller; import org.opends.quicksetup.*; import static org.opends.quicksetup.Step.FINISHED; import static org.opends.quicksetup.Step.PROGRESS; import static org.opends.quicksetup.Step.REVIEW; import org.opends.admin.ads.ADSContext; import org.opends.admin.ads.ADSContextException; import org.opends.admin.ads.ReplicaDescriptor; import org.opends.admin.ads.ServerDescriptor; import org.opends.admin.ads.TopologyCache; import org.opends.admin.ads.TopologyCacheException; import org.opends.admin.ads.util.ApplicationTrustManager; import org.opends.guitools.i18n.ResourceProvider; import org.opends.guitools.uninstaller.ui.ConfirmUninstallPanel; import org.opends.guitools.uninstaller.ui.LoginDialog; import org.opends.quicksetup.ui.*; import org.opends.quicksetup.util.Utils; import org.opends.quicksetup.util.BackgroundTask; import org.opends.quicksetup.util.ServerController; import org.opends.server.admin.AttributeTypePropertyDefinition; import org.opends.server.admin.ClassLoaderProvider; import org.opends.server.admin.ClassPropertyDefinition; import org.opends.server.admin.ManagedObjectNotFoundException; import org.opends.server.admin.client.ManagementContext; import org.opends.server.admin.client.ldap.JNDIDirContextAdaptor; import org.opends.server.admin.client.ldap.LDAPManagementContext; import org.opends.server.admin.std.client.MultimasterDomainCfgClient; import org.opends.server.admin.std.client.MultimasterSynchronizationProviderCfgClient; import org.opends.server.admin.std.client.ReplicationServerCfgClient; import org.opends.server.admin.std.client.RootCfgClient; import org.opends.server.core.DirectoryServer; import org.opends.server.tools.ConfigureWindowsService; import java.io.*; import java.net.InetAddress; import java.net.URI; import java.security.cert.X509Certificate; import java.util.*; import java.util.logging.Level; import java.util.logging.Logger; import java.awt.event.WindowEvent; import javax.naming.Context; import javax.naming.directory.SearchControls; import javax.naming.ldap.InitialLdapContext; import javax.swing.JFrame; import javax.swing.SwingUtilities; /** * This class is in charge of performing the uninstallation of Open DS. */ public class Uninstaller extends GuiApplication implements CliApplication { private ProgressStep status = UninstallProgressStep.NOT_STARTED; private boolean runStarted; private boolean errorOnRemoteOccurred; private HashMap<ProgressStep, Integer> hmRatio = new HashMap<ProgressStep, Integer>(); private HashMap<ProgressStep, String> hmSummary = new HashMap<ProgressStep, String>(); private ApplicationException ue; private Boolean isWindowsServiceEnabled; private UninstallCliHelper cliHelper = new UninstallCliHelper(); private static final Logger LOG = Logger.getLogger(Uninstaller.class.getName()); private LoginDialog loginDialog; private ProgressDialog startProgressDlg; private StringBuffer startProgressDetails = new StringBuffer(); private UninstallData conf; private String replicationServerHostPort; private TopologyCache lastLoadedCache; private ApplicationTrustManager trustManager = new ApplicationTrustManager(null); /** * Default constructor. */ public Uninstaller() { super(); /* Do some initialization required to use the administration framework * classes. Note that this is not done in the installer code because * when the basic configuration of the server is performed (using * ConfigureDS) this initialization is done. */ DirectoryServer.bootstrapClient(); // Bootstrap definition classes. try { ClassLoaderProvider.getInstance().enable(); } catch (Throwable t) { LOG.log(Level.WARNING, "Error enabling admin framework class loader: "+t, t); } // Switch off class name validation in client. ClassPropertyDefinition.setAllowClassValidation(false); // Switch off attribute type name validation in client. AttributeTypePropertyDefinition.setCheckSchema(false); } /** * {@inheritDoc} */ public String getFrameTitle() { return getMsg("frame-uninstall-title"); } /** * {@inheritDoc} */ public UserData createUserData() { return new UninstallUserData(); } /** * {@inheritDoc} */ public WizardStep getFirstWizardStep() { return Step.CONFIRM_UNINSTALL; } /** * {@inheritDoc} */ public WizardStep getNextWizardStep(WizardStep step) { Step nextStep = null; if (step != null && step.equals(Step.CONFIRM_UNINSTALL)) { nextStep = Step.PROGRESS; } else if (Step.PROGRESS.equals(step)) { nextStep = Step.FINISHED; } return nextStep; } /** * {@inheritDoc} */ public WizardStep getPreviousWizardStep(WizardStep step) { Step prevStep = null; if (step != null && step.equals(Step.PROGRESS)) { prevStep = Step.CONFIRM_UNINSTALL; } else if (Step.FINISHED.equals(step)) { prevStep = Step.PROGRESS; } return prevStep; } /** * {@inheritDoc} */ public WizardStep getFinishedStep() { return Step.FINISHED; } /** * {@inheritDoc} */ public boolean finishOnLeft() { return false; } /** * {@inheritDoc} */ public boolean canGoBack(WizardStep step) { return false; } /** * {@inheritDoc} */ public boolean canGoForward(WizardStep step) { return false; } /** * {@inheritDoc} */ public boolean canFinish(WizardStep step) { return step == Step.CONFIRM_UNINSTALL; } /** * {@inheritDoc} */ public boolean canQuit(WizardStep step) { return step == Step.CONFIRM_UNINSTALL; } /** * {@inheritDoc} */ public void nextClicked(WizardStep cStep, QuickSetup qs) { if (cStep == PROGRESS) { throw new IllegalStateException( "Cannot click on next from progress step"); } else if (cStep == REVIEW) { throw new IllegalStateException("Cannot click on next from review step"); } else if (cStep == FINISHED) { throw new IllegalStateException( "Cannot click on next from finished step"); } } /** * {@inheritDoc} */ public void closeClicked(WizardStep cStep, QuickSetup qs) { if (cStep == PROGRESS) { if (isFinished() || qs.displayConfirmation(getMsg("confirm-close-uninstall-msg"), getMsg("confirm-close-uninstall-title"))) { qs.quit(); } } else if (cStep == FINISHED) { qs.quit(); } else { throw new IllegalStateException( "Close only can be clicked on PROGRESS step"); } } /** * Update the UserData object according to the content of the review * panel. */ private void updateUserUninstallDataForConfirmUninstallPanel(QuickSetup qs) throws UserDataException { UninstallUserData uud = getUninstallUserData(); uud.setRemoveLibrariesAndTools( (Boolean) qs.getFieldValue(FieldName.REMOVE_LIBRARIES_AND_TOOLS)); uud.setRemoveDatabases( (Boolean) qs.getFieldValue(FieldName.REMOVE_DATABASES)); uud.setRemoveConfigurationAndSchema( (Boolean) qs.getFieldValue( FieldName.REMOVE_CONFIGURATION_AND_SCHEMA)); uud.setRemoveBackups( (Boolean) qs.getFieldValue(FieldName.REMOVE_BACKUPS)); uud.setRemoveLDIFs( (Boolean) qs.getFieldValue(FieldName.REMOVE_LDIFS)); uud.setRemoveLogs( (Boolean) qs.getFieldValue(FieldName.REMOVE_LOGS)); // This is updated on the method handleTopologyCache uud.setUpdateRemoteReplication(false); Set<String> dbs = new HashSet<String>(); Set s = (Set) qs.getFieldValue(FieldName.EXTERNAL_DB_DIRECTORIES); for (Object v : s) { dbs.add((String) v); } Set<String> logs = new HashSet<String>(); s = (Set) qs.getFieldValue(FieldName.EXTERNAL_LOG_FILES); for (Object v : s) { logs.add((String) v); } uud.setExternalDbsToRemove(dbs); uud.setExternalLogsToRemove(logs); if ((dbs.size() == 0) && (logs.size() == 0) && !uud.getRemoveLibrariesAndTools() && !uud.getRemoveDatabases() && !uud.getRemoveConfigurationAndSchema() && !uud.getRemoveBackups() && !uud.getRemoveLDIFs() && !uud.getRemoveLogs()) { throw new UserDataException(Step.CONFIRM_UNINSTALL, getMsg("nothing-selected-to-uninstall")); } } /** * {@inheritDoc} */ public void quitClicked(WizardStep step, QuickSetup qs) { if (step == Step.PROGRESS) { throw new IllegalStateException( "Cannot click on quit from progress step"); } else if (step == Step.FINISHED) { throw new IllegalStateException( "Cannot click on quit from finished step"); } qs.quit(); } /** * {@inheritDoc} */ public String getCloseButtonToolTipKey() { return "close-button-uninstall-tooltip"; } /** * {@inheritDoc} */ public String getFinishButtonToolTipKey() { return "finish-button-uninstall-tooltip"; } /** * {@inheritDoc} */ public String getFinishButtonLabelKey() { return "finish-button-uninstall-label"; } /** * {@inheritDoc} */ public void previousClicked(WizardStep cStep, QuickSetup qs) { if (cStep == PROGRESS) { throw new IllegalStateException( "Cannot click on previous from progress step"); } else if (cStep == FINISHED) { throw new IllegalStateException( "Cannot click on previous from finished step"); } } /** * {@inheritDoc} */ public void notifyListeners(Integer ratio, String currentPhaseSummary, final String newLogDetail) { if (runStarted) { super.notifyListeners(ratio, currentPhaseSummary, newLogDetail); } else { SwingUtilities.invokeLater(new Runnable() { public void run() { if (startProgressDlg != null) { if (newLogDetail != null) { startProgressDetails.append(newLogDetail); startProgressDlg.setDetails(startProgressDetails.toString()); } } } }); } } /** * {@inheritDoc} */ public boolean finishClicked(final WizardStep cStep, final QuickSetup qs) { if (cStep == Step.CONFIRM_UNINSTALL) { BackgroundTask worker = new BackgroundTask() { public Object processBackgroundTask() throws UserDataException { try { updateUserUninstallDataForConfirmUninstallPanel(qs); return new UninstallData(Installation.getLocal()); } catch (UserDataException uude) { throw uude; } catch (Throwable t) { LOG.log(Level.WARNING, "Error processing task: "+t, t); throw new UserDataException(Step.CONFIRM_UNINSTALL, getThrowableMsg("bug-msg", t)); } } public void backgroundTaskCompleted(Object returnValue, Throwable throwable) { qs.getDialog().workerFinished(); if (throwable != null) { if (throwable instanceof UserDataException) { qs.displayError(throwable.getLocalizedMessage(), getMsg("error-title")); } else { LOG.log(Level.WARNING, "Error processing task: "+throwable, throwable); qs.displayError(throwable.toString(), getMsg("error-title")); } } else { conf = (UninstallData)returnValue; if (conf.isADS() && conf.isReplicationServer()) { if (conf.isServerRunning()) { if (qs.displayConfirmation( getMsg("confirm-uninstall-replication-server-running-msg"), getMsg( "confirm-uninstall-replication-server-running-title"))) { askForAuthenticationAndLaunch(qs); } else { if (qs.displayConfirmation( getMsg("confirm-uninstall-server-running-msg"), getMsg("confirm-uninstall-server-running-title"))) { getUserData().setStopServer(true); qs.launch(); qs.setCurrentStep( getNextWizardStep(Step.CONFIRM_UNINSTALL)); } else { getUserData().setStopServer(false); } } } else { if (qs.displayConfirmation( getMsg( "confirm-uninstall-replication-server-not-running-msg"), getMsg( "confirm-uninstall-replication-server-not-running-title" ))) { boolean startWorked = startServer(qs.getDialog().getFrame()); if (startWorked) { askForAuthenticationAndLaunch(qs); } else { getUserData().setStopServer(false); if (qs.displayConfirmation( getMsg("confirm-uninstall-server-not-running-msg"), getMsg("confirm-uninstall-server-not-running-title"))) { qs.launch(); qs.setCurrentStep( getNextWizardStep(Step.CONFIRM_UNINSTALL)); } } } else { getUserData().setStopServer(false); if (qs.displayConfirmation( getMsg("confirm-uninstall-server-not-running-msg"), getMsg("confirm-uninstall-server-not-running-title"))) { qs.launch(); qs.setCurrentStep( getNextWizardStep(Step.CONFIRM_UNINSTALL)); } } } } else if (!conf.isServerRunning()) { getUserData().setStopServer(false); if (qs.displayConfirmation( getMsg("confirm-uninstall-server-not-running-msg"), getMsg("confirm-uninstall-server-not-running-title"))) { qs.launch(); qs.setCurrentStep(getNextWizardStep( Step.CONFIRM_UNINSTALL)); } } else { if (qs.displayConfirmation( getMsg("confirm-uninstall-server-running-msg"), getMsg("confirm-uninstall-server-running-title"))) { getUserData().setStopServer(true); qs.launch(); qs.setCurrentStep(getNextWizardStep( Step.CONFIRM_UNINSTALL)); } else { getUserData().setStopServer(false); } } } } }; qs.getDialog().workerStarted(); worker.startBackgroundTask(); } // Uninstaller is responsible for updating user data and launching return false; } /** * {@inheritDoc} */ public void updateUserData(WizardStep step, QuickSetup qs) { // do nothing; } /** * {@inheritDoc} */ public void setWizardDialogState(QuickSetupDialog dlg, UserData userData, WizardStep step) { if (step == Step.CONFIRM_UNINSTALL) { dlg.setDefaultButton(ButtonName.FINISH); dlg.setFocusOnButton(ButtonName.FINISH); } else if ((step == PROGRESS) || (step == FINISHED)) { dlg.setDefaultButton(ButtonName.CLOSE); dlg.setFocusOnButton(ButtonName.CLOSE); dlg.setButtonEnabled(ButtonName.CLOSE, false); } } /** * {@inheritDoc} * @param launcher */ public UserData createUserData(Launcher launcher) throws UserDataException { return cliHelper.createUserData(launcher.getArguments()); } /** * {@inheritDoc} */ public String getInstallationPath() { return Utils.getInstallPathFromClasspath(); } /** * Returns the ApplicationException that might occur during installation or * <CODE>null</CODE> if no exception occurred. * * @return the ApplicationException that might occur during installation or * <CODE>null</CODE> if no exception occurred. */ public ApplicationException getRunError() { return ue; } /** * Initialize the different map used in this class. */ private void initMaps() { hmSummary.put(UninstallProgressStep.NOT_STARTED, getFormattedSummary(getMsg("summary-uninstall-not-started"))); hmSummary.put(UninstallProgressStep.STOPPING_SERVER, getFormattedSummary(getMsg("summary-stopping"))); hmSummary.put(UninstallProgressStep.UNCONFIGURING_REPLICATION, getFormattedSummary(getMsg("summary-unconfiguring-replication"))); hmSummary.put(UninstallProgressStep.DISABLING_WINDOWS_SERVICE, getFormattedSummary(getMsg("summary-disabling-windows-service"))); hmSummary.put(UninstallProgressStep.DELETING_EXTERNAL_DATABASE_FILES, getFormattedSummary(getMsg("summary-deleting-external-db-files"))); hmSummary.put(UninstallProgressStep.DELETING_EXTERNAL_LOG_FILES, getFormattedSummary(getMsg("summary-deleting-external-log-files"))); hmSummary.put(UninstallProgressStep.REMOVING_EXTERNAL_REFERENCES, getFormattedSummary( getMsg("summary-deleting-external-references"))); hmSummary.put(UninstallProgressStep.DELETING_INSTALLATION_FILES, getFormattedSummary(getMsg("summary-deleting-installation-files"))); String successMsg; Installation installation = getInstallation(); String libPath = Utils.getPath(installation.getLibrariesDirectory()); if (Utils.isCli()) { if (getUninstallUserData().getRemoveLibrariesAndTools()) { String[] arg = new String[1]; if (Utils.isWindows()) { arg[0] = installation.getUninstallBatFile() + getLineBreak() + getTab() + libPath; } else { arg[0] = libPath; } successMsg = getMsg( "summary-uninstall-finished-successfully-remove-jarfiles-cli", arg); } else { successMsg = getMsg("summary-uninstall-finished-successfully-cli"); } } else { if (getUninstallUserData().getRemoveLibrariesAndTools()) { String[] arg = {libPath}; successMsg = getMsg( "summary-uninstall-finished-successfully-remove-jarfiles", arg); } else { successMsg = getMsg("summary-uninstall-finished-successfully"); } } hmSummary.put(UninstallProgressStep.FINISHED_SUCCESSFULLY, getFormattedSuccess(successMsg)); String nonCriticalMsg; if (Utils.isCli()) { nonCriticalMsg = getMsg("summary-uninstall-finished-with-error-on-remote"); } else { nonCriticalMsg = getMsg("summary-uninstall-finished-with-error-on-remote-cli"); } hmSummary.put(UninstallProgressStep.FINISHED_WITH_ERROR_ON_REMOTE, getFormattedWarning(nonCriticalMsg)); hmSummary.put(UninstallProgressStep.FINISHED_WITH_ERROR, getFormattedError(getMsg("summary-uninstall-finished-with-error"))); /* * hmTime contains the relative time that takes for each task to be * accomplished. For instance if stopping takes twice the time of * deleting files, the value for downloading will be the double of the * value for extracting. */ HashMap<UninstallProgressStep, Integer> hmTime = new HashMap<UninstallProgressStep, Integer>(); hmTime.put(UninstallProgressStep.UNCONFIGURING_REPLICATION, 5); hmTime.put(UninstallProgressStep.STOPPING_SERVER, 15); hmTime.put(UninstallProgressStep.DISABLING_WINDOWS_SERVICE, 5); hmTime.put(UninstallProgressStep.DELETING_EXTERNAL_DATABASE_FILES, 30); hmTime.put(UninstallProgressStep.DELETING_EXTERNAL_LOG_FILES, 5); hmTime.put(UninstallProgressStep.REMOVING_EXTERNAL_REFERENCES, 5); hmTime.put(UninstallProgressStep.DELETING_INSTALLATION_FILES, 10); int totalTime = 0; ArrayList<UninstallProgressStep> steps = new ArrayList<UninstallProgressStep>(); if (getUninstallUserData().getUpdateRemoteReplication()) { totalTime += hmTime.get(UninstallProgressStep.UNCONFIGURING_REPLICATION); steps.add(UninstallProgressStep.UNCONFIGURING_REPLICATION); } if (getUserData().getStopServer()) { totalTime += hmTime.get(UninstallProgressStep.STOPPING_SERVER); steps.add(UninstallProgressStep.STOPPING_SERVER); } if (isWindowsServiceEnabled()) { totalTime += hmTime.get(UninstallProgressStep.DISABLING_WINDOWS_SERVICE); steps.add(UninstallProgressStep.DISABLING_WINDOWS_SERVICE); } totalTime += hmTime.get(UninstallProgressStep.DELETING_INSTALLATION_FILES); steps.add(UninstallProgressStep.DELETING_INSTALLATION_FILES); if (getUninstallUserData().getExternalDbsToRemove().size() > 0) { totalTime += hmTime.get( UninstallProgressStep.DELETING_EXTERNAL_DATABASE_FILES); steps.add(UninstallProgressStep.DELETING_EXTERNAL_DATABASE_FILES); } if (getUninstallUserData().getExternalLogsToRemove().size() > 0) { totalTime += hmTime.get( UninstallProgressStep.DELETING_EXTERNAL_LOG_FILES); steps.add(UninstallProgressStep.DELETING_EXTERNAL_LOG_FILES); } int cumulatedTime = 0; for (UninstallProgressStep s : steps) { Integer statusTime = hmTime.get(s); hmRatio.put(s, (100 * cumulatedTime) / totalTime); if (statusTime != null) { cumulatedTime += statusTime; } } hmRatio.put(UninstallProgressStep.FINISHED_SUCCESSFULLY, 100); hmRatio.put(UninstallProgressStep.FINISHED_WITH_ERROR_ON_REMOTE, 100); hmRatio.put(UninstallProgressStep.FINISHED_WITH_ERROR, 100); } /** * Actually performs the uninstall in this thread. The thread is blocked. */ public void run() { runStarted = true; initMaps(); PrintStream origErr = System.err; PrintStream origOut = System.out; try { PrintStream err = new ErrorPrintStream(); PrintStream out = new OutputPrintStream(); if (!Utils.isCli()) { System.setErr(err); System.setOut(out); } boolean displaySeparator = false; if (getUninstallUserData().getUpdateRemoteReplication()) { status = UninstallProgressStep.UNCONFIGURING_REPLICATION; removeRemoteServerReferences(); displaySeparator = true; } if (getUserData().getStopServer()) { status = UninstallProgressStep.STOPPING_SERVER; if (displaySeparator) { notifyListeners(getTaskSeparator()); } new ServerController(this).stopServer(); displaySeparator = true; } if (isWindowsServiceEnabled()) { status = UninstallProgressStep.DISABLING_WINDOWS_SERVICE; if (displaySeparator) { notifyListeners(getTaskSeparator()); } disableWindowsService(); displaySeparator = true; } Set<String> dbsToDelete = getUninstallUserData().getExternalDbsToRemove(); if (dbsToDelete.size() > 0) { status = UninstallProgressStep.DELETING_EXTERNAL_DATABASE_FILES; if (displaySeparator) { notifyListeners(getTaskSeparator()); } deleteExternalDatabaseFiles(dbsToDelete); displaySeparator = true; } Set<String> logsToDelete = getUninstallUserData().getExternalLogsToRemove(); if (logsToDelete.size() > 0) { status = UninstallProgressStep.DELETING_EXTERNAL_LOG_FILES; if (displaySeparator) { notifyListeners(getTaskSeparator()); } deleteExternalLogFiles(logsToDelete); displaySeparator = true; } UninstallUserData userData = getUninstallUserData(); boolean somethingToDelete = userData.getRemoveBackups() || userData.getRemoveConfigurationAndSchema() || userData.getRemoveDatabases() || userData.getRemoveLDIFs() || userData.getRemoveLibrariesAndTools() || userData.getRemoveLogs(); if (displaySeparator && somethingToDelete) { notifyListeners(getTaskSeparator()); } if (somethingToDelete) { status = UninstallProgressStep.DELETING_INSTALLATION_FILES; deleteInstallationFiles(getRatio(status), getRatio(UninstallProgressStep.FINISHED_SUCCESSFULLY)); } if (errorOnRemoteOccurred) { status = UninstallProgressStep.FINISHED_WITH_ERROR_ON_REMOTE; } else { status = UninstallProgressStep.FINISHED_SUCCESSFULLY; } if (Utils.isCli()) { notifyListeners(getLineBreak() + getLineBreak() + getSummary(status)); } else { notifyListeners(null); } } catch (ApplicationException ex) { ue = ex; status = UninstallProgressStep.FINISHED_WITH_ERROR; String msg = getFormattedError(ex, true); notifyListeners(msg); } catch (Throwable t) { ue = new ApplicationException( ApplicationReturnCode.ReturnCode.BUG, getThrowableMsg("bug-msg", t), t); status = UninstallProgressStep.FINISHED_WITH_ERROR; String msg = getFormattedError(ue, true); notifyListeners(msg); } if (!Utils.isCli()) { System.setErr(origErr); System.setOut(origOut); } } /** * {@inheritDoc} */ public ProgressStep getCurrentProgressStep() { return status; } /** * Returns an integer that specifies which percentage of the whole * installation has been completed. * * @param step the UninstallProgressStep for which we want to get the ratio. * @return an integer that specifies which percentage of the whole * uninstallation has been completed. */ public Integer getRatio(ProgressStep step) { return hmRatio.get(step); } /** * Returns an formatted representation of the summary for the specified * UninstallProgressStep. * * @param step the UninstallProgressStep for which we want to get the summary. * @return an formatted representation of the summary for the specified * UninstallProgressStep. */ public String getSummary(ProgressStep step) { return hmSummary.get(step); } /** * {@inheritDoc} */ public boolean isFinished() { return getCurrentProgressStep() == UninstallProgressStep.FINISHED_SUCCESSFULLY || getCurrentProgressStep() == UninstallProgressStep.FINISHED_WITH_ERROR || getCurrentProgressStep() == UninstallProgressStep.FINISHED_WITH_ERROR_ON_REMOTE; } /** * {@inheritDoc} */ public boolean isCancellable() { return false; } /** * {@inheritDoc} */ public void cancel() { // do nothing; not cancellable } /** * {@inheritDoc} */ public void windowClosing(QuickSetupDialog dlg, WindowEvent evt) { if ((dlg.getDisplayedStep() == PROGRESS) || (dlg.getDisplayedStep() == FINISHED)) { // Simulate a close button event dlg.notifyButtonEvent(ButtonName.CLOSE); } else { // Simulate a quit button event dlg.notifyButtonEvent(ButtonName.QUIT); } } /** * {@inheritDoc} */ public ButtonName getInitialFocusButtonName() { return ButtonName.FINISH; } /** * {@inheritDoc} */ public Set<? extends WizardStep> getWizardSteps() { Set<WizardStep> setSteps = new HashSet<WizardStep>(); setSteps.add(Step.CONFIRM_UNINSTALL); setSteps.add(Step.PROGRESS); setSteps.add(Step.FINISHED); return Collections.unmodifiableSet(setSteps); } /** * {@inheritDoc} */ public QuickSetupStepPanel createWizardStepPanel(WizardStep step) { QuickSetupStepPanel p = null; if (step == Step.CONFIRM_UNINSTALL) { p = new ConfirmUninstallPanel(this, installStatus); } else if (step == Step.PROGRESS) { p = new ProgressPanel(this); } else if (step == Step.FINISHED) { p = new FinishedPanel(this); } return p; } /** * Deletes the external database files specified in the provided Set. * * @param dbFiles the database directories to be deleted. * @throws ApplicationException if something goes wrong. */ private void deleteExternalDatabaseFiles(Set<String> dbFiles) throws ApplicationException { notifyListeners(getFormattedProgress( getMsg("progress-deleting-external-db-files")) + getLineBreak()); for (String path : dbFiles) { deleteRecursively(new File(path)); } } /** * Deletes the external database files specified in the provided Set. * * @param logFiles the log files to be deleted. * @throws ApplicationException if something goes wrong. */ private void deleteExternalLogFiles(Set<String> logFiles) throws ApplicationException { notifyListeners(getFormattedProgress( getMsg("progress-deleting-external-log-files")) + getLineBreak()); for (String path : logFiles) { deleteRecursively(new File(path)); } } /** * Deletes the files under the installation path. * * @throws ApplicationException if something goes wrong. */ private void deleteInstallationFiles(int minRatio, int maxRatio) throws ApplicationException { notifyListeners(getFormattedProgress( getMsg("progress-deleting-installation-files")) + getLineBreak()); File f = new File(Utils.getInstallPathFromClasspath()); InstallationFilesToDeleteFilter filter = new InstallationFilesToDeleteFilter(); File[] rootFiles = f.listFiles(); if (rootFiles != null) { /* The following is done to have a moving progress bar when we delete * the installation files. */ int totalRatio = 0; ArrayList<Integer> cumulatedRatio = new ArrayList<Integer>(); for (int i = 0; i < rootFiles.length; i++) { if (filter.accept(rootFiles[i])) { Installation installation = getInstallation(); int relativeRatio; if (equalsOrDescendant(rootFiles[i], installation.getLibrariesDirectory())) { relativeRatio = 10; } else if (equalsOrDescendant(rootFiles[i], installation.getBinariesDirectory())) { relativeRatio = 5; } else if (equalsOrDescendant(rootFiles[i], installation.getConfigurationDirectory())) { relativeRatio = 5; } else if (equalsOrDescendant(rootFiles[i], installation.getBackupDirectory())) { relativeRatio = 20; } else if (equalsOrDescendant(rootFiles[i], installation.getLdifDirectory())) { relativeRatio = 20; } else if (equalsOrDescendant(rootFiles[i], installation.getDatabasesDirectory())) { relativeRatio = 50; } else if (equalsOrDescendant(rootFiles[i], installation.getLogsDirectory())) { relativeRatio = 30; } else { relativeRatio = 2; } cumulatedRatio.add(totalRatio); totalRatio += relativeRatio; } else { cumulatedRatio.add(totalRatio); } } Iterator<Integer> it = cumulatedRatio.iterator(); for (int i = 0; i < rootFiles.length; i++) { int beforeRatio = minRatio + ((it.next() * (maxRatio - minRatio)) / totalRatio); hmRatio.put(UninstallProgressStep.DELETING_INSTALLATION_FILES, beforeRatio); deleteRecursively(rootFiles[i], filter); } hmRatio.put(UninstallProgressStep.DELETING_INSTALLATION_FILES, maxRatio); } } /** * Deletes everything below the specified file. * * @param file the path to be deleted. * @throws ApplicationException if something goes wrong. */ private void deleteRecursively(File file) throws ApplicationException { deleteRecursively(file, null); } /** * Deletes everything below the specified file. * * @param file the path to be deleted. * @param filter the filter of the files to know if the file can be deleted * directly or not. * @throws ApplicationException if something goes wrong. */ private void deleteRecursively(File file, FileFilter filter) throws ApplicationException { if (file.exists()) { if (file.isFile()) { if (filter != null) { if (filter.accept(file)) { delete(file); } } else { delete(file); } } else { File[] children = file.listFiles(); if (children != null) { for (int i = 0; i < children.length; i++) { deleteRecursively(children[i], filter); } } if (filter != null) { if (filter.accept(file)) { delete(file); } } else { delete(file); } } } else { // Just tell that the file/directory does not exist. String[] arg = {file.toString()}; notifyListeners(getFormattedWarning( getMsg("progress-deleting-file-does-not-exist", arg))); } } /** * Deletes the specified file. * * @param file the file to be deleted. * @throws ApplicationException if something goes wrong. */ private void delete(File file) throws ApplicationException { String[] arg = {file.getAbsolutePath()}; boolean isFile = file.isFile(); if (isFile) { notifyListeners(getFormattedWithPoints( getMsg("progress-deleting-file", arg))); } else { notifyListeners(getFormattedWithPoints( getMsg("progress-deleting-directory", arg))); } boolean delete = false; /* * Sometimes the server keeps some locks on the files. * This is dependent on the OS so there is no much we can do here. */ int nTries = 5; for (int i = 0; i < nTries && !delete; i++) { delete = file.delete(); if (!delete) { try { Thread.sleep(1000); } catch (Exception ex) { } } } if (!delete) { String errMsg; if (isFile) { errMsg = getMsg("error-deleting-file", arg); } else { errMsg = getMsg("error-deleting-directory", arg); } throw new ApplicationException( ApplicationReturnCode.ReturnCode.FILE_SYSTEM_ACCESS_ERROR, errMsg, null); } notifyListeners(getFormattedDone() + getLineBreak()); } private boolean equalsOrDescendant(File file, File directory) { return file.equals(directory) || Utils.isDescendant(file, directory); } /** * This class is used to get the files that are not binaries. This is * required to know which are the files that can be deleted directly and which * not. */ class InstallationFilesToDeleteFilter implements FileFilter { Installation installation = getInstallation(); File quicksetupFile = installation.getQuicksetupJarFile(); File openDSFile = installation.getOpenDSJarFile(); File librariesFile = installation.getLibrariesDirectory(); File activationFile = new File(librariesFile, "activation.jar"); File aspectRuntimeFile = new File(librariesFile, "aspectjrt.jar"); File uninstallBatFile = installation.getUninstallBatFile(); File installationPath = installation.getRootDirectory(); /** * {@inheritDoc} */ public boolean accept(File file) { UninstallUserData userData = getUninstallUserData(); boolean[] uData = { userData.getRemoveLibrariesAndTools(), userData.getRemoveLibrariesAndTools(), userData.getRemoveDatabases(), userData.getRemoveLogs(), userData.getRemoveConfigurationAndSchema(), userData.getRemoveBackups(), userData.getRemoveLDIFs() }; Installation installation = getInstallation(); File[] parentFiles = { installation.getLibrariesDirectory(), installation.getBinariesDirectory(), installation.getDatabasesDirectory(), installation.getLogsDirectory(), installation.getConfigurationDirectory(), installation.getBackupDirectory(), installation.getLdifDirectory() }; boolean accept = !installationPath.equals(file) && !equalsOrDescendant(file, librariesFile) && !quicksetupFile.equals(file) && !openDSFile.equals(file); if (accept && Utils.isWindows() && Utils.isCli()) { accept = !uninstallBatFile.equals(file); } for (int i = 0; i < uData.length && accept; i++) { accept &= uData[i] || !equalsOrDescendant(file, parentFiles[i]); } LOG.log(Level.INFO, "accept for :"+file+" is: "+accept); return accept; } } private boolean isWindowsServiceEnabled() { if (isWindowsServiceEnabled == null) { if (ConfigureWindowsService.serviceState(null, null) == ConfigureWindowsService.SERVICE_STATE_ENABLED) { isWindowsServiceEnabled = Boolean.TRUE; } else { isWindowsServiceEnabled = Boolean.FALSE; } } return isWindowsServiceEnabled.booleanValue(); } /** * Returns a ResourceProvider instance. * @return a ResourceProvider instance. */ public ResourceProvider getI18n() { return ResourceProvider.getInstance(); } /** * This methods disables this server as a Windows service. * * @throws ApplicationException if something goes wrong. */ protected void disableWindowsService() throws ApplicationException { notifyListeners(getFormattedProgress( getMsg("progress-disabling-windows-service"))); int code = ConfigureWindowsService.disableService(System.out, System.err); String errorMessage = getMsg("error-disabling-windows-service", getInstallationPath()); switch (code) { case ConfigureWindowsService.SERVICE_DISABLE_SUCCESS: break; case ConfigureWindowsService.SERVICE_ALREADY_DISABLED: break; default: throw new ApplicationException( ApplicationReturnCode.ReturnCode.WINDOWS_SERVICE_ERROR, errorMessage, null); } } private UninstallUserData getUninstallUserData() { return (UninstallUserData) getUserData(); } /** * Tries to start the server and launches a progress dialog. This method * assumes that is being called from the event thread. * @return <CODE>true</CODE> if the server could be started and <CODE> * false</CODE> otherwise. * @param frame the JFrame to be used as parent of the progress dialog. */ private boolean startServer(JFrame frame) { startProgressDetails = new StringBuffer(); startProgressDlg = new ProgressDialog(frame); startProgressDlg.setSummary( getFormattedSummary(getMsg("summary-starting"))); startProgressDlg.setDetails(""); startProgressDlg.setCloseButtonEnabled(false); final Boolean[] returnValue = new Boolean[] {Boolean.FALSE}; Thread t = new Thread(new Runnable() { public void run() { try { new ServerController(Uninstaller.this).startServer(); final boolean isServerRunning = Installation.getLocal().getStatus().isServerRunning(); returnValue[0] = isServerRunning; SwingUtilities.invokeLater(new Runnable() { public void run() { if (isServerRunning) { startProgressDlg.setSummary(getFormattedSuccess( getMsg("summary-start-success"))); } else { startProgressDlg.setSummary(getFormattedError( getMsg("summary-start-error"))); } startProgressDlg.setCloseButtonEnabled(true); } }); } catch (Throwable t) { String msg = getFormattedError(t, true); notifyListeners(msg); } } }); t.start(); startProgressDlg.pack(); Utilities.centerOnComponent(startProgressDlg, frame); startProgressDlg.setModal(true); startProgressDlg.setVisible(true); startProgressDlg = null; return returnValue[0]; } /** * This method displays a login dialog message, asking the user to provide * authentication to retrieve information from the ADS and update the * remote servers. Then it tries to connect to the remote servers. * * @param qs the QuickSetup object. */ private void askForAuthenticationAndLaunch(final QuickSetup qs) { if (loginDialog == null) { loginDialog = new LoginDialog(qs.getDialog().getFrame(), trustManager); loginDialog.pack(); } Utilities.centerOnComponent(loginDialog, qs.getDialog().getFrame()); loginDialog.setModal(true); loginDialog.setVisible(true); if (!loginDialog.isCancelled()) { final InitialLdapContext ctx = loginDialog.getContext(); replicationServerHostPort = loginDialog.getHostName() + ":" + conf.getReplicationServerPort(); BackgroundTask worker = new BackgroundTask() { public Object processBackgroundTask()throws TopologyCacheException { ADSContext adsContext = new ADSContext(ctx); TopologyCache cache = new TopologyCache(adsContext, getTrustManager()); cache.reloadTopology(); return cache; } public void backgroundTaskCompleted(Object returnValue, Throwable throwable) { qs.getDialog().workerFinished(); if (throwable != null) { if (throwable instanceof TopologyCacheException) { qs.displayError( getStringRepresentation((TopologyCacheException)throwable), getMsg("error-title")); } else { qs.displayError( getThrowableMsg("bug-msg", null, throwable), getMsg("error-title")); } } else { TopologyCache cache = (TopologyCache)returnValue; handleTopologyCache(qs, cache); } } }; qs.getDialog().workerStarted(); worker.startBackgroundTask(); } else { if (qs.displayConfirmation( getMsg("confirm-uninstall-server-running-msg"), getMsg("confirm-uninstall-server-running-title"))) { getUserData().setStopServer(true); qs.launch(); qs.setCurrentStep(getNextWizardStep(Step.CONFIRM_UNINSTALL)); } else { getUserData().setStopServer(false); } } } /** * Method that interacts with the user depending on what errors where * encountered in the TopologyCache object. This method assumes that the * TopologyCache has been reloaded. * Note: this method assumes that is being called from the event thread. * @param qs the QuickSetup object for the application. * @param cache the TopologyCache. */ private void handleTopologyCache(QuickSetup qs, TopologyCache cache) { boolean stopProcessing = false; Set<TopologyCacheException> exceptions = new HashSet<TopologyCacheException>(); /* Analyze if we had any exception while loading servers. For the moment * only throw the exception found if the user did not provide the * Administrator DN and this caused a problem authenticating in one server * or if there is a certificate problem. */ Set<ServerDescriptor> servers = cache.getServers(); for (ServerDescriptor server : servers) { TopologyCacheException e = server.getLastException(); if (e != null) { exceptions.add(e); } } Set<String> exceptionMsgs = new LinkedHashSet<String>(); /* Check the exceptions and see if we throw them or not. */ for (TopologyCacheException e : exceptions) { if (stopProcessing) { break; } switch (e.getType()) { case NOT_GLOBAL_ADMINISTRATOR: String errorMsg = getMsg("not-global-administrator-provided"); qs.displayError(errorMsg, getMsg("error-title")); stopProcessing = true; break; case GENERIC_CREATING_CONNECTION: if ((e.getCause() != null) && Utils.isCertificateException(e.getCause())) { UserDataCertificateException.Type excType; ApplicationTrustManager.Cause cause = null; if (e.getTrustManager() != null) { cause = e.getTrustManager().getLastRefusedCause(); } LOG.log(Level.INFO, "Certificate exception cause: "+cause); if (cause == ApplicationTrustManager.Cause.NOT_TRUSTED) { excType = UserDataCertificateException.Type.NOT_TRUSTED; } else if (cause == ApplicationTrustManager.Cause.HOST_NAME_MISMATCH) { excType = UserDataCertificateException.Type.HOST_NAME_MISMATCH; } else { excType = null; } if (excType != null) { String h; int p; try { URI uri = new URI(e.getLdapUrl()); h = uri.getHost(); p = uri.getPort(); } catch (Throwable t) { LOG.log(Level.WARNING, "Error parsing ldap url of TopologyCacheException.", t); h = getMsg("not-available-label"); p = -1; } UserDataCertificateException exc = new UserDataCertificateException(Step.REPLICATION_OPTIONS, getMsg("certificate-exception", h, String.valueOf(p)), e.getCause(), h, p, e.getTrustManager().getLastRefusedChain(), e.getTrustManager().getLastRefusedAuthType(), excType); handleCertificateException(qs, exc, cache); stopProcessing = true; } } } exceptionMsgs.add(getStringRepresentation(e)); } if (!stopProcessing && (exceptionMsgs.size() > 0)) { String confirmationMsg = getMsg("error-reading-registered-servers-confirm", Utils.getStringFromCollection(exceptionMsgs, "\n")); stopProcessing = !qs.displayConfirmation(confirmationMsg, getMsg("confirmation-title")); } if (!stopProcessing) { stopProcessing = !qs.displayConfirmation( getMsg("confirm-uninstall-server-running-msg"), getMsg("confirm-uninstall-server-running-title")); } if (!stopProcessing) { // Launch everything lastLoadedCache = cache; getUninstallUserData().setUpdateRemoteReplication(true); getUserData().setStopServer(true); qs.launch(); qs.setCurrentStep(getNextWizardStep(Step.CONFIRM_UNINSTALL)); } } /** * Displays a dialog asking the user to accept a certificate if the user * accepts it, we update the trust manager and call again to the method that * handles the action of clicking on "Finish". * This method assumes that we are being called from the event thread. */ private void handleCertificateException(final QuickSetup qs, UserDataCertificateException ce, final TopologyCache cache) { CertificateDialog dlg = new CertificateDialog(qs.getDialog().getFrame(), ce); dlg.pack(); dlg.setVisible(true); if (dlg.isAccepted()) { X509Certificate[] chain = ce.getChain(); String authType = ce.getAuthType(); String host = ce.getHost(); if ((chain != null) && (authType != null) && (host != null)) { LOG.log(Level.INFO, "Accepting certificate presented by host "+host); getTrustManager().acceptCertificate(chain, authType, host); BackgroundTask worker = new BackgroundTask() { public Object processBackgroundTask()throws TopologyCacheException { cache.reloadTopology(); return cache; } public void backgroundTaskCompleted(Object returnValue, Throwable throwable) { qs.getDialog().workerFinished(); if (throwable != null) { if (throwable instanceof TopologyCacheException) { qs.displayError( getStringRepresentation((TopologyCacheException)throwable), getMsg("error-title")); } else { qs.displayError( getThrowableMsg("bug-msg", null, throwable), getMsg("error-title")); } } else { handleTopologyCache(qs, cache); } } }; qs.getDialog().workerStarted(); worker.startBackgroundTask(); } else { if (chain == null) { LOG.log(Level.WARNING, "The chain is null for the UserDataCertificateException"); } if (authType == null) { LOG.log(Level.WARNING, "The auth type is null for the UserDataCertificateException"); } if (host == null) { LOG.log(Level.WARNING, "The host is null for the UserDataCertificateException"); } } } } /** * This method updates the replication in the remote servers. It does not * thrown any exception and works in a best effort mode. * It also tries to delete the server registration entry from the remote ADS * servers. */ private void removeRemoteServerReferences() { Set<ServerDescriptor> servers = lastLoadedCache.getServers(); Map<ADSContext.ServerProperty, Object> serverADSProperties = null; for (ServerDescriptor server : servers) { if (isServerToUninstall(server)) { serverADSProperties = server.getAdsProperties(); break; } } if (serverADSProperties == null) { LOG.log(Level.WARNING, "The server ADS properties for the server to "+ "uninstall could not be found."); } for (ServerDescriptor server : servers) { if (server.getAdsProperties() != serverADSProperties) { removeReferences(server, serverADSProperties); } } } /** * This method updates the replication in the remote server represented by * a given ServerProperty object. It does not thrown any exception and works * in a best effort mode. * It also tries to delete the server registration entry from the remote ADS * servers if the serverADSProperties object passed is not null. * @param server the ServerDescriptor object representing the server where * we want to remove references to the server that we are trying to uninstall. * @param serverADSProperties the Map with the ADS properties of the server * that we are trying to uninstall. */ private void removeReferences(ServerDescriptor server, Map<ADSContext.ServerProperty, Object> serverADSProperties) { /* First check if the server must be updated based in the contents of the * ServerDescriptor object. */ boolean hasReferences = false; Object v = server.getServerProperties().get( ServerDescriptor.ServerProperty.IS_REPLICATION_SERVER); if (Boolean.TRUE.equals(v)) { Set replicationServers = (Set<?>)server.getServerProperties().get( ServerDescriptor.ServerProperty.EXTERNAL_REPLICATION_SERVERS); if (replicationServers != null) { for (Object o : replicationServers) { if (replicationServerHostPort.equalsIgnoreCase((String)o)) { hasReferences = true; break; } } } } if (!hasReferences) { for (ReplicaDescriptor replica : server.getReplicas()) { if (replica.isReplicated()) { for (Object o : replica.getReplicationServers()) { if (replicationServerHostPort.equalsIgnoreCase((String)o)) { hasReferences = true; break; } } } if (hasReferences) { break; } } } if (hasReferences) { LOG.log(Level.INFO, "Updating references in: "+ server.getHostPort(true)); notifyListeners(getFormattedWithPoints( getMsg("progress-removing-references", server.getHostPort(true)))); InitialLdapContext ctx = null; try { String dn = ADSContext.getAdministratorDN(loginDialog.getAdministratorUid()); String pwd = loginDialog.getAdministratorPwd(); ctx = getRemoteConnection(server, dn, pwd, getTrustManager()); try { /* * Search for the config to check that it is the directory manager. */ SearchControls searchControls = new SearchControls(); searchControls.setCountLimit(1); searchControls.setSearchScope( SearchControls. OBJECT_SCOPE); searchControls.setReturningAttributes(new String[] {"*"}); ctx.search("cn=config", "objectclass=*", searchControls); } catch (Throwable t) { System.out.println("FUCK: "+t); t.printStackTrace(); } // Update replication servers and domains. If the domain // is an ADS, then remove it from there. removeReferences(ctx, server.getHostPort(true), serverADSProperties); notifyListeners(getFormattedDone() + getLineBreak()); } catch (ApplicationException ae) { errorOnRemoteOccurred = true; String html = getFormattedError(ae, true); notifyListeners(html); LOG.log(Level.INFO, "Error updating replication references in: "+ server.getHostPort(true), ae); } if (ctx != null) { try { ctx.close(); } catch (Throwable t) { } } } } /** * This method updates the replication in the remote server using the * provided InitialLdapContext. * It also tries to delete the server registration entry from the remote ADS * servers if the serverADSProperties object passed is not null. * @param ctx the connection to the remote server where we want to remove * references to the server that we are trying to uninstall. * @param serverDisplay an String representation that is used to identify * the remote server in the log messages we present to the user. * @param serverADSProperties the Map with the ADS properties of the server * that we are trying to uninstall. * @throws ApplicationException if an error occurs while updating the remote * OpenDS server configuration. */ private void removeReferences(InitialLdapContext ctx, String serverDisplay, Map<ADSContext.ServerProperty, Object> serverADSProperties) throws ApplicationException { try { ManagementContext mCtx = LDAPManagementContext.createFromContext( JNDIDirContextAdaptor.adapt(ctx)); RootCfgClient root = mCtx.getRootConfiguration(); MultimasterSynchronizationProviderCfgClient sync = (MultimasterSynchronizationProviderCfgClient) root.getSynchronizationProvider("Multimaster Synchronization"); if (sync.hasReplicationServer()) { ReplicationServerCfgClient replicationServer = sync.getReplicationServer(); Set<String> replServers = replicationServer.getReplicationServer(); if (replServers != null) { String replServer = null; for (String o : replServers) { if (replicationServerHostPort.equalsIgnoreCase(o)) { replServer = o; break; } } if (replServer != null) { LOG.log(Level.INFO, "Updating references in replication server on "+ serverDisplay+"."); replServers.remove(replServer); if (replServers.size() > 0) { replicationServer.setReplicationServer(replServers); replicationServer.commit(); } else { sync.removeReplicationServer(); sync.commit(); } } } } String[] domainNames = sync.listMultimasterDomains(); if (domainNames != null) { for (int i=0; i<domainNames.length; i++) { MultimasterDomainCfgClient domain = sync.getMultimasterDomain(domainNames[i]); Set<String> replServers = domain.getReplicationServer(); if (replServers != null) { String replServer = null; for (String o : replServers) { if (replicationServerHostPort.equalsIgnoreCase(o)) { replServer = o; break; } } if (replServer != null) { LOG.log(Level.INFO, "Updating references in domain " + domain.getReplicationDN()+" on " + serverDisplay + "."); replServers.remove(replServer); if (replServers.size() > 0) { domain.setReplicationServer(replServers); domain.commit(); } else { sync.removeMultimasterDomain(domainNames[i]); sync.commit(); } } } } } } catch (ManagedObjectNotFoundException monfe) { // It does not exist. LOG.log(Level.INFO, "No synchronization found on "+ serverDisplay+".", monfe); } catch (Throwable t) { LOG.log(Level.WARNING, "Error removing references in replication server on "+ serverDisplay+": "+t, t); String errorMessage = getMsg("error-configuring-remote-generic", serverDisplay, t.toString()); throw new ApplicationException( ApplicationReturnCode.ReturnCode.CONFIGURATION_ERROR, errorMessage, t); } ADSContext adsContext = new ADSContext(ctx); try { if (adsContext.hasAdminData() && (serverADSProperties != null)) { adsContext.unregisterServer(serverADSProperties); } } catch (ADSContextException ace) { if (ace.getError() != ADSContextException.ErrorType.NOT_YET_REGISTERED) { String[] args = {serverDisplay, ace.toString()}; throw new ApplicationException( ApplicationReturnCode.ReturnCode.CONFIGURATION_ERROR, getMsg("remote-ads-exception", args), ace); } else { // Nothing to do: this may occur if the new server has been // unregistered on another server and the modification has // been already propagated by replication. } } } /** * Tells whether this ServerDescriptor object represents the server that we * are trying to uninstall or not. * @param server the ServerDescriptor object to analyze. * @return <CODE>true</CODE> if the ServerDescriptor object represents the * server that we are trying to uninstall and <CODE>false</CODE> otherwise. */ private boolean isServerToUninstall(ServerDescriptor server) { boolean isServerToUninstall = false; String path = (String)server.getAdsProperties().get( ADSContext.ServerProperty.INSTANCE_PATH); if (path == null) { // Compare the port of the URL we used. try { String usedUrl = (String) loginDialog.getContext().getEnvironment().get(Context.PROVIDER_URL); boolean isSecure = usedUrl.toLowerCase().startsWith("ldaps"); URI uri = new URI(usedUrl); int port = uri.getPort(); ServerDescriptor.ServerProperty property; if (isSecure) { property = ServerDescriptor.ServerProperty.LDAPS_PORT; } else { property = ServerDescriptor.ServerProperty.LDAP_PORT; } ArrayList ports = (ArrayList)server.getServerProperties().get(property); isServerToUninstall = ports.contains(port); } catch (Throwable t) { LOG.log(Level.WARNING, "Failing checking the port: "+t, t); } } else { File f = new File(path); isServerToUninstall = f.equals(Installation.getLocal().getRootDirectory()); } if (isServerToUninstall) { // TODO: the host name comparison made here does not necessarily work in // all environments... String hostName = server.getHostName(); boolean hostNameEquals = false; try { InetAddress localAddress = InetAddress.getLocalHost(); InetAddress[] addresses = InetAddress.getAllByName(hostName); for (int i=0; i<addresses.length && !hostNameEquals; i++) { hostNameEquals = localAddress.equals(addresses[i]); } } catch (Throwable t) { LOG.log(Level.WARNING, "Failing checking host names: "+t, t); } isServerToUninstall = hostNameEquals; } return isServerToUninstall; } } opends/src/quicksetup/org/opends/quicksetup/Application.java
@@ -27,7 +27,11 @@ package org.opends.quicksetup; import org.opends.admin.ads.ADSContext; import org.opends.admin.ads.ServerDescriptor; import org.opends.admin.ads.TopologyCacheException; import org.opends.admin.ads.util.ApplicationTrustManager; import org.opends.admin.ads.util.ServerLoader; import org.opends.quicksetup.event.ProgressNotifier; import org.opends.quicksetup.event.ProgressUpdateListener; import org.opends.quicksetup.util.ServerController; @@ -40,9 +44,13 @@ import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import javax.naming.NamingException; import javax.naming.ldap.InitialLdapContext; /** * This class represents an application that can be run in the context of * QuickSetup. Examples of applications might be 'installer', 'uninstaller' @@ -280,7 +288,7 @@ * Returns a ResourceProvider instance. * @return a ResourceProvider instance. */ protected ResourceProvider getI18n() public ResourceProvider getI18n() { return ResourceProvider.getInstance(); } @@ -651,6 +659,70 @@ } /** * Returns a localized representation of a TopologyCacheException object. * @param e the exception we want to obtain the representation from. * @return a localized representation of a TopologyCacheException object. */ protected String getStringRepresentation(TopologyCacheException e) { StringBuilder buf = new StringBuilder(); String ldapUrl = e.getLdapUrl(); if (ldapUrl != null) { String hostName = ldapUrl.substring(ldapUrl.indexOf("://") + 3); buf.append(getMsg("server-error", hostName) + " "); } if (e.getCause() instanceof NamingException) { buf.append(getThrowableMsg("bug-msg", null, e.getCause())); } else { // This is unexpected. buf.append(getThrowableMsg("bug-msg", null, e.getCause())); } return buf.toString(); } /** * Gets an InitialLdapContext based on the information that appears on the * provided ServerDescriptor object. Note that the server is assumed to be * registered and that contains a Map with ADSContext.ServerProperty keys. * @param server the object describing the server. * @param trustManager the trust manager to be used to establish the * connection. * @param dn the dn to be used to authenticate. * @param pwd the pwd to be used to authenticate. * @return the InitialLdapContext to the remote server. * @throws ApplicationException if something goes wrong. */ protected InitialLdapContext getRemoteConnection(ServerDescriptor server, String dn, String pwd, ApplicationTrustManager trustManager) throws ApplicationException { Map<ADSContext.ServerProperty, Object> adsProperties = server.getAdsProperties(); ServerLoader loader = new ServerLoader(adsProperties, dn, pwd, trustManager); InitialLdapContext ctx = null; try { ctx = loader.createContext(); } catch (NamingException ne) { String errorMessage = getMsg("cannot-connect-to-remote-generic", server.getHostPort(true), ne.toString(true)); throw new ApplicationException( ApplicationReturnCode.ReturnCode.CONFIGURATION_ERROR, errorMessage, ne); } return ctx; } /** * This class is used to notify the ProgressUpdateListeners of events * that are written to the standard error. It is used in WebStartInstaller * and in OfflineInstaller. These classes just create a ErrorPrintStream and opends/src/quicksetup/org/opends/quicksetup/CliApplicationHelper.java
@@ -344,7 +344,7 @@ * @param key String key * @return String message */ protected static String getMsg(String key) protected String getMsg(String key) { return org.opends.server.util.StaticUtils.wrapText(getI18n().getMsg(key), Utils.getCommandLineMaxLineWidth()); @@ -357,7 +357,7 @@ * @param args String[] args * @return String message */ protected static String getMsg(String key, String... args) protected String getMsg(String key, String... args) { return org.opends.server.util.StaticUtils.wrapText( getI18n().getMsg(key, args), Utils.getCommandLineMaxLineWidth()); @@ -367,7 +367,7 @@ * Gets the resource provider instance. * @return ResourceProvider instance */ protected static ResourceProvider getI18n() protected ResourceProvider getI18n() { return ResourceProvider.getInstance(); } opends/src/quicksetup/org/opends/quicksetup/QuickSetupLog.java
@@ -45,6 +45,7 @@ static public final String LOG_FILE_SUFFIX = ".log"; static private File logFile = null; static private FileHandler fileHandler = null; /** * Creates a new file handler for writing log messages to the file indicated @@ -55,7 +56,7 @@ static public void initLogFileHandler(File file) throws IOException { if (!isInitialized()) { logFile = file; FileHandler fileHandler = new FileHandler(logFile.getCanonicalPath()); fileHandler = new FileHandler(logFile.getCanonicalPath()); fileHandler.setFormatter(new SimpleFormatter()); Logger logger = Logger.getLogger("org.opends.quicksetup"); logger.addHandler(fileHandler); @@ -68,6 +69,22 @@ } /** * Creates a new file handler for writing log messages of a given package * to the file indicated by <code>file</code>. * @param file log file to which log messages will be written. * @param packageName the name of the package of the classes that generate * log messages. * @throws IOException if something goes wrong */ static public void initLogFileHandler(File file, String packageName) throws IOException { initLogFileHandler(file); Logger logger = Logger.getLogger(packageName); logger.addHandler(fileHandler); logger.setUseParentHandlers(false); } /** * Prevents messages written to loggers from appearing in the console * output. */ opends/src/quicksetup/org/opends/quicksetup/UserData.java
@@ -595,7 +595,7 @@ String name = ""; try { name = java.net.InetAddress.getLocalHost().getHostName(); name = java.net.InetAddress.getLocalHost().getCanonicalHostName(); } catch (Throwable t) { opends/src/quicksetup/org/opends/quicksetup/installandupgrader/InstallAndUpgrader.java
@@ -124,17 +124,7 @@ */ public UserData getUserData() { if (userData == null) { userData = (InstallAndUpgradeUserData)createUserData(); } return userData; } /** * {@inheritDoc} */ public UserData createUserData() { return new InstallAndUpgradeUserData(); return getDelegateApplication().getUserData(); } /** @@ -466,7 +456,7 @@ if (cStep == Step.WELCOME) { Boolean isUpgrade = (Boolean)qs.getFieldValue(FieldName.IS_UPGRADE); ((InstallAndUpgradeUserData)getUserData()).setUpgrade(isUpgrade); getInstallAndUpgradeUserData().setUpgrade(isUpgrade); if (isUpgrade) { upgrader.updateUserData(UpgradeWizardStep.WELCOME, qs); @@ -519,7 +509,7 @@ private GuiApplication getDelegateApplication() { GuiApplication application; if (((InstallAndUpgradeUserData)getUserData()).isUpgrade()) if (getInstallAndUpgradeUserData().isUpgrade()) { application = upgrader; } @@ -529,4 +519,16 @@ } return application; } /** * Returns the install and upgrader specific user data. * @return the install and upgrader specific user data. */ public InstallAndUpgradeUserData getInstallAndUpgradeUserData() { if (userData == null) { userData = new InstallAndUpgradeUserData(); } return userData; } } opends/src/quicksetup/org/opends/quicksetup/installandupgrader/ui/WelcomePanel.java
@@ -32,7 +32,6 @@ import org.opends.quicksetup.UserData; import org.opends.quicksetup.event.BrowseActionListener; import org.opends.quicksetup.event.ButtonEvent; import org.opends.quicksetup.installandupgrader.InstallAndUpgradeUserData; import org.opends.quicksetup.installandupgrader.InstallAndUpgrader; import org.opends.server.util.DynamicConstants; @@ -60,12 +59,17 @@ private JButton butBrowse; private InstallAndUpgrader appl; private boolean initialized = false; /** * Default constructor. * @param application Upgrader application */ public WelcomePanel(InstallAndUpgrader application) { super(application); appl = application; } /** @@ -73,10 +77,14 @@ */ public void beginDisplay(UserData data) { super.beginDisplay(data); tcServerLocation.setText(data.getServerLocation()); boolean isUpgrade = ((InstallAndUpgradeUserData)data).isUpgrade(); rbInstall.setSelected(!isUpgrade); rbUpgrade.setSelected(isUpgrade); if (!initialized) { tcServerLocation.setText(data.getServerLocation()); boolean isUpgrade = appl.getInstallAndUpgradeUserData().isUpgrade(); rbInstall.setSelected(!isUpgrade); rbUpgrade.setSelected(isUpgrade); initialized = true; } checkEnablingState(); } opends/src/quicksetup/org/opends/quicksetup/installer/Installer.java
@@ -62,7 +62,6 @@ import org.opends.admin.ads.TopologyCache; import org.opends.admin.ads.TopologyCacheException; import org.opends.admin.ads.util.ApplicationTrustManager; import org.opends.admin.ads.util.ServerLoader; import org.opends.quicksetup.ui.*; import org.opends.quicksetup.util.Utils; import org.opends.quicksetup.*; @@ -1158,7 +1157,24 @@ { if (registeredNewServerOnRemote) { adsContext.unregisterServer(getNewServerAdsProperties()); try { adsContext.unregisterServer(getNewServerAdsProperties()); } catch (ADSContextException ace) { if (ace.getError() != ADSContextException.ErrorType.NOT_YET_REGISTERED) { throw ace; } else { // Nothing to do: this may occur if the new server has been // unregistered on another server and the modification has // been already propagated by replication. } } } if (createdAdministrator) { @@ -3728,28 +3744,6 @@ return Utils.isCertificateException(t); } private String getStringRepresentation(TopologyCacheException e) { StringBuilder buf = new StringBuilder(); String ldapUrl = e.getLdapUrl(); if (ldapUrl != null) { String hostName = ldapUrl.substring(ldapUrl.indexOf("://") + 3); buf.append(getMsg("server-error", hostName) + " "); } if (e.getCause() instanceof NamingException) { buf.append(getThrowableMsg("bug-msg", null, e.getCause())); } else { // This is unexpected. buf.append(getThrowableMsg("bug-msg", null, e.getCause())); } return buf.toString(); } private Map<ServerDescriptor, Integer> getRemoteWithNoReplicationPort( UserData userData) { @@ -3815,6 +3809,16 @@ } } /** * Gets an InitialLdapContext based on the information that appears on the * provided ServerDescriptor. * @param server the object describing the server. * @param trustManager the trust manager to be used to establish the * connection. * @return the InitialLdapContext to the remote server. * @throws ApplicationException if something goes wrong. */ private InitialLdapContext getRemoteConnection(ServerDescriptor server, ApplicationTrustManager trustManager) throws ApplicationException { @@ -3837,7 +3841,7 @@ if (auth.useSecureConnection()) { adsProperties.put(ADSContext.ServerProperty.LDAPS_PORT, String.valueOf(auth.getPort())); String.valueOf(auth.getPort())); adsProperties.put(ADSContext.ServerProperty.LDAPS_ENABLED, "true"); } else @@ -3846,29 +3850,10 @@ String.valueOf(auth.getPort())); adsProperties.put(ADSContext.ServerProperty.LDAP_ENABLED, "true"); } server.setAdsProperties(adsProperties); } else { adsProperties = server.getAdsProperties(); } ServerLoader loader = new ServerLoader(adsProperties, auth.getDn(), auth.getPwd(), trustManager); InitialLdapContext ctx = null; try { ctx = loader.createContext(); } catch (NamingException ne) { String errorMessage = getMsg("cannot-connect-to-remote-generic", server.getHostPort(true), ne.toString(true)); throw new ApplicationException( ApplicationReturnCode.ReturnCode.CONFIGURATION_ERROR, errorMessage, ne); } return ctx; return getRemoteConnection(server, auth.getDn(), auth.getPwd(), trustManager); } private void initializeSuffix(InitialLdapContext ctx, int replicaId, @@ -4044,12 +4029,12 @@ if (lastLogMsg == null) { errorMsg = getMsg("error-during-initialization-no-log", sourceServerDisplay); sourceServerDisplay, state); } else { errorMsg = getMsg("error-during-initialization-log", sourceServerDisplay, lastLogMsg); sourceServerDisplay, lastLogMsg, state); } if (helper.isCompletedWithErrors(state)) @@ -4062,9 +4047,10 @@ ApplicationException ae = new ApplicationException( ApplicationReturnCode.ReturnCode.APPLICATION_ERROR, errorMsg, null); if ((lastLogMsg != null) && if ((lastLogMsg == null) || helper.isPeersNotFoundError(lastLogMsg)) { // Assume that this is a peer not found error. throw new PeerNotFoundException(errorMsg); } else opends/src/quicksetup/org/opends/quicksetup/installer/InstallerHelper.java
@@ -30,10 +30,7 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; @@ -55,22 +52,16 @@ import org.opends.server.admin.std.client.*; import org.opends.server.admin.std.meta.*; import org.opends.server.backends.task.TaskState; import org.opends.server.core.DirectoryServer; import org.opends.server.extensions.ConfigFileHandler; import org.opends.server.messages.CoreMessages; import org.opends.server.messages.ReplicationMessages; import org.opends.server.tools.ConfigureDS; import org.opends.server.tools.ConfigureWindowsService; import org.opends.server.tools.ImportLDIF; import org.opends.server.types.Attribute; import org.opends.server.types.AttributeType; import org.opends.server.types.AttributeValue; import org.opends.server.types.DN; import org.opends.server.types.DirectoryException; import org.opends.server.types.Entry; import org.opends.server.types.ExistingFileBehavior; import org.opends.server.types.LDIFExportConfig; import org.opends.server.types.ObjectClass; import org.opends.server.util.LDIFException; import org.opends.server.util.LDIFWriter; import org.opends.server.util.StaticUtils; @@ -280,7 +271,8 @@ "Multimaster Synchronization", new ArrayList<DefaultBehaviorException>()); sync.setJavaImplementationClass( "org.opends.server.replication.plugin.MultimasterReplication"); org.opends.server.replication.plugin.MultimasterReplication.class. getName()); sync.setEnabled(Boolean.TRUE); synchProviderCreated = true; synchProviderEnabled = false; @@ -443,7 +435,6 @@ */ if (replConf.isSynchProviderCreated()) { MultimasterSynchronizationProviderCfgClient sync = null; try { root.removeSynchronizationProvider("Multimaster Synchronization"); @@ -476,6 +467,7 @@ if (replServers != null) { replServers.removeAll(replConf.getNewReplicationServers()); replicationServer.setReplicationServer(replServers); replicationServer.commit(); } } @@ -495,6 +487,7 @@ if (replServers != null) { replServers.removeAll(domain.getAddedReplicationServers()); d.setReplicationServer(replServers); d.commit(); } } @@ -585,52 +578,6 @@ return logMsg.indexOf( "="+ReplicationMessages.MSGID_NO_REACHABLE_PEER_IN_THE_DOMAIN) != -1; } private void addConfigEntry(ConfigFileHandler configFileHandler, DN dn, String[] ocs, String[] attributeNames, String[][] attributeValues) throws DirectoryException { HashMap<ObjectClass,String> objectClasses = new HashMap<ObjectClass,String>(); HashMap<AttributeType,List<Attribute>> userAttributes = new HashMap<AttributeType,List<Attribute>>(); HashMap<AttributeType,List<Attribute>> operationalAttributes = new HashMap<AttributeType,List<Attribute>>(); for (int j=0; j<ocs.length; j++) { String ocName = ocs[j]; ObjectClass objectClass = DirectoryServer.getObjectClass(ocName); if (objectClass == null) { objectClass = DirectoryServer.getDefaultObjectClass(ocName); } objectClasses.put(objectClass, ocName); } for (int j=0; j<attributeNames.length; j++) { String attrName = attributeNames[j]; AttributeType attrType = DirectoryServer.getAttributeType(attrName); if (attrType == null) { attrType = DirectoryServer.getDefaultAttributeType(attrName); } String[] attrValues = attributeValues[j]; LinkedHashSet<AttributeValue> valueSet = new LinkedHashSet<AttributeValue>(); for (int k=0; k<attrValues.length; k++) { AttributeValue attributeValue = new AttributeValue(attrType, attrValues[k]); valueSet.add(attributeValue); } ArrayList<Attribute> attrList = new ArrayList<Attribute>(); attrList.add(new Attribute(attrType, attrName, null, valueSet)); userAttributes.put(attrType, attrList); } Entry entry = new Entry(dn, objectClasses, userAttributes, operationalAttributes); configFileHandler.addEntry(entry, null); } private int getReplicationId(Set<Integer> usedIds) { opends/src/quicksetup/org/opends/quicksetup/resources/Resources.properties
@@ -41,52 +41,7 @@ failed. Check file {0} for more details.\n\n\ Launching command line Setup... # # Uninstall command line messages # uninstall-launcher-usage-description=This utility may be used to uninstall the \ Directory Server. uninstall-launcher-launching-gui=Launching graphical uninstall... uninstall-launcher-launching-cli=Launching command line uninstall... uninstall-launcher-gui-launched-failed=\n\nThe graphical Uninstall launch \ failed.\n\nLaunching command line Uninstall... uninstall-launcher-gui-launched-failed-details=\n\nThe graphical Uninstall \ launch failed. Check file {0} for more details.\n\nLaunching command line \ Uninstall... cli-uninstall-unknown-argument=Unknown argument {0} cli-uninstall-yes-short=y cli-uninstall-yes-long=yes cli-uninstall-no-short=n cli-uninstall-no-long=no cli-uninstall-confirm-prompt={0}\n[{1}]: cli-uninstall-string-prompt={0}\n[{1}]: cli-uninstall-error-reading-stdin=Unexpected error reading standard input. cli-uninstall-what-to-delete=Do you want to remove all components of \ OpenDS or select the components to remove?\n\ 1. Remove all components\n\ 2. Select the components to be removed\n\ 3. Neither; Quit the uninstaller cli-uninstall-confirm-libraries-binaries=Remove Server Libraries and \ Administrative Tools? cli-uninstall-confirm-databases=Remove Database Contents? cli-uninstall-confirm-logs=Remove Log Files? cli-uninstall-confirm-configuration-schema=Remove Configuration and Schema \ Files? cli-uninstall-confirm-backups=Remove Backup Files Contained in bak Directory? cli-uninstall-confirm-ldifs=Remove LDIF Export Files Contained in ldif \ Directory? cli-uninstall-confirm-outsidedbs=The Directory Server contains database files \ in the following locations outside the server path:\n{0}\nRemove these files? cli-uninstall-confirm-outsidelogs=The Directory Server contains log files in \ the following locations outside the server path:\n{0}\nRemove these files? cli-uninstall-nothing-to-be-uninstalled=You must select something to be \ uninstalled. cli-uninstall-confirm-stop=The OpenDS server is currently running and \ must be stopped before uninstallation can continue.\nStop the Server and \ permanently delete the files? cli-uninstall-confirm-delete-files=The files will be permanently deleted, are \ you sure you want to continue? cli-uninstall-server-stopped=The Server is Stopped. # # Upgrade command line messages @@ -125,7 +80,6 @@ # Dialog titles # frame-install-title=OpenDS QuickSetup frame-uninstall-title=OpenDS Uninstall frame-upgrade-title=OpenDS QuickUpgrade # @@ -137,22 +91,18 @@ previous-button-tooltip=Go to Previous Step finish-button-label=Finish finish-button-install-label=Finish finish-button-uninstall-label=Uninstall finish-button-install-tooltip=Finish Installation and Setup finish-button-uninstall-tooltip=Finish Uninstall finish-button-upgrade-tooltip=Finish Upgrade finish-button-tooltip=Finish Setup close-button-label=Close close-button-tooltip=Close Setup Window close-progress-button-tooltip=Close Progress Dialog close-button-install-tooltip=Close Setup Window close-button-uninstall-tooltip=Close Uninstall Window quit-button-label=Quit quit-button-install-tooltip=Quit Setup quit-button-upgrade-tooltip=Quit Upgrade cancel-button-label=Cancel cancel-button-tooltip=Cancel the currently running operation cancel-button-uninstall-tooltip=Cancel Uninstall shutdown-button-label=Shutdown continue-button-label=Continue continue-button-install-tooltip=Continue with Setup @@ -171,9 +121,6 @@ confirm-quit-install-title=Confirmation Required confirm-quit-install-msg=Are you sure you want to quit OpenDS \ QuickSetup?\nIf you click 'Yes' nothing will be installed on your system. confirm-close-uninstall-title=Confirmation Required confirm-close-uninstall-msg=OpenDS Uninstall has not yet completed.\nAre you \ sure you want to close the Uninstall Window? confirm-cancel-upgrade-title=Confirmation Required confirm-cancel-upgrade-msg=OpenDS QuickUpgrade has not yet completed.\nIf you \ click 'Yes' any changes that have been made to the server being upgraded \ @@ -181,27 +128,6 @@ confirm-quit-upgrade-title=Confirmation Required confirm-quit-upgrade-msg=Are you sure you want to quit OpenDS \ QuickUpgrade?\nIf you click 'Yes' nothing will be upgraded on your system. confirm-uninstall-server-not-running-msg=Confirm Uninstall\n\ All selected files will be permanently deleted, are you sure you \ want to continue? confirm-uninstall-server-not-running-title=Confirm Uninstall confirm-uninstall-server-running-msg=Server is Running\n\ The OpenDS server is currently running and must be stopped before \ uninstallation can continue. Do you want the uninstaller to stop \ the server for you and continue with the uninstall? If you click \ No, you will need to stop the server manually to continue. confirm-uninstall-replication-server-running-title=Confirmation Required confirm-uninstall-replication-server-running-msg=This server is configured to \ perform replication.\nIn order to remove references to this server in other \ servers you must provide administrator authentication.\n\nClick on 'Yes' to \ provide authentication to remove the remote references. confirm-uninstall-replication-server-not-running-title=Confirmation Required confirm-uninstall-replication-server-not-running-msg=This server is configured \ to perform replication.\nIn order to remove references to this server in other \ servers the server will be started and then you must provide administrator \ authentication.\n\nClick on 'Yes' to start the server and then provide \ authentication to remove the remote references. confirm-uninstall-server-running-title=Server is Running confirm-cancel-title=Confirmation Required confirm-cancel-prompt=Cancel the running operation? network-error-title=Network Error @@ -344,8 +270,6 @@ automatically. invalid-number-entries-range=The number of user entries to generate \ automatically must be an integer between {0} and {1}. # Confirm Uninstall Panel nothing-selected-to-uninstall=You must select something to be uninstalled. # Directory Manager authentication to shutdown in Windows not-a-directory-manager-in-config=The provided DN is not one of the \ Administrative User DN. @@ -372,7 +296,6 @@ review-step=Review progress-step=Progress finished-step=Finished confirm-uninstall-step=Uninstall Options step-upgrade-choose-version=Choose Version # @@ -804,44 +727,6 @@ finished-panel-title=Finished # # Confirm Uninstall Panel specific labels # confirm-uninstall-panel-title=Uninstall Options # The following line contains some HTML tags. translators should respect them. # Concerning the URL, depending on how works the product page translators # have to modify it or not: if the server uses the locale of the browser to display # a language there is no translation to be done but if we have specific URL for # each language the URL must be localized. confirm-uninstall-panel-instructions=The OpenDS Uninstall tool will remove all \ parts of the OpenDS server you have selected below from your system. If all \ are selected, the server will be removed entirely. server-path-label=Server Path: remove-label=Remove: remove-libraries-and-tools-label=Server Libraries and Administrative Tools remove-databases-label=Database Contents remove-logs-label=Log Files remove-schema-and-configuration-label=Configuration and Schema Files remove-backups-label=Backup Files Contained in bak Directory remove-ldifs-label=LDIF Export Files Contained in ldif Directory remove-libraries-and-tools-tooltip=Remove Server Libraries and Administrative \ Tools remove-databases-tooltip=Remove Database Contents remove-logs-tooltip=Remove Log Files remove-schema-and-configuration-tooltip=Remove Configuration and Schema Files remove-backups-tooltip=Remove Backup Files Contained in bak Directory remove-ldifs-tooltip=Remove LDIF Export Files Contained in ldif Directory delete-outside-dbs-msg=The Directory Server contains database files in the \ following locations outside the server path: delete-outside-dbs-label=Delete these Database Files delete-outside-dbs-tooltip=Check this box to Delete the Database Files located \ outside the install directory delete-outside-logs-msg=The Directory Server contains log files in the \ following locations outside the server path: delete-outside-logs-label=Delete these Log Files delete-outside-logs-tooltip=Check this box to Delete the Log Files located \ outside the install directory # # Miscellaneous labels # browse-button-label=Browse... @@ -860,7 +745,6 @@ # Progress Summary Labels # summary-install-not-started=Starting QuickSetup... summary-uninstall-not-started=Starting Uninstallation... summary-downloading=Downloading Binary Files... summary-extracting=Extracting Binary Files... summary-configuring=Configuring Directory Server... @@ -891,29 +775,7 @@ configuration status, click \ Launch Status Panel. Note that you can launch this tool \ later using {2}.<br><INPUT type="submit" value="Launch Status Panel"></INPUT> summary-stopping=Stopping Directory Server... summary-disabling-windows-service=Disabling Windows Service... summary-deleting-external-db-files=Deleting Database Files outside the \ Installation Path... summary-deleting-external-log-files=Deleting Log Files outside the \ Installation Path... summary-deleting-external-references=Deleting External References... summary-deleting-installation-files=Deleting Files under the Installation \ Path... summary-uninstall-finished-successfully-remove-jarfiles=<b>OpenDS Uninstall \ Completed Successfully.</b><br><br>To complete the uninstallation, you must \ delete manually the following files and directories:<br>{0} summary-uninstall-finished-successfully=<b>OpenDS Uninstall Completed \ Successfully.</b> summary-uninstall-finished-successfully-remove-jarfiles-cli=OpenDS Uninstall \ Completed Successfully.\nTo complete the uninstallation, you must \ delete manually the following files and directories:\n{0} summary-uninstall-finished-successfully-cli=OpenDS Uninstall Completed \ Successfully. summary-uninstall-finished-with-error=An error occurred. Check 'Details' text \ area for more information. summary-upgrade-not-started=Starting Upgrade... summary-upgrade-initializing=Initializing Upgrade... summary-upgrade-downloading=Downloading Build... @@ -1103,10 +965,11 @@ initialize-progress-with-processed= {0} entries processed. initialize-progress-with-unprocessed={0} remaining to be processed. error-during-initialization-no-log=Error during the initialization with \ contents from server {0}. Check the error logs of {0} for more information. contents from server {0}. Task state: {1}. Check the error logs of {0} for \ more information. error-during-initialization-log=Error during the initialization with \ contents from server {0}. Last log details: {1}. Check the error logs of the \ server for more information. contents from server {0}. Last log details: {1}. Task state: {2}. Check the \ error logs of the server for more information. error-pooling-initialization=Error reading the progress of the initialization \ with contents from server {0}. opends/src/quicksetup/org/opends/quicksetup/ui/ButtonsPanel.java
@@ -165,27 +165,33 @@ private void createButtons() { nextButton = createButton("next-button-label", "next-button-tooltip", createButton(getMsg("next-button-label"), getMsg("next-button-tooltip"), ButtonName.NEXT); previousButton = createButton("previous-button-label", "previous-button-tooltip", createButton(getMsg("previous-button-label"), getMsg("previous-button-tooltip"), ButtonName.PREVIOUS); String tooltip; GuiApplication application = getApplication(); tooltip = application.getQuitButtonToolTipKey(); tooltip = application.getI18n().getMsg(application.getQuitButtonToolTipKey()); quitButton = createButton("quit-button-label", tooltip, ButtonName.QUIT); createButton(getMsg("quit-button-label"), tooltip, ButtonName.QUIT); tooltip = application.getCloseButtonToolTipKey(); closeButton = createButton("close-button-label", tooltip, ButtonName.CLOSE); tooltip = application.getI18n().getMsg(application.getCloseButtonToolTipKey()); closeButton = createButton(getMsg("close-button-label"), tooltip, ButtonName.CLOSE); String label = application.getFinishButtonLabelKey(); tooltip = application.getFinishButtonToolTipKey(); String label = application.getI18n().getMsg(application.getFinishButtonLabelKey()); tooltip = application.getI18n().getMsg(application.getFinishButtonToolTipKey()); finishButton = createButton(label, tooltip, ButtonName.FINISH); } @@ -271,15 +277,15 @@ /** * Create a button. * @param labelKey the key in the properties file for the label. * @param tooltipKey the key in the properties file for the tooltip. * @param label the label of the button. * @param tooltip the tooltip of the button. * @param buttonName the ButtonName. * @return a new button with the specified parameters. */ private JButton createButton(String labelKey, String tooltipKey, private JButton createButton(String label, String tooltip, ButtonName buttonName) { JButton b = UIFactory.makeJButton(getMsg(labelKey), getMsg(tooltipKey)); JButton b = UIFactory.makeJButton(label, tooltip); final ButtonName fButtonName = buttonName; opends/src/quicksetup/org/opends/quicksetup/ui/ConfirmUninstallPanel.java
File was deleted opends/src/quicksetup/org/opends/quicksetup/ui/StepsPanel.java
@@ -137,7 +137,7 @@ boolean first = true; for (WizardStep s : orderedSteps) { hmText.put(s, getMsg(s.getMessageKey())); hmText.put(s, app.getI18n().getMsg(s.getMessageKey())); JPanel subPanel = new JPanel(new GridBagLayout()); subPanel.setOpaque(false); opends/src/quicksetup/org/opends/quicksetup/uninstaller/Uninstaller.java
File was deleted opends/src/quicksetup/org/opends/quicksetup/util/HtmlProgressMessageFormatter.java
@@ -480,6 +480,18 @@ private String getHtmlStack(Throwable ex) { StringBuilder buf = new StringBuilder(); buf.append(SPACE) .append(SPACE) .append(SPACE) .append(SPACE) .append(SPACE) .append(SPACE) .append(SPACE) .append(SPACE) .append(SPACE) .append(SPACE) .append(getHtml(ex.toString())) .append(Constants.HTML_LINE_BREAK); StackTraceElement[] stack = ex.getStackTrace(); for (StackTraceElement aStack : stack) { buf.append(SPACE) opends/src/statuspanel/org/opends/statuspanel/event/ServerStatusChangeEvent.java
File was deleted opends/src/statuspanel/org/opends/statuspanel/event/ServerStatusChangeListener.java
File was deleted opends/src/statuspanel/org/opends/statuspanel/event/StatusPanelButtonListener.java
File was deleted opends/src/statuspanel/org/opends/statuspanel/i18n/ResourceProvider.java
File was deleted opends/src/statuspanel/org/opends/statuspanel/resources/Resources.properties
File was deleted opends/src/statuspanel/org/opends/statuspanel/ui/DatabasesTableModel.java
File was deleted opends/src/statuspanel/org/opends/statuspanel/ui/ListenersTableModel.java
File was deleted opends/src/statuspanel/org/opends/statuspanel/ui/LoginDialog.java
File was deleted opends/src/statuspanel/org/opends/statuspanel/ui/StatusPanelDialog.java
File was deleted opends/tests/gui-tests/quickUninstall.xml.stubs
@@ -37,7 +37,7 @@ <component class="javax.swing.JButton" id="Quit" index="1" parent="JPanel Instance 2" text="Quit" window="OpenDS QuickSetup" /> <component class="org.opends.quicksetup.installer.ui.ServerSettingsPanel" id="ServerSettingsPanel Instance" index="3" parent="CurrentStepPanel Instance" window="OpenDS QuickSetup" /> <component class="javax.swing.JButton" id="Uninstall" index="3" parent="ButtonsPanel Instance" text="Uninstall" window="OpenDS QuickSetup" /> <launch args="[]" class="org.opends.quicksetup.uninstaller.UninstallLauncher" classpath=".${path.separator}${instance.path}${file.separator}classes${path.separator}${instance.path}${file.separator}lib${file.separator}activation.jar${path.separator}${instance.path}${file.separator}lib${file.separator}aspectjrt.jar${path.separator}${instance.path}${file.separator}lib${file.separator}je.jar${path.separator}${instance.path}${file.separator}lib${file.separator}mail.jar${path.separator}${instance.path}${file.separator}lib${file.separator}OpenDS.jar${path.separator}${instance.path}${file.separator}lib${file.separator}quicksetup.jar${path.separator}${instance.path}${file.separator}lib${file.separator}statuspanel.jar" desc="Launch org.opends.quicksetup.uninstaller.UninstallLauncher" method="main" /> <launch args="[]" class="org.opends.guitools.uninstaller.UninstallLauncher" classpath=".${path.separator}${instance.path}${file.separator}classes${path.separator}${instance.path}${file.separator}lib${file.separator}activation.jar${path.separator}${instance.path}${file.separator}lib${file.separator}aspectjrt.jar${path.separator}${instance.path}${file.separator}lib${file.separator}je.jar${path.separator}${instance.path}${file.separator}lib${file.separator}mail.jar${path.separator}${instance.path}${file.separator}lib${file.separator}OpenDS.jar${path.separator}${instance.path}${file.separator}lib${file.separator}quicksetup.jar${path.separator}${instance.path}${file.separator}lib${file.separator}statuspanel.jar" desc="Launch org.opends.guitools.uninstaller.UninstallLauncher" method="main" /> <sequence> <action args="Uninstall" class="javax.swing.AbstractButton" method="actionClick" /> <wait args="Confirmation Required" class="abbot.tester.ComponentTester" method="assertComponentShowing" />