| | |
| | | |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | import static org.opends.messages.UtilityMessages.*; |
| | | |
| | | import org.opends.quicksetup.*; |
| | | import org.opends.quicksetup.event.ProgressUpdateEvent; |
| | |
| | | * and null if the user cancels the uninstallation. |
| | | * @throws UserDataException if there is an error with the data |
| | | * in the arguments. |
| | | * @throws ApplicationException if there is an error processing data in |
| | | * non-interactive mode and an error must be thrown (not in force on error |
| | | * mode). |
| | | */ |
| | | public UninstallUserData createUserData(UninstallerArgumentParser args, |
| | | String[] rawArguments) |
| | | throws UserDataException |
| | | throws UserDataException, ApplicationException |
| | | { |
| | | parser = args; |
| | | UninstallUserData userData = new UninstallUserData(); |
| | |
| | | * @return <CODE>true</CODE> if the user wants to continue with uninstall and |
| | | * <CODE>false</CODE> otherwise. |
| | | * @throws UserDataException if there is a problem with the data |
| | | * provided by the user (in the particular case where we are on quiet |
| | | * uninstall and some data is missing or not valid). |
| | | * provided by the user (in the particular case where we are on |
| | | * non-interactive uninstall and some data is missing or not valid). |
| | | * @throws ApplicationException if there is an error processing data in |
| | | * non-interactive mode and an error must be thrown (not in force on error |
| | | * mode). |
| | | */ |
| | | private boolean checkServerState(UninstallUserData userData) |
| | | throws UserDataException |
| | | throws UserDataException, ApplicationException |
| | | { |
| | | boolean cancelled = false; |
| | | boolean interactive = parser.isInteractive(); |
| | |
| | | } |
| | | else |
| | | { |
| | | cancelled = |
| | | boolean errorWithRemote = |
| | | !updateUserUninstallDataWithRemoteServers(userData); |
| | | cancelled = errorWithRemote && !parser.isForceOnError(); |
| | | } |
| | | } |
| | | else |
| | |
| | | if (startWorked) |
| | | { |
| | | userData.setStopServer(true); |
| | | cancelled = |
| | | boolean errorWithRemote = |
| | | !updateUserUninstallDataWithRemoteServers(userData); |
| | | cancelled = errorWithRemote && !parser.isForceOnError(); |
| | | } |
| | | else |
| | | { |
| | |
| | | * <CODE>false</CODE> otherwise. |
| | | * @throws UserDataException if were are not in interactive mode and not in |
| | | * force on error mode and the operation must be stopped. |
| | | * @throws ApplicationException if there is an error processing data in |
| | | * non-interactive mode and an error must be thrown (not in force on error |
| | | * mode). |
| | | */ |
| | | private boolean updateUserUninstallDataWithRemoteServers( |
| | | UninstallUserData userData) throws UserDataException |
| | | UninstallUserData userData) throws UserDataException, ApplicationException |
| | | { |
| | | boolean accepted = false; |
| | | boolean interactive = parser.isInteractive(); |
| | |
| | | println(); |
| | | println(Utils.getMessage(te)); |
| | | |
| | | } catch (ApplicationException ae) |
| | | { |
| | | throw ae; |
| | | |
| | | } catch (Throwable t) |
| | | { |
| | | LOG.log(Level.WARNING, "Error connecting to server: "+t, t); |
| | |
| | | * @param userData the user data. |
| | | * @throws UserDataException if there is an error with the information |
| | | * provided by the user when we are in non-interactive mode. |
| | | * @throws ApplicationException if there is an error processing data in |
| | | * non-interactive mode and an error must be thrown (not in force on error |
| | | * mode). |
| | | */ |
| | | private boolean handleTopologyCache(TopologyCache cache, |
| | | UninstallUserData userData) throws UserDataException |
| | | UninstallUserData userData) throws UserDataException, ApplicationException |
| | | { |
| | | boolean returnValue; |
| | | boolean stopProcessing = false; |
| | |
| | | } |
| | | else |
| | | { |
| | | stopProcessing = true; |
| | | println(); |
| | | println(INFO_ERROR_READING_CONFIG_LDAP_CERTIFICATE_SERVER.get( |
| | | exceptionMsgs.add( |
| | | INFO_ERROR_READING_CONFIG_LDAP_CERTIFICATE_SERVER.get( |
| | | e.getHostPort(), e.getCause().getMessage())); |
| | | } |
| | | } |
| | |
| | | { |
| | | if (exceptionMsgs.size() > 0) |
| | | { |
| | | Message msg = Utils.getMessageFromCollection(exceptionMsgs, |
| | | Constants.LINE_SEPARATOR); |
| | | if (parser.isForceOnError()) |
| | | { |
| | | println(); |
| | | println(Utils.getMessageFromCollection(exceptionMsgs, |
| | | Constants.LINE_SEPARATOR)); |
| | | println(msg); |
| | | returnValue = false; |
| | | } |
| | | else |
| | | { |
| | | throw new ApplicationException(ReturnCode.APPLICATION_ERROR, msg, |
| | | null); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | returnValue = true; |
| | | } |
| | | } |