From cfc513043c5830b5a967733066068c7097b42e3c 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.

---
 opendj-sdk/opends/src/server/org/opends/server/controls/GetEffectiveRights.java |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/controls/GetEffectiveRights.java b/opendj-sdk/opends/src/server/org/opends/server/controls/GetEffectiveRights.java
index 358e7d0..8b513fc 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/controls/GetEffectiveRights.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/controls/GetEffectiveRights.java
@@ -26,6 +26,7 @@
  */
 
 package org.opends.server.controls;
+import org.opends.messages.Message;
 
 import org.opends.server.types.*;
 import org.opends.server.protocols.asn1.ASN1OctetString;
@@ -36,8 +37,7 @@
 import static org.opends.server.util.Validator.ensureNotNull;
 import static org.opends.server.util.StaticUtils.toLowerCase;
 import org.opends.server.core.DirectoryServer;
-import static org.opends.server.messages.ProtocolMessages.*;
-import static org.opends.server.messages.MessageHandler.getMessage;
+import static org.opends.messages.ProtocolMessages.*;
 import static org.opends.server.loggers.debug.DebugLogger.*;
 import org.opends.server.loggers.debug.DebugTracer;
 
@@ -199,27 +199,26 @@
       if (lowerAuthzIDString.startsWith("dn:"))
          authzDN = DN.decode(authzIDString.substring(3));
       else {
-         int  msgID = MSGID_GETEFFECTIVERIGHTS_INVALID_AUTHZID;
-         String message = getMessage(msgID, authzID);
-         throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID, message);
+         Message message = INFO_GETEFFECTIVERIGHTS_INVALID_AUTHZID.get(
+                 String.valueOf(authzID));
+         throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
       }
     } catch (ASN1Exception e) {
          if (debugEnabled()) {
             TRACER.debugCaught(DebugLogLevel.ERROR, e);
          }
 
-         int msgID = MSGID_GETEFFECTIVERIGHTS_DECODE_ERROR;
-         String message = getMessage(msgID, e.getMessage());
-         throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID, message);
+         Message message =
+             INFO_GETEFFECTIVERIGHTS_DECODE_ERROR.get(e.getMessage());
+         throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
     } catch (DirectoryException de) {
         if (debugEnabled()) {
           TRACER.debugCaught(DebugLogLevel.ERROR, de);
         }
 
-        int msgID  = MSGID_CANNOT_DECODE_GETEFFECTIVERIGHTS_AUTHZID_DN;
-        String message =
-        getMessage(msgID, authzIDString.substring(3), de.getErrorMessage());
-        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, msgID, message);
+        Message message = INFO_CANNOT_DECODE_GETEFFECTIVERIGHTS_AUTHZID_DN.get(
+            authzIDString.substring(3), de.getMessageObject());
+        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
     }
     return new GetEffectiveRights(val, authzDN, attrs);
   }

--
Gitblit v1.10.0