| | |
| | | import org.opends.quicksetup.util.ServerController; |
| | | import org.opends.quicksetup.util.Utils; |
| | | import org.opends.server.admin.client.cli.SecureConnectionCliArgs; |
| | | import org.opends.server.tools.ClientException; |
| | | import org.opends.server.tools.JavaPropertiesTool.ErrorReturnCode; |
| | | import org.opends.server.tools.ToolConstants; |
| | | import org.opends.server.tools.dsconfig.LDAPManagementContextFactory; |
| | |
| | | import org.opends.server.util.cli.*; |
| | | |
| | | import com.forgerock.opendj.cli.ArgumentException; |
| | | import com.forgerock.opendj.cli.CLIException; |
| | | import com.forgerock.opendj.cli.ClientException; |
| | | |
| | | import static org.forgerock.util.Utils.*; |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | |
| | | throw new RuntimeException(); |
| | | } |
| | | } |
| | | catch (CLIException ce) |
| | | catch (ClientException ce) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Error reading input: "+ce, ce)); |
| | | throw new UserDataException(null, ce.getMessageObject(), ce); |
| | |
| | | } |
| | | } |
| | | } |
| | | catch (CLIException ce) |
| | | catch (ClientException ce) |
| | | { |
| | | throw new UserDataException(null, ce.getMessageObject(), ce); |
| | | } |
| | |
| | | cancelled = !confirmToStopServer(); |
| | | } |
| | | } |
| | | catch (CLIException ce) |
| | | catch (ClientException ce) |
| | | { |
| | | throw new UserDataException(null, ce.getMessageObject(), ce); |
| | | } |
| | |
| | | cancelled = !confirmDeleteFiles(); |
| | | } |
| | | } |
| | | catch (CLIException ce) |
| | | catch (ClientException ce) |
| | | { |
| | | throw new UserDataException(null, ce.getMessageObject(), ce); |
| | | } |
| | |
| | | userData.getStopServer())); |
| | | } |
| | | } |
| | | catch (CLIException ce) |
| | | catch (ClientException ce) |
| | | { |
| | | throw new UserDataException(null, ce.getMessageObject(), ce); |
| | | } |
| | |
| | | { |
| | | cancelled = !confirmDeleteFiles(); |
| | | } |
| | | catch (CLIException ce) |
| | | catch (ClientException ce) |
| | | { |
| | | throw new UserDataException(null, ce.getMessageObject(), ce); |
| | | } |
| | |
| | | * Ask for confirmation to stop server. |
| | | * @return <CODE>true</CODE> if the user wants to continue and stop the |
| | | * server. <CODE>false</CODE> otherwise. |
| | | * @throws CLIException if the user reached the confirmation limit. |
| | | * @throws ClientException if the user reached the confirmation limit. |
| | | */ |
| | | private boolean confirmToStopServer() throws CLIException |
| | | private boolean confirmToStopServer() throws ClientException |
| | | { |
| | | return askConfirmation(INFO_CLI_UNINSTALL_CONFIRM_STOP.get(), true, logger); |
| | | } |
| | |
| | | * Ask for confirmation to delete files. |
| | | * @return <CODE>true</CODE> if the user wants to continue and delete the |
| | | * files. <CODE>false</CODE> otherwise. |
| | | * @throws CLIException if the user reached the confirmation limit. |
| | | * @throws ClientException if the user reached the confirmation limit. |
| | | */ |
| | | private boolean confirmDeleteFiles() throws CLIException |
| | | private boolean confirmDeleteFiles() throws ClientException |
| | | { |
| | | return askConfirmation(INFO_CLI_UNINSTALL_CONFIRM_DELETE_FILES.get(), true, |
| | | logger); |
| | |
| | | * Ask for confirmation to update configuration on remote servers. |
| | | * @return <CODE>true</CODE> if the user wants to continue and stop the |
| | | * server. <CODE>false</CODE> otherwise. |
| | | * @throws CLIException if the user reached the confirmation limit. |
| | | * @throws ClientException if the user reached the confirmation limit. |
| | | */ |
| | | private boolean confirmToUpdateRemote() throws CLIException |
| | | private boolean confirmToUpdateRemote() throws ClientException |
| | | { |
| | | return askConfirmation(INFO_CLI_UNINSTALL_CONFIRM_UPDATE_REMOTE.get(), true, |
| | | logger); |
| | |
| | | * Ask for confirmation to update configuration on remote servers. |
| | | * @return <CODE>true</CODE> if the user wants to continue and stop the |
| | | * server. <CODE>false</CODE> otherwise. |
| | | * @throws CLIException if the user reached the confirmation limit. |
| | | * @throws ClientException if the user reached the confirmation limit. |
| | | */ |
| | | private boolean confirmToUpdateRemoteAndStart() throws CLIException |
| | | private boolean confirmToUpdateRemoteAndStart() throws ClientException |
| | | { |
| | | return askConfirmation( |
| | | INFO_CLI_UNINSTALL_CONFIRM_UPDATE_REMOTE_AND_START.get(), true, logger); |
| | |
| | | * Ask for confirmation to provide again authentication. |
| | | * @return <CODE>true</CODE> if the user wants to provide authentication |
| | | * again. <CODE>false</CODE> otherwise. |
| | | * @throws CLIException if the user reached the confirmation limit. |
| | | * @throws ClientException if the user reached the confirmation limit. |
| | | */ |
| | | private boolean promptToProvideAuthenticationAgain() throws CLIException |
| | | private boolean promptToProvideAuthenticationAgain() throws ClientException |
| | | { |
| | | return askConfirmation( |
| | | INFO_UNINSTALL_CONFIRM_PROVIDE_AUTHENTICATION_AGAIN.get(), true, logger); |
| | |
| | | pwd = null; |
| | | } |
| | | } |
| | | catch (CLIException ce) |
| | | catch (ClientException ce) |
| | | { |
| | | throw new UserDataException(null, ce.getMessageObject(), ce); |
| | | } |
| | |
| | | s = readInput(INFO_UNINSTALL_CLI_REFERENCED_HOSTNAME_PROMPT.get(), |
| | | defaultHostName); |
| | | } |
| | | catch (CLIException ce) |
| | | catch (ClientException ce) |
| | | { |
| | | logger.warn(LocalizableMessage.raw("Error reading input: %s", ce), ce); |
| | | } |
| | |
| | | ERR_UNINSTALL_NOT_UPDATE_REMOTE_PROMPT.get(), |
| | | false, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | catch (ClientException ce) |
| | | { |
| | | throw new UserDataException(null, ce.getMessageObject(), ce); |
| | | } |
| | |
| | | Utils.getMessageFromCollection(exceptionMsgs, |
| | | Constants.LINE_SEPARATOR)), true, logger); |
| | | } |
| | | catch (CLIException ce) |
| | | catch (ClientException ce) |
| | | { |
| | | throw new UserDataException(null, ce.getMessageObject(), ce); |
| | | } |