From 1b9f39db0f5450de6c3bb97cec681c342fff5944 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Tue, 08 Dec 2009 10:52:42 +0000
Subject: [PATCH] Move Message/MessageBuilder/LocalizableException/LocalizableIllegalArgumentException to public API since other public API elements reference them. Prefix Message/MessageBuilder with Localizable to emphasize that these classes are I18N related and not protocol messages. Keep MessageDescriptor private since users should not need access to it for now.

---
 sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java |   38 ++++++++++++++++++--------------------
 1 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java b/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java
index 7d2bf3f..34975e0 100644
--- a/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java
+++ b/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java
@@ -56,8 +56,6 @@
 import org.opends.sdk.requests.Requests;
 import org.opends.sdk.sasl.*;
 
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
 import com.sun.opends.sdk.util.SSLUtils;
 import com.sun.opends.sdk.util.StaticUtils;
 
@@ -234,7 +232,7 @@
     hostNameArg.setPropertyName(OPTION_LONG_HOST);
     argumentParser.addLdapConnectionArgument(hostNameArg);
 
-    Message portDescription = INFO_DESCRIPTION_PORT.get();
+    LocalizableMessage portDescription = INFO_DESCRIPTION_PORT.get();
     if (alwaysSSL)
     {
       portDescription = INFO_DESCRIPTION_ADMIN_PORT.get();
@@ -367,7 +365,7 @@
     // Couldn't have at the same time bindPassword and bindPasswordFile
     if (bindPasswordArg.isPresent() && bindPasswordFileArg.isPresent())
     {
-      Message message = ERR_TOOL_CONFLICTING_ARGS
+      LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS
           .get(bindPasswordArg.getLongIdentifier(), bindPasswordFileArg
               .getLongIdentifier());
       throw new ArgumentException(message);
@@ -377,13 +375,13 @@
     // trustStore related arg
     if (trustAllArg.isPresent() && trustStorePathArg.isPresent())
     {
-      Message message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
+      LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
           .getLongIdentifier(), trustStorePathArg.getLongIdentifier());
       throw new ArgumentException(message);
     }
     if (trustAllArg.isPresent() && trustStorePasswordArg.isPresent())
     {
-      Message message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
+      LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
           .getLongIdentifier(), trustStorePasswordArg
           .getLongIdentifier());
       throw new ArgumentException(message);
@@ -391,7 +389,7 @@
     if (trustAllArg.isPresent()
         && trustStorePasswordFileArg.isPresent())
     {
-      Message message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
+      LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
           .getLongIdentifier(), trustStorePasswordFileArg
           .getLongIdentifier());
       throw new ArgumentException(message);
@@ -402,7 +400,7 @@
     if (trustStorePasswordArg.isPresent()
         && trustStorePasswordFileArg.isPresent())
     {
-      Message message = ERR_TOOL_CONFLICTING_ARGS.get(
+      LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(
           trustStorePasswordArg.getLongIdentifier(),
           trustStorePasswordFileArg.getLongIdentifier());
       throw new ArgumentException(message);
@@ -414,7 +412,7 @@
       String value = trustStorePathArg.getValue();
       if (!canRead(trustStorePathArg.getValue()))
       {
-        Message message = ERR_CANNOT_READ_TRUSTSTORE.get(value);
+        LocalizableMessage message = ERR_CANNOT_READ_TRUSTSTORE.get(value);
         throw new ArgumentException(message);
       }
     }
@@ -425,7 +423,7 @@
       String value = keyStorePathArg.getValue();
       if (!canRead(trustStorePathArg.getValue()))
       {
-        Message message = ERR_CANNOT_READ_KEYSTORE.get(value);
+        LocalizableMessage message = ERR_CANNOT_READ_KEYSTORE.get(value);
         throw new ArgumentException(message);
       }
     }
@@ -434,7 +432,7 @@
     // useSSLArg
     if (useStartTLSArg.isPresent() && useSSLArg.isPresent())
     {
-      Message message = ERR_TOOL_CONFLICTING_ARGS.get(useStartTLSArg
+      LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(useStartTLSArg
           .getLongIdentifier(), useSSLArg.getLongIdentifier());
       throw new ArgumentException(message);
     }
@@ -495,7 +493,7 @@
     }
     catch (CLIException e)
     {
-      throw new ArgumentException(Message.raw("Error reading input: "
+      throw new ArgumentException(LocalizableMessage.raw("Error reading input: "
           + e.toString()));
     }
     if (bindRequest != null)
@@ -553,7 +551,7 @@
       }
       catch (LoginException e)
       {
-        Message message = ERR_LDAPAUTH_GSSAPI_LOCAL_AUTHENTICATION_FAILED
+        LocalizableMessage message = ERR_LDAPAUTH_GSSAPI_LOCAL_AUTHENTICATION_FAILED
             .get(StaticUtils.getExceptionMessage(e));
         throw new ArgumentException(message, e);
       }
@@ -562,12 +560,12 @@
     {
       if (sslContext == null)
       {
-        Message message = ERR_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS.get();
+        LocalizableMessage message = ERR_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS.get();
         throw new ArgumentException(message);
       }
       if (!keyStorePathArg.isPresent() && getKeyStore() == null)
       {
-        Message message = ERR_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE.get();
+        LocalizableMessage message = ERR_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE.get();
         throw new ArgumentException(message);
       }
       return new ExternalSASLBindRequest(getAuthzID());
@@ -594,7 +592,7 @@
     }
     else if (app.isInteractive())
     {
-      value = app.readInput(Message.raw("Bind DN:"), bindDnArg
+      value = app.readInput(LocalizableMessage.raw("Bind DN:"), bindDnArg
           .getDefaultValue() == null ? value : bindDnArg
           .getDefaultValue());
     }
@@ -629,13 +627,13 @@
     }
     if (value == null && app.isInteractive())
     {
-      value = app.readInput(Message.raw("Authentication ID:"),
+      value = app.readInput(LocalizableMessage.raw("Authentication ID:"),
           bindDnArg.getDefaultValue() == null ? null : "dn: "
               + bindDnArg.getDefaultValue());
     }
     if (value == null)
     {
-      Message message = ERR_LDAPAUTH_SASL_AUTHID_REQUIRED.get(mech);
+      LocalizableMessage message = ERR_LDAPAUTH_SASL_AUTHID_REQUIRED.get(mech);
       throw new ArgumentException(message);
     }
     return value;
@@ -679,7 +677,7 @@
     }
     if (value.length() == 0 && app.isInteractive())
     {
-      value = app.readLineOfInput(Message.raw("Bind Password:"));
+      value = app.readLineOfInput(LocalizableMessage.raw("Bind Password:"));
     }
 
     return ByteString.valueOf(value);
@@ -906,7 +904,7 @@
     int equalPos = option.indexOf('=');
     if (equalPos <= 0)
     {
-      Message message = ERR_LDAP_CONN_CANNOT_PARSE_SASL_OPTION
+      LocalizableMessage message = ERR_LDAP_CONN_CANNOT_PARSE_SASL_OPTION
           .get(option);
       throw new ArgumentException(message);
     }

--
Gitblit v1.10.0