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/schema/UserPasswordSyntax.java | 45 ++++++++++++++++++++-------------------------
1 files changed, 20 insertions(+), 25 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/schema/UserPasswordSyntax.java b/opendj-sdk/opends/src/server/org/opends/server/schema/UserPasswordSyntax.java
index 0e504c9..3ed29cc 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/schema/UserPasswordSyntax.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/schema/UserPasswordSyntax.java
@@ -25,6 +25,7 @@
* Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
package org.opends.server.schema;
+import org.opends.messages.Message;
@@ -38,18 +39,17 @@
import org.opends.server.core.DirectoryServer;
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.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.MessageBuilder;
import static org.opends.server.schema.SchemaConstants.*;
import static org.opends.server.util.StaticUtils.*;
-
/**
* This class defines an attribute syntax used for storing values that have been
* encoded using a password storage scheme. The format for attribute values
@@ -94,9 +94,8 @@
DirectoryServer.getEqualityMatchingRule(EMR_USER_PASSWORD_EXACT_OID);
if (defaultEqualityMatchingRule == null)
{
- logError(ErrorLogCategory.SCHEMA, ErrorLogSeverity.SEVERE_ERROR,
- MSGID_ATTR_SYNTAX_UNKNOWN_EQUALITY_MATCHING_RULE,
- EMR_USER_PASSWORD_EXACT_NAME, SYNTAX_USER_PASSWORD_NAME);
+ logError(ERR_ATTR_SYNTAX_UNKNOWN_EQUALITY_MATCHING_RULE.get(
+ EMR_USER_PASSWORD_EXACT_NAME, SYNTAX_USER_PASSWORD_NAME));
}
}
@@ -214,7 +213,7 @@
* this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(ByteString value,
- StringBuilder invalidReason)
+ MessageBuilder invalidReason)
{
// We have to accept any value here because in many cases the value will not
// have been encoded by the time this method is called.
@@ -241,20 +240,18 @@
// Make sure that there actually is a value to decode.
if ((userPasswordValue == null) || (userPasswordValue.length() == 0))
{
- int msgID = MSGID_ATTR_SYNTAX_USERPW_NO_VALUE;
- String message = getMessage(msgID);
- throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
- msgID);
+ Message message = ERR_ATTR_SYNTAX_USERPW_NO_VALUE.get();
+ throw new DirectoryException(
+ ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
}
// The first character of an encoded value must be an opening curly brace.
if (userPasswordValue.charAt(0) != '{')
{
- int msgID = MSGID_ATTR_SYNTAX_USERPW_NO_OPENING_BRACE;
- String message = getMessage(msgID);
- throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
- msgID);
+ Message message = ERR_ATTR_SYNTAX_USERPW_NO_OPENING_BRACE.get();
+ throw new DirectoryException(
+ ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
}
@@ -262,10 +259,9 @@
int closePos = userPasswordValue.indexOf('}');
if (closePos < 0)
{
- int msgID = MSGID_ATTR_SYNTAX_USERPW_NO_CLOSING_BRACE;
- String message = getMessage(msgID);
- throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
- msgID);
+ Message message = ERR_ATTR_SYNTAX_USERPW_NO_CLOSING_BRACE.get();
+ throw new DirectoryException(
+ ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
}
@@ -275,10 +271,9 @@
if (schemeName.length() == 0)
{
- int msgID = MSGID_ATTR_SYNTAX_USERPW_NO_SCHEME;
- String message = getMessage(msgID);
- throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
- msgID);
+ Message message = ERR_ATTR_SYNTAX_USERPW_NO_SCHEME.get();
+ throw new DirectoryException(
+ ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
}
--
Gitblit v1.10.0