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/schema/CaseExactIA5SubstringMatchingRule.java |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/opends/src/server/org/opends/server/schema/CaseExactIA5SubstringMatchingRule.java b/opends/src/server/org/opends/server/schema/CaseExactIA5SubstringMatchingRule.java
index 2a6ffd1..12aaca8 100644
--- a/opends/src/server/org/opends/server/schema/CaseExactIA5SubstringMatchingRule.java
+++ b/opends/src/server/org/opends/server/schema/CaseExactIA5SubstringMatchingRule.java
@@ -34,17 +34,16 @@
 import org.opends.server.api.SubstringMatchingRule;
 import org.opends.server.config.ConfigException;
 import org.opends.server.core.DirectoryServer;
+
 import org.opends.server.protocols.asn1.ASN1OctetString;
 import org.opends.server.types.ByteString;
 import org.opends.server.types.DirectoryException;
-import org.opends.server.types.ErrorLogCategory;
-import org.opends.server.types.ErrorLogSeverity;
 import org.opends.server.types.InitializationException;
 import org.opends.server.types.ResultCode;
 
 import static org.opends.server.loggers.ErrorLogger.*;
-import static org.opends.server.messages.MessageHandler.*;
-import static org.opends.server.messages.SchemaMessages.*;
+import static org.opends.messages.SchemaMessages.*;
+import org.opends.messages.Message;
 import static org.opends.server.schema.SchemaConstants.*;
 
 
@@ -182,19 +181,18 @@
         // This is not a valid character for an IA5 string.  If strict syntax
         // enforcement is enabled, then we'll throw an exception.  Otherwise,
         // we'll get rid of the character.
-        int    msgID   = MSGID_ATTR_SYNTAX_IA5_ILLEGAL_CHARACTER;
-        String message = getMessage(msgID, value.stringValue(), c);
+        Message message = WARN_ATTR_SYNTAX_IA5_ILLEGAL_CHARACTER.get(
+                value.stringValue(), String.valueOf(c));
 
         switch (DirectoryServer.getSyntaxEnforcementPolicy())
         {
           case REJECT:
             throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
-                                         message, msgID);
+                                         message);
           case WARN:
             if (! logged)
             {
-              logError(ErrorLogCategory.SCHEMA, ErrorLogSeverity.SEVERE_WARNING,
-                       message, msgID);
+              logError(message);
               logged = true;
             }
 
@@ -268,19 +266,18 @@
         // This is not a valid character for an IA5 string.  If strict syntax
         // enforcement is enabled, then we'll throw an exception.  Otherwise,
         // we'll get rid of the character.
-        int    msgID   = MSGID_ATTR_SYNTAX_IA5_ILLEGAL_CHARACTER;
-        String message = getMessage(msgID, substring.stringValue(), c);
+        Message message = WARN_ATTR_SYNTAX_IA5_ILLEGAL_CHARACTER.get(
+                substring.stringValue(), String.valueOf(c));
 
         switch (DirectoryServer.getSyntaxEnforcementPolicy())
         {
           case REJECT:
             throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
-                                         message, msgID);
+                                         message);
           case WARN:
             if (! logged)
             {
-              logError(ErrorLogCategory.SCHEMA, ErrorLogSeverity.SEVERE_WARNING,
-                       message, msgID);
+              logError(message);
               logged = true;
             }
 

--
Gitblit v1.10.0