| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.uninstaller; |
| | |
| | | import org.opends.server.admin.std.client.RootCfgClient; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.tools.ConfigureWindowsService; |
| | | import org.opends.server.tools.ToolConstants; |
| | | import org.opends.messages.Message; |
| | | import org.opends.messages.MessageBuilder; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | |
| | | private boolean errorOnRemoteOccurred; |
| | | private boolean errorDeletingOccurred; |
| | | |
| | | private UninstallerArgumentParser parser; |
| | | |
| | | private HashMap<ProgressStep, Integer> hmRatio = |
| | | new HashMap<ProgressStep, Integer>(); |
| | | |
| | |
| | | |
| | | // Switch off attribute type name validation in client. |
| | | AttributeTypePropertyDefinition.setCheckSchema(false); |
| | | |
| | | LOG.log(Level.INFO, "Uninstaller is created."); |
| | | } |
| | | /** |
| | | * {@inheritDoc} |
| | |
| | | */ |
| | | public UserData createUserData(Launcher launcher) |
| | | throws UserDataException, ApplicationException { |
| | | parser = (UninstallerArgumentParser)launcher.getArgumentParser(); |
| | | return cliHelper.createUserData( |
| | | (UninstallerArgumentParser)launcher.getArgumentParser(), |
| | | parser, |
| | | launcher.getArguments()); |
| | | |
| | | } |
| | |
| | | */ |
| | | public void run() { |
| | | runStarted = true; |
| | | LOG.log(Level.INFO, "run of the Uninstaller started"); |
| | | |
| | | initMaps(); |
| | | PrintStream origErr = System.err; |
| | | PrintStream origOut = System.out; |
| | |
| | | |
| | | boolean displaySeparator = false; |
| | | |
| | | LOG.log(Level.INFO, "Update remote replication? "+ |
| | | getUninstallUserData().getUpdateRemoteReplication()); |
| | | if (getUninstallUserData().getUpdateRemoteReplication()) |
| | | { |
| | | status = UninstallProgressStep.UNCONFIGURING_REPLICATION; |
| | |
| | | displaySeparator = true; |
| | | } |
| | | |
| | | LOG.log(Level.INFO, "Stop server? "+getUserData().getStopServer()); |
| | | if (getUserData().getStopServer()) { |
| | | status = UninstallProgressStep.STOPPING_SERVER; |
| | | if (displaySeparator && isVerbose()) { |
| | |
| | | } |
| | | displaySeparator = true; |
| | | } |
| | | LOG.log(Level.INFO, "Is Windows Service Enabled? "+ |
| | | isWindowsServiceEnabled()); |
| | | if (isWindowsServiceEnabled()) { |
| | | status = UninstallProgressStep.DISABLING_WINDOWS_SERVICE; |
| | | if (displaySeparator && isVerbose()) { |
| | |
| | | |
| | | BackgroundTask worker = new BackgroundTask() |
| | | { |
| | | public Object processBackgroundTask()throws TopologyCacheException |
| | | public Object processBackgroundTask() throws Throwable |
| | | { |
| | | LOG.log(Level.INFO, "Loading Topology Cache in askForAuthentication"); |
| | | ADSContext adsContext = new ADSContext(ctx); |
| | | TopologyCache cache = new TopologyCache(adsContext, |
| | | getTrustManager()); |
| | |
| | | qs.getDialog().workerFinished(); |
| | | if (throwable != null) |
| | | { |
| | | LOG.log(Level.WARNING, "Throwable: "+throwable, throwable); |
| | | if (throwable instanceof TopologyCacheException) |
| | | { |
| | | qs.displayError( |
| | |
| | | getThrowableMsg(INFO_BUG_MSG.get(), throwable), |
| | | INFO_ERROR_TITLE.get()); |
| | | } |
| | | LOG.log(Level.INFO, "Error was displayed"); |
| | | } |
| | | else |
| | | { |
| | |
| | | */ |
| | | private void handleTopologyCache(QuickSetup qs, TopologyCache cache) |
| | | { |
| | | LOG.log(Level.INFO, "Handling TopologyCache"); |
| | | boolean stopProcessing = false; |
| | | Set<TopologyCacheException> exceptions = |
| | | new HashSet<TopologyCacheException>(); |
| | |
| | | getTrustManager().acceptCertificate(chain, authType, host); |
| | | BackgroundTask worker = new BackgroundTask() |
| | | { |
| | | public Object processBackgroundTask() throws TopologyCacheException |
| | | public Object processBackgroundTask() throws Throwable |
| | | { |
| | | LOG.log(Level.INFO, "Reloading topology"); |
| | | cache.getFilter().setSearchMonitoringInformation(false); |
| | | cache.reloadTopology(); |
| | | return cache; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | if (!hasReferences) |
| | | { |
| | | LOG.log(Level.INFO, "No references in: "+ server.getHostPort(true)); |
| | | } |
| | | if (hasReferences) |
| | | { |
| | | LOG.log(Level.INFO, "Updating references in: "+ server.getHostPort(true)); |
| | |
| | | |
| | | if (!getUninstallUserData().isForceOnError()) |
| | | { |
| | | throw ae; |
| | | Message msg = |
| | | ERR_UNINSTALL_ERROR_UPDATING_REMOTE_NO_FORCE.get( |
| | | "--"+ |
| | | parser.getSecureArgsList().adminUidArg.getLongIdentifier(), |
| | | "--"+ToolConstants.OPTION_LONG_BINDPWD, |
| | | "--"+ToolConstants.OPTION_LONG_BINDPWD_FILE, |
| | | "--"+parser.forceOnErrorArg.getLongIdentifier(), |
| | | ae.getMessageObject().toString()); |
| | | throw new ApplicationException(ae.getType(), msg, ae); |
| | | } |
| | | else |
| | | { |