| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.util.cli; |
| | | |
| | | import org.opends.messages.Message; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import static org.opends.messages.UtilityMessages.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | |
| | | // The timeout to be used to connect |
| | | private int connectTimeout; |
| | | |
| | | private Message heading = INFO_LDAP_CONN_HEADING_CONNECTION_PARAMETERS.get(); |
| | | private LocalizableMessage heading = INFO_LDAP_CONN_HEADING_CONNECTION_PARAMETERS.get(); |
| | | |
| | | // A copy of the secureArgList for convenience. |
| | | private SecureConnectionCliArgs copySecureArgsList = null; |
| | |
| | | |
| | | private Integer choice; |
| | | |
| | | private Message msg; |
| | | private LocalizableMessage msg; |
| | | |
| | | /** |
| | | * Private constructor. |
| | |
| | | * @param msg |
| | | * the message message. |
| | | */ |
| | | private Protocols(int i, Message msg) |
| | | private Protocols(int i, LocalizableMessage msg) |
| | | { |
| | | choice = i; |
| | | this.msg = msg; |
| | |
| | | * |
| | | * @return the menu message. |
| | | */ |
| | | public Message getMenuMessage() |
| | | public LocalizableMessage getMenuMessage() |
| | | { |
| | | return msg; |
| | | } |
| | |
| | | |
| | | private Integer choice; |
| | | |
| | | private Message msg; |
| | | private LocalizableMessage msg; |
| | | |
| | | /** |
| | | * Private constructor. |
| | |
| | | * @param msg |
| | | * the message message. |
| | | */ |
| | | private TrustMethod(int i, Message msg) |
| | | private TrustMethod(int i, LocalizableMessage msg) |
| | | { |
| | | choice = new Integer(i); |
| | | this.msg = msg; |
| | |
| | | * |
| | | * @return the menu message. |
| | | */ |
| | | public Message getMenuMessage() |
| | | public LocalizableMessage getMenuMessage() |
| | | { |
| | | return msg; |
| | | } |
| | |
| | | |
| | | private Integer choice; |
| | | |
| | | private Message msg; |
| | | private LocalizableMessage msg; |
| | | |
| | | /** |
| | | * Private constructor. |
| | |
| | | * @param msg |
| | | * the message message. |
| | | */ |
| | | private TrustOption(int i, Message msg) |
| | | private TrustOption(int i, LocalizableMessage msg) |
| | | { |
| | | choice = new Integer(i); |
| | | this.msg = msg; |
| | |
| | | * |
| | | * @return the menu message. |
| | | */ |
| | | public Message getMenuMessage() |
| | | public LocalizableMessage getMenuMessage() |
| | | { |
| | | return msg; |
| | | } |
| | |
| | | try |
| | | { |
| | | app.println(); |
| | | Message askPortNumber = null; |
| | | LocalizableMessage askPortNumber = null; |
| | | if (secureArgsList.alwaysSSL()) { |
| | | askPortNumber = INFO_ADMIN_CONN_PROMPT_PORT_NUMBER.get(portNumber); |
| | | } else { |
| | |
| | | try |
| | | { |
| | | app.println(); |
| | | Message prompt; |
| | | LocalizableMessage prompt; |
| | | if (providedAdminUID != null) |
| | | { |
| | | prompt = INFO_LDAPAUTH_PASSWORD_PROMPT.get(providedAdminUID); |
| | |
| | | try |
| | | { |
| | | app.println(); |
| | | Message prompt = INFO_LDAP_CONN_PROMPT_SECURITY_TRUSTSTORE_PASSWORD |
| | | LocalizableMessage prompt = INFO_LDAP_CONN_PROMPT_SECURITY_TRUSTSTORE_PASSWORD |
| | | .get(truststorePath); |
| | | truststorePassword = app.readPassword(prompt); |
| | | } |
| | |
| | | try |
| | | { |
| | | app.println(); |
| | | Message prompt = INFO_LDAP_CONN_PROMPT_SECURITY_KEYSTORE_PASSWORD |
| | | LocalizableMessage prompt = INFO_LDAP_CONN_PROMPT_SECURITY_KEYSTORE_PASSWORD |
| | | .get(keystorePath); |
| | | keystorePassword = app.readPassword(prompt); |
| | | } |
| | |
| | | try |
| | | { |
| | | app.println(); |
| | | Message prompt = INFO_LDAP_CONN_PROMPT_SECURITY_KEYSTORE_PASSWORD |
| | | LocalizableMessage prompt = INFO_LDAP_CONN_PROMPT_SECURITY_KEYSTORE_PASSWORD |
| | | .get(truststorePath); |
| | | truststorePassword = app.readPassword(prompt); |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | Message msg = Utils.getThrowableMsg(INFO_ERROR_CONNECTING_TO_LOCAL.get(), |
| | | LocalizableMessage msg = Utils.getThrowableMsg(INFO_ERROR_CONNECTING_TO_LOCAL.get(), |
| | | t); |
| | | app.println(msg); |
| | | } |
| | |
| | | usedTrustManager.getLastRefusedChain(), |
| | | usedTrustManager.getLastRefusedAuthType(), excType); |
| | | |
| | | Message msg; |
| | | LocalizableMessage msg; |
| | | if (udce.getType() == UserDataCertificateException.Type.NOT_TRUSTED) |
| | | { |
| | | msg = INFO_CERTIFICATE_NOT_TRUSTED_TEXT_CLI.get( |
| | |
| | | * Sets the heading that is displayed in interactive mode. |
| | | * @param heading the heading that is displayed in interactive mode. |
| | | */ |
| | | public void setHeadingMessage(Message heading) |
| | | public void setHeadingMessage(LocalizableMessage heading) |
| | | { |
| | | this.heading = heading; |
| | | } |