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/config/ReadOnlyConfigAttribute.java | 53 ++++++++++++++++++++++++-----------------------------
1 files changed, 24 insertions(+), 29 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/config/ReadOnlyConfigAttribute.java b/opendj-sdk/opends/src/server/org/opends/server/config/ReadOnlyConfigAttribute.java
index f4fcb79..23498b6 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/config/ReadOnlyConfigAttribute.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/config/ReadOnlyConfigAttribute.java
@@ -25,6 +25,7 @@
* Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
package org.opends.server.config;
+import org.opends.messages.Message;
@@ -42,10 +43,7 @@
import org.opends.server.types.AttributeValue;
import static org.opends.server.config.ConfigConstants.*;
-import static org.opends.server.messages.ConfigMessages.*;
-import static org.opends.server.messages.MessageHandler.*;
-
-
+import static org.opends.messages.ConfigMessages.*;
/**
* This class defines a configuration attribute that is only intended for use
* in displaying information. It will not allow its value to be altered.
@@ -71,7 +69,7 @@
* @param isMultiValued Indicates whether this configuration attribute may
* have multiple values.
*/
- public ReadOnlyConfigAttribute(String name, String description,
+ public ReadOnlyConfigAttribute(String name, Message description,
boolean isMultiValued)
{
super(name, description, false, isMultiValued, false);
@@ -90,7 +88,7 @@
* @param description The description for this configuration attribute.
* @param value The value for this configuration attribute.
*/
- public ReadOnlyConfigAttribute(String name, String description, String value)
+ public ReadOnlyConfigAttribute(String name, Message description, String value)
{
super(name, description, false, false, false, getValueSet(value));
@@ -116,7 +114,7 @@
* @param description The description for this configuration attribute.
* @param values The set of values for this configuration attribute.
*/
- public ReadOnlyConfigAttribute(String name, String description,
+ public ReadOnlyConfigAttribute(String name, Message description,
List<String> values)
{
super(name, description, false, true, false, getValueSet(values));
@@ -175,16 +173,14 @@
{
if ((values == null) || values.isEmpty())
{
- int msgID = MSGID_CONFIG_ATTR_NO_STRING_VALUE;
- String message = getMessage(msgID, getName());
- throw new ConfigException(msgID, message);
+ Message message = ERR_CONFIG_ATTR_NO_STRING_VALUE.get(getName());
+ throw new ConfigException(message);
}
if (values.size() > 1)
{
- int msgID = MSGID_CONFIG_ATTR_MULTIPLE_STRING_VALUES;
- String message = getMessage(msgID, getName());
- throw new ConfigException(msgID, message);
+ Message message = ERR_CONFIG_ATTR_MULTIPLE_STRING_VALUES.get(getName());
+ throw new ConfigException(message);
}
return values.get(0);
@@ -247,9 +243,8 @@
public void setValue(String value)
throws ConfigException
{
- int msgID = MSGID_CONFIG_ATTR_READ_ONLY;
- String message = getMessage(msgID, getName());
- throw new ConfigException(msgID, message);
+ Message message = ERR_CONFIG_ATTR_READ_ONLY.get(getName());
+ throw new ConfigException(message);
}
@@ -265,9 +260,8 @@
public void setValues(List<String> values)
throws ConfigException
{
- int msgID = MSGID_CONFIG_ATTR_READ_ONLY;
- String message = getMessage(msgID, getName());
- throw new ConfigException(msgID, message);
+ Message message = ERR_CONFIG_ATTR_READ_ONLY.get(getName());
+ throw new ConfigException(message);
}
@@ -346,7 +340,7 @@
public boolean valueIsAcceptable(AttributeValue value,
StringBuilder rejectReason)
{
- rejectReason.append(getMessage(MSGID_CONFIG_ATTR_READ_ONLY, getName()));
+ rejectReason.append(ERR_CONFIG_ATTR_READ_ONLY.get(getName()));
return false;
}
@@ -547,15 +541,17 @@
{
attributeInfoList.add(new MBeanAttributeInfo(getName(),
JMX_TYPE_STRING_ARRAY,
- getDescription(), true,
- false, false));
+ String.valueOf(
+ getDescription()),
+ true, false, false));
}
else
{
attributeInfoList.add(new MBeanAttributeInfo(getName(),
String.class.getName(),
- getDescription(), true,
- false, false));
+ String.valueOf(
+ getDescription()),
+ true, false, false));
}
}
@@ -573,12 +569,12 @@
if (isMultiValued())
{
return new MBeanParameterInfo(getName(), JMX_TYPE_STRING_ARRAY,
- getDescription());
+ String.valueOf(getDescription()));
}
else
{
return new MBeanParameterInfo(getName(), String.class.getName(),
- getDescription());
+ String.valueOf(getDescription()));
}
}
@@ -598,9 +594,8 @@
public void setValue(javax.management.Attribute jmxAttribute)
throws ConfigException
{
- int msgID = MSGID_CONFIG_ATTR_READ_ONLY;
- String message = getMessage(msgID, getName());
- throw new ConfigException(msgID, message);
+ Message message = ERR_CONFIG_ATTR_READ_ONLY.get(getName());
+ throw new ConfigException(message);
}
--
Gitblit v1.10.0