From 80c58327faaa4873369f6bb949e62792c2f708e0 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Wed, 15 Aug 2007 21:34:53 +0000
Subject: [PATCH] This commit is a step toward getting OpenDS internationalized. There are still issues to be resolved before we can declare that we are internationalized but this commit covers the bulk of changes needed at this time.

---
 opends/src/server/org/opends/server/protocols/jmx/RmiAuthenticator.java |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/opends/src/server/org/opends/server/protocols/jmx/RmiAuthenticator.java b/opends/src/server/org/opends/server/protocols/jmx/RmiAuthenticator.java
index 1fcd21f..cbc28b4 100644
--- a/opends/src/server/org/opends/server/protocols/jmx/RmiAuthenticator.java
+++ b/opends/src/server/org/opends/server/protocols/jmx/RmiAuthenticator.java
@@ -25,6 +25,7 @@
  *      Portions Copyright 2006-2007 Sun Microsystems, Inc.
  */
 package org.opends.server.protocols.jmx;
+import org.opends.messages.Message;
 
 import java.util.*;
 
@@ -35,7 +36,7 @@
 import org.opends.server.core.BindOperationBasis;
 import org.opends.server.core.DirectoryServer;
 import org.opends.server.core.PluginConfigManager;
-import org.opends.server.messages.CoreMessages;
+import org.opends.messages.CoreMessages;
 import org.opends.server.protocols.asn1.ASN1OctetString;
 import org.opends.server.protocols.ldap.LDAPResultCode;
 import org.opends.server.types.Control;
@@ -47,8 +48,7 @@
 import org.opends.server.types.LDAPException;
 
 import static org.opends.server.loggers.debug.DebugLogger.*;
-import static org.opends.server.messages.MessageHandler.getMessage;
-import static org.opends.server.messages.ProtocolMessages.*;
+import static org.opends.messages.ProtocolMessages.*;
 
 import org.opends.server.loggers.debug.DebugTracer;
 import org.opends.server.types.DebugLogLevel;
@@ -247,7 +247,7 @@
     {
       LDAPException ldapEx = new LDAPException(
           LDAPResultCode.INVALID_CREDENTIALS,
-          CoreMessages.MSGID_RESULT_INVALID_CREDENTIALS, null);
+          CoreMessages.INFO_RESULT_INVALID_CREDENTIALS.get());
       SecurityException se = new SecurityException();
       se.initCause(ldapEx);
       throw se;
@@ -286,14 +286,12 @@
       // Check JMX_READ privilege.
       if (! jmxClientConnection.hasPrivilege(Privilege.JMX_READ, null))
       {
-        int msgID = MSGID_JMX_INSUFFICIENT_PRIVILEGES;
-        String message = getMessage(msgID);
+        Message message = ERR_JMX_INSUFFICIENT_PRIVILEGES.get();
 
         jmxClientConnection.disconnect(DisconnectReason.CONNECTION_REJECTED,
-            false, msgID);
+            false, message);
 
-        SecurityException se = new SecurityException(message);
-        throw se;
+        throw new SecurityException(message.toString());
       }
       return jmxClientConnection;
     }
@@ -303,7 +301,7 @@
       // Set the initcause.
       LDAPException ldapEx = new LDAPException(
           LDAPResultCode.INVALID_CREDENTIALS,
-          CoreMessages.MSGID_RESULT_INVALID_CREDENTIALS, null);
+          CoreMessages.INFO_RESULT_INVALID_CREDENTIALS.get());
       SecurityException se = new SecurityException("return code: "
           + bindOp.getResultCode());
       se.initCause(ldapEx);

--
Gitblit v1.10.0