From 1b9f39db0f5450de6c3bb97cec681c342fff5944 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Tue, 08 Dec 2009 10:52:42 +0000
Subject: [PATCH] Move Message/MessageBuilder/LocalizableException/LocalizableIllegalArgumentException to public API since other public API elements reference them. Prefix Message/MessageBuilder with Localizable to emphasize that these classes are I18N related and not protocol messages. Keep MessageDescriptor private since users should not need access to it for now.
---
sdk/src/org/opends/sdk/AttributeDescription.java | 24
sdk/src/org/opends/sdk/requests/SearchRequestImpl.java | 6
sdk/src/org/opends/sdk/schema/IntegerFirstComponentEqualityMatchingRuleImpl.java | 7
sdk/src/com/sun/opends/sdk/tools/Argument.java | 51
sdk/src/org/opends/sdk/asn1/ASN1ByteSequenceReader.java | 42
sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java | 38
sdk/src/org/opends/sdk/schema/BooleanSyntaxImpl.java | 4
sdk/resource/Messages.java.stub | 2
sdk/src/com/sun/opends/sdk/tools/PromptingTrustManager.java | 15
sdk/src/org/opends/sdk/AbstractConnection.java | 1
sdk/src/org/opends/sdk/controls/PostReadControl.java | 10
sdk/src/org/opends/sdk/schema/DeliveryMethodSyntaxImpl.java | 4
sdk/src/org/opends/sdk/schema/UserPasswordSyntaxImpl.java | 14
sdk/src/org/opends/sdk/schema/NameAndOptionalUIDSyntaxImpl.java | 6
sdk/src/org/opends/sdk/extensions/GetConnectionIDRequest.java | 6
sdk/src/com/sun/opends/sdk/tools/IntegerArgument.java | 47
sdk/src/org/opends/sdk/LocalizedIllegalArgumentException.java | 11
sdk/src/org/opends/sdk/schema/DirectoryStringSyntaxImpl.java | 4
sdk/src/org/opends/sdk/asn1/ASN1OutputStreamWriter.java | 4
sdk/src/org/opends/sdk/schema/DistinguishedNameSyntaxImpl.java | 6
sdk/src/org/opends/sdk/controls/PasswordPolicyControl.java | 12
sdk/src/com/sun/opends/sdk/tools/StringArgument.java | 16
sdk/src/org/opends/sdk/requests/ModifyDNRequest.java | 2
sdk/src/org/opends/sdk/controls/AssertionControl.java | 8
sdk/src/org/opends/sdk/extensions/CancelRequest.java | 8
sdk/src/com/sun/opends/sdk/tools/Utils.java | 42
sdk/src/org/opends/sdk/sasl/AbstractSASLContext.java | 22
sdk/src/org/opends/sdk/schema/Schema.java | 4
sdk/build-tools/com/sun/opends/sdk/build/tools/GenerateMessageFile.java | 10
sdk/src/org/opends/sdk/schema/DITContentRule.java | 23
sdk/src/org/opends/sdk/controls/PasswordExpiringControl.java | 6
sdk/src/org/opends/sdk/schema/OIDSyntaxImpl.java | 4
sdk/src/org/opends/sdk/schema/UUIDEqualityMatchingRuleImpl.java | 8
sdk/src/org/opends/sdk/schema/GuideSyntaxImpl.java | 6
sdk/src/org/opends/sdk/ldap/ASN1StreamWriter.java | 4
sdk/src/org/opends/sdk/schema/RegexSyntaxImpl.java | 8
sdk/src/org/opends/sdk/extensions/PasswordPolicyStateExtendedOperation.java | 5
sdk/src/org/opends/sdk/requests/ModifyDNRequestImpl.java | 2
sdk/src/org/opends/sdk/asn1/ASN1InputStreamReader.java | 40
sdk/src/com/sun/opends/sdk/tools/LDAPPasswordModify.java | 17
sdk/src/org/opends/sdk/ldap/UnsupportedMessageException.java | 2
sdk/src/org/opends/sdk/schema/CertificateListSyntaxImpl.java | 4
sdk/src/com/sun/opends/sdk/util/LocalizableMessageDescriptor.java | 592 +++-----
sdk/src/org/opends/sdk/schema/SubstringAssertionSyntaxImpl.java | 4
sdk/src/org/opends/sdk/schema/PostalAddressSyntaxImpl.java | 4
sdk/src/org/opends/sdk/DN.java | 4
sdk/src/org/opends/sdk/controls/ServerSideSortControl.java | 18
sdk/src/org/opends/sdk/requests/CompareRequestImpl.java | 2
sdk/src/org/opends/sdk/schema/MatchingRuleSyntaxImpl.java | 14
sdk/src/org/opends/sdk/schema/TelexNumberSyntaxImpl.java | 4
sdk/src/org/opends/sdk/sasl/GSSAPISASLBindRequest.java | 6
sdk/src/org/opends/sdk/controls/PasswordExpiredControl.java | 4
sdk/src/com/sun/opends/sdk/tools/LDAPSearch.java | 62
sdk/src/org/opends/sdk/controls/PreReadControl.java | 10
sdk/src/org/opends/sdk/requests/GenericBindRequestImpl.java | 2
sdk/src/org/opends/sdk/controls/ProxiedAuthV1Control.java | 8
sdk/src/org/opends/sdk/schema/UnknownSchemaElementException.java | 7
sdk/src/org/opends/sdk/controls/SubtreeDeleteControl.java | 4
sdk/src/org/opends/sdk/requests/Requests.java | 6
sdk/src/org/opends/sdk/schema/ObjectClass.java | 19
sdk/src/org/opends/sdk/controls/ProxiedAuthV2Control.java | 8
sdk/src/org/opends/sdk/ldap/LDAPConnection.java | 1
sdk/src/org/opends/sdk/schema/FacsimileNumberSyntaxImpl.java | 4
sdk/src/com/sun/opends/sdk/tools/CLIException.java | 13
sdk/src/org/opends/sdk/requests/AddRequest.java | 1
sdk/src/org/opends/sdk/requests/SearchRequest.java | 6
sdk/src/com/sun/opends/sdk/tools/ConsoleApplication.java | 21
sdk/src/com/sun/opends/sdk/tools/SearchRate.java | 9
sdk/src/org/opends/sdk/schema/CertificatePairSyntaxImpl.java | 4
sdk/src/com/sun/opends/sdk/util/Base64.java | 8
sdk/src/org/opends/sdk/schema/SchemaElement.java | 5
sdk/src/org/opends/sdk/controls/PagedResultsControl.java | 12
sdk/src/org/opends/sdk/schema/SyntaxImpl.java | 4
sdk/src/org/opends/sdk/schema/NameForm.java | 13
sdk/src/org/opends/sdk/controls/PasswordPolicyWarningType.java | 11
sdk/src/org/opends/sdk/LocalizableMessageBuilder.java | 437 ++++++
sdk/src/org/opends/sdk/schema/LDAPSyntaxDescriptionSyntaxImpl.java | 16
sdk/src/com/sun/opends/sdk/tools/ArgumentGroup.java | 11
sdk/src/org/opends/sdk/ldif/AbstractLDIFReader.java | 44
sdk/src/org/opends/sdk/schema/MatchingRuleUseSyntaxImpl.java | 14
sdk/src/org/opends/sdk/schema/OctetStringSyntaxImpl.java | 4
sdk/src/org/opends/sdk/Entry.java | 1
sdk/src/org/opends/sdk/schema/ObjectIdentifierFirstComponentEqualityMatchingRuleImpl.java | 10
sdk/src/org/opends/sdk/requests/AddRequestImpl.java | 1
sdk/src/org/opends/sdk/schema/TeletexTerminalIdentifierSyntaxImpl.java | 4
sdk/src/org/opends/sdk/controls/EntryChangeNotificationControl.java | 12
sdk/src/org/opends/sdk/schema/EnhancedGuideSyntaxImpl.java | 4
sdk/src/org/opends/sdk/schema/OtherMailboxSyntaxImpl.java | 4
sdk/src/org/opends/sdk/extensions/GetSymmetricKeyRequest.java | 10
sdk/src/org/opends/sdk/responses/SearchResultEntry.java | 1
sdk/src/org/opends/sdk/schema/TelephoneNumberSyntaxImpl.java | 14
sdk/src/org/opends/sdk/requests/CompareRequest.java | 2
sdk/src/org/opends/sdk/ldif/LDIFChangeRecordReader.java | 38
sdk/src/org/opends/sdk/schema/DITStructureRuleSyntaxImpl.java | 14
sdk/src/org/opends/sdk/controls/MatchedValuesControl.java | 18
sdk/src/org/opends/sdk/schema/CaseExactIA5SubstringMatchingRuleImpl.java | 4
sdk/src/org/opends/sdk/schema/IntegerSyntaxImpl.java | 4
sdk/src/org/opends/sdk/controls/PasswordPolicyErrorType.java | 11
sdk/src/com/sun/opends/sdk/tools/ArgumentException.java | 13
sdk/src/com/sun/opends/sdk/tools/FileBasedArgument.java | 17
sdk/src/org/opends/sdk/responses/SearchResultEntryImpl.java | 1
sdk/src/org/opends/sdk/schema/SchemaBuilder.java | 84
sdk/src/org/opends/sdk/controls/PersistentSearchControl.java | 6
sdk/src/org/opends/sdk/schema/AttributeTypeSyntaxImpl.java | 14
sdk/src/org/opends/sdk/DecodeException.java | 18
sdk/src/org/opends/sdk/schema/MatchingRule.java | 12
sdk/src/org/opends/sdk/schema/DistinguishedNameEqualityMatchingRuleImpl.java | 1
sdk/src/org/opends/sdk/requests/DeleteRequest.java | 2
sdk/src/org/opends/sdk/requests/ModifyRequest.java | 6
sdk/src/org/opends/sdk/schema/MatchingRuleUse.java | 9
sdk/src/org/opends/sdk/schema/UUIDSyntaxImpl.java | 4
sdk/src/org/opends/sdk/LinkedAttribute.java | 1
sdk/src/com/sun/opends/sdk/tools/PerformanceRunner.java | 49
sdk/src/com/sun/opends/sdk/util/Platform.java | 42
sdk/src/org/opends/sdk/ldap/UnexpectedResponseException.java | 4
sdk/src/org/opends/sdk/LocalizableException.java | 5
sdk/src/org/opends/sdk/controls/AccountUsabilityControl.java | 10
sdk/src/org/opends/sdk/schema/CaseExactIA5EqualityMatchingRuleImpl.java | 4
sdk/src/org/opends/sdk/SortedEntry.java | 1
sdk/src/org/opends/sdk/ldif/LDIFEntryReader.java | 12
sdk/src/org/opends/sdk/schema/AttributeType.java | 25
sdk/src/org/opends/sdk/schema/IntegerEqualityMatchingRuleImpl.java | 4
sdk/src/org/opends/sdk/ResultCode.java | 13
sdk/src/org/opends/sdk/schema/IntegerOrderingMatchingRuleImpl.java | 4
sdk/src/org/opends/sdk/schema/UTCTimeSyntaxImpl.java | 72
sdk/src/org/opends/sdk/Filter.java | 32
sdk/src/org/opends/sdk/requests/ModifyRequestImpl.java | 6
sdk/src/org/opends/sdk/schema/AuthPasswordSyntaxImpl.java | 24
sdk/src/com/sun/opends/sdk/tools/LDAPCompare.java | 22
sdk/src/org/opends/sdk/schema/IA5StringSyntaxImpl.java | 8
sdk/src/org/opends/sdk/schema/UUIDOrderingMatchingRuleImpl.java | 8
sdk/src/org/opends/sdk/Matcher.java | 1
sdk/src/org/opends/sdk/schema/JPEGSyntaxImpl.java | 4
sdk/src/com/sun/opends/sdk/tools/BooleanArgument.java | 11
sdk/src/com/sun/opends/sdk/tools/ModRate.java | 11
sdk/src/org/opends/sdk/schema/PresentationAddressSyntaxImpl.java | 4
sdk/src/org/opends/sdk/controls/AuthorizationIdentityControl.java | 6
sdk/src/org/opends/sdk/schema/DITContentRuleSyntaxImpl.java | 12
sdk/src/org/opends/sdk/schema/DirectoryStringFirstComponentEqualityMatchingRuleImpl.java | 10
sdk/src/org/opends/sdk/schema/NameFormSyntaxImpl.java | 16
sdk/src/org/opends/sdk/schema/CaseIgnoreIA5SubstringMatchingRuleImpl.java | 4
sdk/src/org/opends/sdk/schema/CountryStringSyntaxImpl.java | 4
sdk/src/org/opends/sdk/schema/SchemaNotFoundException.java | 13
sdk/src/org/opends/sdk/schema/Syntax.java | 24
sdk/src/org/opends/sdk/schema/BinarySyntaxImpl.java | 4
sdk/src/org/opends/sdk/schema/ProtocolInformationSyntaxImpl.java | 4
sdk/src/org/opends/sdk/requests/GenericBindRequest.java | 2
sdk/src/org/opends/sdk/schema/EnumSyntaxImpl.java | 8
sdk/src/org/opends/sdk/extensions/PasswordModifyRequest.java | 10
sdk/src/org/opends/sdk/schema/CoreSchemaImpl.java | 7
sdk/src/org/opends/sdk/controls/VLVControl.java | 10
sdk/src/com/sun/opends/sdk/tools/MultiChoiceArgument.java | 19
sdk/src/org/opends/sdk/schema/PrintableStringSyntaxImpl.java | 4
sdk/src/org/opends/sdk/Connection.java | 1
sdk/src/org/opends/sdk/ldap/LDAPDecoder.java | 1
sdk/src/org/opends/sdk/schema/ConflictingSchemaElementException.java | 7
sdk/src/org/opends/sdk/requests/SimpleBindRequest.java | 2
sdk/src/org/opends/sdk/schema/CertificateSyntaxImpl.java | 4
sdk/src/org/opends/sdk/responses/Responses.java | 1
sdk/src/org/opends/sdk/controls/VLVTarget.java | 4
sdk/src/com/sun/opends/sdk/tools/ArgumentParser.java | 81
sdk/src/org/opends/sdk/schema/GeneralizedTimeSyntaxImpl.java | 100
sdk/src/org/opends/sdk/schema/BitStringEqualityMatchingRuleImpl.java | 8
sdk/src/org/opends/sdk/requests/DeleteRequestImpl.java | 2
sdk/src/org/opends/sdk/schema/ObjectClassSyntaxImpl.java | 12
sdk/src/org/opends/sdk/ldap/UnexpectedRequestException.java | 4
sdk/src/org/opends/sdk/schema/CaseIgnoreIA5EqualityMatchingRuleImpl.java | 4
sdk/src/org/opends/sdk/schema/SupportedAlgorithmSyntaxImpl.java | 4
sdk/src/org/opends/sdk/schema/SchemaException.java | 13
sdk/src/org/opends/sdk/schema/BitStringSyntaxImpl.java | 4
sdk/src/org/opends/sdk/requests/SimpleBindRequestImpl.java | 2
sdk/src/com/sun/opends/sdk/tools/LDAPModify.java | 26
/dev/null | 456 ------
sdk/src/org/opends/sdk/schema/DITStructureRule.java | 9
sdk/build-tools/com/sun/opends/sdk/build/tools/MessagePropertyKey.java | 2
sdk/src/org/opends/sdk/LocalizableMessage.java | 541 +++++++
sdk/src/com/sun/opends/sdk/util/StaticUtils.java | 23
sdk/src/org/opends/sdk/ldap/ASN1StreamReader.java | 18
sdk/src/org/opends/sdk/schema/FaxSyntaxImpl.java | 4
sdk/src/org/opends/sdk/asn1/AbstractASN1Reader.java | 4
sdk/src/org/opends/sdk/RDN.java | 30
sdk/src/org/opends/sdk/schema/NumericStringSyntaxImpl.java | 4
sdk/src/org/opends/sdk/controls/GetEffectiveRightsRequestControl.java | 10
sdk/src/org/opends/sdk/schema/SchemaUtils.java | 66
184 files changed, 2,295 insertions(+), 1,996 deletions(-)
diff --git a/sdk/build-tools/com/sun/opends/sdk/build/tools/GenerateMessageFile.java b/sdk/build-tools/com/sun/opends/sdk/build/tools/GenerateMessageFile.java
index 190e678..bec69a5 100644
--- a/sdk/build-tools/com/sun/opends/sdk/build/tools/GenerateMessageFile.java
+++ b/sdk/build-tools/com/sun/opends/sdk/build/tools/GenerateMessageFile.java
@@ -89,7 +89,7 @@
.compile(SPECIFIER_REGEX);
/**
- * Message giving formatting rules for string keys.
+ * LocalizableMessage giving formatting rules for string keys.
*/
static public String KEY_FORM_MSG;
@@ -279,14 +279,14 @@
StringBuilder sb = new StringBuilder();
if (useGenericMessageTypeClass())
{
- sb.append("MessageDescriptor");
+ sb.append("LocalizableMessageDescriptor");
sb.append(".");
sb.append(DESCRIPTOR_CLASS_BASE_NAME);
sb.append("N");
}
else
{
- sb.append("MessageDescriptor");
+ sb.append("LocalizableMessageDescriptor");
sb.append(".");
sb.append(DESCRIPTOR_CLASS_BASE_NAME);
sb.append(classTypes.size());
@@ -711,9 +711,9 @@
}
}
- log(" Message Generated:" + keyMap.size(),
+ log(" LocalizableMessage Generated:" + keyMap.size(),
Project.MSG_VERBOSE);
- log(" MessageDescriptor.ArgN:" + usesOfGenericDescriptor,
+ log(" LocalizableMessageDescriptor.ArgN:" + usesOfGenericDescriptor,
Project.MSG_VERBOSE);
}
diff --git a/sdk/build-tools/com/sun/opends/sdk/build/tools/MessagePropertyKey.java b/sdk/build-tools/com/sun/opends/sdk/build/tools/MessagePropertyKey.java
index 0ab5498..fa13d0c 100644
--- a/sdk/build-tools/com/sun/opends/sdk/build/tools/MessagePropertyKey.java
+++ b/sdk/build-tools/com/sun/opends/sdk/build/tools/MessagePropertyKey.java
@@ -94,7 +94,7 @@
/**
- * Gets the name of the MessageDescriptor as it should appear in the
+ * Gets the name of the LocalizableMessageDescriptor as it should appear in the
* messages file.
*
* @return name of message descriptor
diff --git a/sdk/resource/Messages.java.stub b/sdk/resource/Messages.java.stub
index dff34e8..ca1dab2 100755
--- a/sdk/resource/Messages.java.stub
+++ b/sdk/resource/Messages.java.stub
@@ -27,7 +27,7 @@
package ${PACKAGE};
-import com.sun.opends.sdk.util.MessageDescriptor;
+import com.sun.opends.sdk.util.LocalizableMessageDescriptor;
/**
* This file contains a number of constants that are used throughout the
diff --git a/sdk/src/com/sun/opends/sdk/tools/Argument.java b/sdk/src/com/sun/opends/sdk/tools/Argument.java
index 0dfc925..e501d99 100644
--- a/sdk/src/com/sun/opends/sdk/tools/Argument.java
+++ b/sdk/src/com/sun/opends/sdk/tools/Argument.java
@@ -34,8 +34,9 @@
import java.util.Iterator;
import java.util.LinkedList;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
+
@@ -69,7 +70,7 @@
private Character shortIdentifier;
// The unique ID of the description for this argument.
- private Message description;
+ private LocalizableMessage description;
// The set of values for this argument.
private LinkedList<String> values;
@@ -89,7 +90,7 @@
// The value placeholder for this argument, which will be used in
// usage
// information.
- private Message valuePlaceholder;
+ private LocalizableMessage valuePlaceholder;
// Indicates whether this argument was provided in the set of
// properties
@@ -132,15 +133,15 @@
* used to override the default value but will be overridden
* by a command-line argument.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
protected Argument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean isMultiValued,
- boolean needsValue, Message valuePlaceholder,
- String defaultValue, String propertyName, Message description)
+ boolean needsValue, LocalizableMessage valuePlaceholder,
+ String defaultValue, String propertyName, LocalizableMessage description)
throws ArgumentException
{
this.name = name;
@@ -157,13 +158,13 @@
if ((shortIdentifier == null) && (longIdentifier == null))
{
- Message message = ERR_ARG_NO_IDENTIFIER.get(name);
+ LocalizableMessage message = ERR_ARG_NO_IDENTIFIER.get(name);
throw new ArgumentException(message);
}
if (needsValue && (valuePlaceholder == null))
{
- Message message = ERR_ARG_NO_VALUE_PLACEHOLDER.get(name);
+ LocalizableMessage message = ERR_ARG_NO_VALUE_PLACEHOLDER.get(name);
throw new ArgumentException(message);
}
@@ -377,7 +378,7 @@
* argument in the generated usage information, or
* <CODE>null</CODE> if there is none.
*/
- public Message getValuePlaceholder()
+ public LocalizableMessage getValuePlaceholder()
{
return valuePlaceholder;
}
@@ -394,7 +395,7 @@
* The value placeholder that will be displayed for this
* argument in the generated usage information.
*/
- public void setValuePlaceholder(Message valuePlaceholder)
+ public void setValuePlaceholder(LocalizableMessage valuePlaceholder)
{
this.valuePlaceholder = valuePlaceholder;
}
@@ -505,9 +506,9 @@
*
* @return The human-readable description for this argument.
*/
- public Message getDescription()
+ public LocalizableMessage getDescription()
{
- return description != null ? description : Message.EMPTY;
+ return description != null ? description : LocalizableMessage.EMPTY;
}
@@ -569,7 +570,7 @@
{
if (values.isEmpty())
{
- Message message = ERR_ARG_NO_INT_VALUE.get(name);
+ LocalizableMessage message = ERR_ARG_NO_INT_VALUE.get(name);
throw new ArgumentException(message);
}
@@ -583,14 +584,14 @@
}
catch (Exception e)
{
- Message message =
+ LocalizableMessage message =
ERR_ARG_CANNOT_DECODE_AS_INT.get(valueString, name);
throw new ArgumentException(message, e);
}
if (iterator.hasNext())
{
- Message message = ERR_ARG_INT_MULTIPLE_VALUES.get(name);
+ LocalizableMessage message = ERR_ARG_INT_MULTIPLE_VALUES.get(name);
throw new ArgumentException(message);
}
else
@@ -625,7 +626,7 @@
}
catch (Exception e)
{
- Message message =
+ LocalizableMessage message =
ERR_ARG_CANNOT_DECODE_AS_INT.get(valueString, name);
throw new ArgumentException(message, e);
}
@@ -648,7 +649,7 @@
{
if (values.isEmpty())
{
- Message message = ERR_ARG_NO_INT_VALUE.get(name);
+ LocalizableMessage message = ERR_ARG_NO_INT_VALUE.get(name);
throw new ArgumentException(message);
}
@@ -662,14 +663,14 @@
}
catch (Exception e)
{
- Message message =
+ LocalizableMessage message =
ERR_ARG_CANNOT_DECODE_AS_INT.get(valueString, name);
throw new ArgumentException(message, e);
}
if (iterator.hasNext())
{
- Message message = ERR_ARG_INT_MULTIPLE_VALUES.get(name);
+ LocalizableMessage message = ERR_ARG_INT_MULTIPLE_VALUES.get(name);
throw new ArgumentException(message);
}
else
@@ -704,7 +705,7 @@
}
catch (Exception e)
{
- Message message =
+ LocalizableMessage message =
ERR_ARG_CANNOT_DECODE_AS_INT.get(valueString, name);
throw new ArgumentException(message, e);
}
@@ -727,7 +728,7 @@
{
if (values.isEmpty())
{
- Message message = ERR_ARG_NO_BOOLEAN_VALUE.get(name);
+ LocalizableMessage message = ERR_ARG_NO_BOOLEAN_VALUE.get(name);
throw new ArgumentException(message);
}
@@ -747,14 +748,14 @@
}
else
{
- Message message =
+ LocalizableMessage message =
ERR_ARG_CANNOT_DECODE_AS_BOOLEAN.get(valueString, name);
throw new ArgumentException(message);
}
if (iterator.hasNext())
{
- Message message = ERR_ARG_BOOLEAN_MULTIPLE_VALUES.get(name);
+ LocalizableMessage message = ERR_ARG_BOOLEAN_MULTIPLE_VALUES.get(name);
throw new ArgumentException(message);
}
else
@@ -778,7 +779,7 @@
* <CODE>false</CODE> if it is not.
*/
public abstract boolean valueIsAcceptable(String valueString,
- MessageBuilder invalidReason);
+ LocalizableMessageBuilder invalidReason);
diff --git a/sdk/src/com/sun/opends/sdk/tools/ArgumentException.java b/sdk/src/com/sun/opends/sdk/tools/ArgumentException.java
index b443aa8..7198525 100644
--- a/sdk/src/com/sun/opends/sdk/tools/ArgumentException.java
+++ b/sdk/src/com/sun/opends/sdk/tools/ArgumentException.java
@@ -28,8 +28,9 @@
-import com.sun.opends.sdk.util.LocalizableException;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableException;
+import org.opends.sdk.LocalizableMessage;
+
@@ -50,7 +51,7 @@
private static final long serialVersionUID = 5623155045312160730L;
// The I18N message associated with this exception.
- private final Message message;
+ private final LocalizableMessage message;
@@ -60,7 +61,7 @@
* @param message
* The message that explains the problem that occurred.
*/
- ArgumentException(Message message)
+ ArgumentException(LocalizableMessage message)
{
super(String.valueOf(message));
this.message = message;
@@ -77,7 +78,7 @@
* @param cause
* The exception that was caught to trigger this exception.
*/
- ArgumentException(Message message, Throwable cause)
+ ArgumentException(LocalizableMessage message, Throwable cause)
{
super(String.valueOf(message), cause);
this.message = message;
@@ -88,7 +89,7 @@
/**
* {@inheritDoc}
*/
- public Message getMessageObject()
+ public LocalizableMessage getMessageObject()
{
return this.message;
}
diff --git a/sdk/src/com/sun/opends/sdk/tools/ArgumentGroup.java b/sdk/src/com/sun/opends/sdk/tools/ArgumentGroup.java
index 8c8a2bc..7a70077 100644
--- a/sdk/src/com/sun/opends/sdk/tools/ArgumentGroup.java
+++ b/sdk/src/com/sun/opends/sdk/tools/ArgumentGroup.java
@@ -34,7 +34,8 @@
import java.util.LinkedList;
import java.util.List;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
@@ -48,7 +49,7 @@
{
// Description for this group of arguments
- private Message description = null;
+ private LocalizableMessage description = null;
// List of arguments belonging to this group
private List<Argument> args = null;
@@ -69,7 +70,7 @@
* usage statement. Groups with higher priority values appear
* before groups with lower priority.
*/
- ArgumentGroup(Message description, int priority)
+ ArgumentGroup(LocalizableMessage description, int priority)
{
this.description = description;
this.priority = priority;
@@ -83,7 +84,7 @@
*
* @return description for this argument group
*/
- Message getDescription()
+ LocalizableMessage getDescription()
{
return this.description;
}
@@ -96,7 +97,7 @@
* @param description
* for this argument group
*/
- void setDescription(Message description)
+ void setDescription(LocalizableMessage description)
{
this.description = description;
}
diff --git a/sdk/src/com/sun/opends/sdk/tools/ArgumentParser.java b/sdk/src/com/sun/opends/sdk/tools/ArgumentParser.java
index 2b86b2b..8de195f 100644
--- a/sdk/src/com/sun/opends/sdk/tools/ArgumentParser.java
+++ b/sdk/src/com/sun/opends/sdk/tools/ArgumentParser.java
@@ -39,8 +39,9 @@
import java.io.OutputStream;
import java.util.*;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
+
@@ -131,7 +132,7 @@
// A human-readable description for the tool, which will be included
// when
// displaying usage information.
- private Message toolDescription;
+ private LocalizableMessage toolDescription;
// The display name that will be used for the trailing arguments in
// the usage
@@ -149,7 +150,7 @@
* will appear at the top of the usage statement without a header.
*/
private ArgumentGroup defaultArgGroup = new ArgumentGroup(
- Message.EMPTY, Integer.MAX_VALUE);
+ LocalizableMessage.EMPTY, Integer.MAX_VALUE);
/**
* Group for arguments that are related to connection through LDAP.
@@ -195,7 +196,7 @@
* Indicates whether long arguments should be treated in a
* case-sensitive manner.
*/
- ArgumentParser(String mainClassName, Message toolDescription,
+ ArgumentParser(String mainClassName, LocalizableMessage toolDescription,
boolean longArgumentsCaseSensitive)
{
this.mainClassName = mainClassName;
@@ -253,7 +254,7 @@
* unnamed trailing arguments in the generated usage
* information.
*/
- ArgumentParser(String mainClassName, Message toolDescription,
+ ArgumentParser(String mainClassName, LocalizableMessage toolDescription,
boolean longArgumentsCaseSensitive,
boolean allowsTrailingArguments, int minTrailingArguments,
int maxTrailingArguments, String trailingArgsDisplayName)
@@ -304,7 +305,7 @@
* @return A human-readable description for this tool, or {@code null}
* if none is available.
*/
- Message getToolDescription()
+ LocalizableMessage getToolDescription()
{
return toolDescription;
}
@@ -482,7 +483,7 @@
* @param description
* for the default group
*/
- void setDefaultArgumentGroupDescription(Message description)
+ void setDefaultArgumentGroupDescription(LocalizableMessage description)
{
this.defaultArgGroup.setDescription(description);
}
@@ -495,7 +496,7 @@
* @param description
* for the LDAP group
*/
- void setLdapArgumentGroupDescription(Message description)
+ void setLdapArgumentGroupDescription(LocalizableMessage description)
{
this.ldapArgGroup.setDescription(description);
}
@@ -509,7 +510,7 @@
* @param description
* for the input/output group
*/
- void setInputOutputArgumentGroupDescription(Message description)
+ void setInputOutputArgumentGroupDescription(LocalizableMessage description)
{
this.ioArgGroup.setDescription(description);
}
@@ -522,7 +523,7 @@
* @param description
* for the general group
*/
- void setGeneralArgumentGroupDescription(Message description)
+ void setGeneralArgumentGroupDescription(LocalizableMessage description)
{
this.generalArgGroup.setDescription(description);
}
@@ -637,7 +638,7 @@
{
String conflictingName = shortIDMap.get(shortID).getName();
- Message message = ERR_ARGPARSER_DUPLICATE_SHORT_ID.get(argument
+ LocalizableMessage message = ERR_ARGPARSER_DUPLICATE_SHORT_ID.get(argument
.getName(), String.valueOf(shortID), conflictingName);
throw new ArgumentException(message);
}
@@ -674,7 +675,7 @@
{
String conflictingName = longIDMap.get(longID).getName();
- Message message = ERR_ARGPARSER_DUPLICATE_LONG_ID.get(argument
+ LocalizableMessage message = ERR_ARGPARSER_DUPLICATE_LONG_ID.get(argument
.getName(), argument.getLongIdentifier(), conflictingName);
throw new ArgumentException(message);
}
@@ -835,7 +836,7 @@
{
if (requirePropertiesFile)
{
- Message message = ERR_ARGPARSER_CANNOT_READ_PROPERTIES_FILE
+ LocalizableMessage message = ERR_ARGPARSER_CANNOT_READ_PROPERTIES_FILE
.get(String.valueOf(propertiesFile), getExceptionMessage(e));
throw new ArgumentException(message, e);
}
@@ -880,7 +881,7 @@
if ((maxTrailingArguments > 0)
&& (trailingArguments.size() > maxTrailingArguments))
{
- Message message = ERR_ARGPARSER_TOO_MANY_TRAILING_ARGS
+ LocalizableMessage message = ERR_ARGPARSER_TOO_MANY_TRAILING_ARGS
.get(maxTrailingArguments);
throw new ArgumentException(message);
}
@@ -917,7 +918,7 @@
else if (equalPos == 0)
{
// The argument starts with "--=", which is not acceptable.
- Message message = ERR_ARGPARSER_LONG_ARG_WITHOUT_NAME
+ LocalizableMessage message = ERR_ARGPARSER_LONG_ARG_WITHOUT_NAME
.get(arg);
throw new ArgumentException(message);
}
@@ -976,7 +977,7 @@
else
{
// There is no such argument registered.
- Message message = ERR_ARGPARSER_NO_ARGUMENT_WITH_LONG_ID
+ LocalizableMessage message = ERR_ARGPARSER_NO_ARGUMENT_WITH_LONG_ID
.get(origArgName);
throw new ArgumentException(message);
}
@@ -1012,7 +1013,7 @@
{
if ((i + 1) == numArguments)
{
- Message message = ERR_ARGPARSER_NO_VALUE_FOR_ARGUMENT_WITH_LONG_ID
+ LocalizableMessage message = ERR_ARGPARSER_NO_VALUE_FOR_ARGUMENT_WITH_LONG_ID
.get(origArgName);
throw new ArgumentException(message);
}
@@ -1020,10 +1021,10 @@
argValue = rawArguments[++i];
}
- MessageBuilder invalidReason = new MessageBuilder();
+ LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
if (!a.valueIsAcceptable(argValue, invalidReason))
{
- Message message = ERR_ARGPARSER_VALUE_UNACCEPTABLE_FOR_LONG_ID
+ LocalizableMessage message = ERR_ARGPARSER_VALUE_UNACCEPTABLE_FOR_LONG_ID
.get(argValue, origArgName, invalidReason.toString());
throw new ArgumentException(message);
}
@@ -1032,7 +1033,7 @@
// acceptable to have more than one.
if (a.hasValue() && (!a.isMultiValued()))
{
- Message message = ERR_ARGPARSER_NOT_MULTIVALUED_FOR_LONG_ID
+ LocalizableMessage message = ERR_ARGPARSER_NOT_MULTIVALUED_FOR_LONG_ID
.get(origArgName);
throw new ArgumentException(message);
}
@@ -1043,7 +1044,7 @@
{
if (argValue != null)
{
- Message message = ERR_ARGPARSER_ARG_FOR_LONG_ID_DOESNT_TAKE_VALUE
+ LocalizableMessage message = ERR_ARGPARSER_ARG_FOR_LONG_ID_DOESNT_TAKE_VALUE
.get(origArgName);
throw new ArgumentException(message);
}
@@ -1059,7 +1060,7 @@
// -n value
if (arg.equals("-"))
{
- Message message = ERR_ARGPARSER_INVALID_DASH_AS_ARGUMENT
+ LocalizableMessage message = ERR_ARGPARSER_INVALID_DASH_AS_ARGUMENT
.get();
throw new ArgumentException(message);
}
@@ -1115,7 +1116,7 @@
else
{
// There is no such argument registered.
- Message message = ERR_ARGPARSER_NO_ARGUMENT_WITH_SHORT_ID
+ LocalizableMessage message = ERR_ARGPARSER_NO_ARGUMENT_WITH_SHORT_ID
.get(String.valueOf(argCharacter));
throw new ArgumentException(message);
}
@@ -1151,7 +1152,7 @@
{
if ((i + 1) == numArguments)
{
- Message message = ERR_ARGPARSER_NO_VALUE_FOR_ARGUMENT_WITH_SHORT_ID
+ LocalizableMessage message = ERR_ARGPARSER_NO_VALUE_FOR_ARGUMENT_WITH_SHORT_ID
.get(String.valueOf(argCharacter));
throw new ArgumentException(message);
}
@@ -1159,10 +1160,10 @@
argValue = rawArguments[++i];
}
- MessageBuilder invalidReason = new MessageBuilder();
+ LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
if (!a.valueIsAcceptable(argValue, invalidReason))
{
- Message message = ERR_ARGPARSER_VALUE_UNACCEPTABLE_FOR_SHORT_ID
+ LocalizableMessage message = ERR_ARGPARSER_VALUE_UNACCEPTABLE_FOR_SHORT_ID
.get(argValue, String.valueOf(argCharacter),
invalidReason.toString());
throw new ArgumentException(message);
@@ -1172,7 +1173,7 @@
// acceptable to have more than one.
if (a.hasValue() && (!a.isMultiValued()))
{
- Message message = ERR_ARGPARSER_NOT_MULTIVALUED_FOR_SHORT_ID
+ LocalizableMessage message = ERR_ARGPARSER_NOT_MULTIVALUED_FOR_SHORT_ID
.get(String.valueOf(argCharacter));
throw new ArgumentException(message);
}
@@ -1200,7 +1201,7 @@
if (b == null)
{
// There is no such argument registered.
- Message message = ERR_ARGPARSER_NO_ARGUMENT_WITH_SHORT_ID
+ LocalizableMessage message = ERR_ARGPARSER_NO_ARGUMENT_WITH_SHORT_ID
.get(String.valueOf(argCharacter));
throw new ArgumentException(message);
}
@@ -1210,7 +1211,7 @@
// a
// valid argument that takes a value. We don't support
// that.
- Message message = ERR_ARGPARSER_CANT_MIX_ARGS_WITH_VALUES
+ LocalizableMessage message = ERR_ARGPARSER_CANT_MIX_ARGS_WITH_VALUES
.get(String.valueOf(argCharacter), argValue, String
.valueOf(c));
throw new ArgumentException(message);
@@ -1253,7 +1254,7 @@
// It doesn't start with a dash and we don't allow trailing
// arguments,
// so this is illegal.
- Message message = ERR_ARGPARSER_DISALLOWED_TRAILING_ARGUMENT
+ LocalizableMessage message = ERR_ARGPARSER_DISALLOWED_TRAILING_ARGUMENT
.get(arg);
throw new ArgumentException(message);
}
@@ -1266,7 +1267,7 @@
{
if (trailingArguments.size() < minTrailingArguments)
{
- Message message = ERR_ARGPARSER_TOO_FEW_TRAILING_ARGUMENTS
+ LocalizableMessage message = ERR_ARGPARSER_TOO_FEW_TRAILING_ARGUMENTS
.get(minTrailingArguments);
throw new ArgumentException(message);
}
@@ -1294,7 +1295,7 @@
{
String value = argumentProperties.getProperty(a
.getPropertyName().toLowerCase());
- MessageBuilder invalidReason = new MessageBuilder();
+ LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
if (value != null)
{
Boolean addValue = true;
@@ -1328,7 +1329,7 @@
// a problem.
if ((!a.hasValue()) && a.isRequired())
{
- Message message = ERR_ARGPARSER_NO_VALUE_FOR_REQUIRED_ARG
+ LocalizableMessage message = ERR_ARGPARSER_NO_VALUE_FOR_REQUIRED_ARG
.get(a.getName());
throw new ArgumentException(message);
}
@@ -1428,7 +1429,7 @@
}
catch (Exception e)
{
- Message message = ERR_ARGPARSER_CANNOT_READ_PROPERTIES_FILE.get(
+ LocalizableMessage message = ERR_ARGPARSER_CANNOT_READ_PROPERTIES_FILE.get(
String.valueOf(propertiesFilePath), getExceptionMessage(e));
throw new ArgumentException(message, e);
}
@@ -1517,8 +1518,8 @@
if (argGroup.containsArguments() && printHeaders)
{
// Print the groups description if any
- Message groupDesc = argGroup.getDescription();
- if (groupDesc != null && !Message.EMPTY.equals(groupDesc))
+ LocalizableMessage groupDesc = argGroup.getDescription();
+ if (groupDesc != null && !LocalizableMessage.EMPTY.equals(groupDesc))
{
buffer.append(EOL);
buffer.append(wrapText(groupDesc.toString(), MAX_LENGTH - 1));
@@ -1566,14 +1567,14 @@
* @return A string containing usage information based on the defined
* arguments.
*/
- Message getUsageMessage()
+ LocalizableMessage getUsageMessage()
{
StringBuilder buffer = new StringBuilder();
getUsage(buffer);
// TODO: rework getUsage(OutputStream) to work with messages
// framework
- return Message.raw(buffer.toString());
+ return LocalizableMessage.raw(buffer.toString());
}
@@ -1719,7 +1720,7 @@
// indent the description five characters and try our best to wrap
// at or
// before column 79 so it will be friendly to 80-column displays.
- Message description = a.getDescription();
+ LocalizableMessage description = a.getDescription();
int descMaxLength = MAX_LENGTH - indentLength - 1;
if (description.length() <= descMaxLength)
{
diff --git a/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java b/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java
index 7d2bf3f..34975e0 100644
--- a/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java
+++ b/sdk/src/com/sun/opends/sdk/tools/ArgumentParserConnectionFactory.java
@@ -56,8 +56,6 @@
import org.opends.sdk.requests.Requests;
import org.opends.sdk.sasl.*;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.SSLUtils;
import com.sun.opends.sdk.util.StaticUtils;
@@ -234,7 +232,7 @@
hostNameArg.setPropertyName(OPTION_LONG_HOST);
argumentParser.addLdapConnectionArgument(hostNameArg);
- Message portDescription = INFO_DESCRIPTION_PORT.get();
+ LocalizableMessage portDescription = INFO_DESCRIPTION_PORT.get();
if (alwaysSSL)
{
portDescription = INFO_DESCRIPTION_ADMIN_PORT.get();
@@ -367,7 +365,7 @@
// Couldn't have at the same time bindPassword and bindPasswordFile
if (bindPasswordArg.isPresent() && bindPasswordFileArg.isPresent())
{
- Message message = ERR_TOOL_CONFLICTING_ARGS
+ LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS
.get(bindPasswordArg.getLongIdentifier(), bindPasswordFileArg
.getLongIdentifier());
throw new ArgumentException(message);
@@ -377,13 +375,13 @@
// trustStore related arg
if (trustAllArg.isPresent() && trustStorePathArg.isPresent())
{
- Message message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
+ LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
.getLongIdentifier(), trustStorePathArg.getLongIdentifier());
throw new ArgumentException(message);
}
if (trustAllArg.isPresent() && trustStorePasswordArg.isPresent())
{
- Message message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
+ LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
.getLongIdentifier(), trustStorePasswordArg
.getLongIdentifier());
throw new ArgumentException(message);
@@ -391,7 +389,7 @@
if (trustAllArg.isPresent()
&& trustStorePasswordFileArg.isPresent())
{
- Message message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
+ LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(trustAllArg
.getLongIdentifier(), trustStorePasswordFileArg
.getLongIdentifier());
throw new ArgumentException(message);
@@ -402,7 +400,7 @@
if (trustStorePasswordArg.isPresent()
&& trustStorePasswordFileArg.isPresent())
{
- Message message = ERR_TOOL_CONFLICTING_ARGS.get(
+ LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(
trustStorePasswordArg.getLongIdentifier(),
trustStorePasswordFileArg.getLongIdentifier());
throw new ArgumentException(message);
@@ -414,7 +412,7 @@
String value = trustStorePathArg.getValue();
if (!canRead(trustStorePathArg.getValue()))
{
- Message message = ERR_CANNOT_READ_TRUSTSTORE.get(value);
+ LocalizableMessage message = ERR_CANNOT_READ_TRUSTSTORE.get(value);
throw new ArgumentException(message);
}
}
@@ -425,7 +423,7 @@
String value = keyStorePathArg.getValue();
if (!canRead(trustStorePathArg.getValue()))
{
- Message message = ERR_CANNOT_READ_KEYSTORE.get(value);
+ LocalizableMessage message = ERR_CANNOT_READ_KEYSTORE.get(value);
throw new ArgumentException(message);
}
}
@@ -434,7 +432,7 @@
// useSSLArg
if (useStartTLSArg.isPresent() && useSSLArg.isPresent())
{
- Message message = ERR_TOOL_CONFLICTING_ARGS.get(useStartTLSArg
+ LocalizableMessage message = ERR_TOOL_CONFLICTING_ARGS.get(useStartTLSArg
.getLongIdentifier(), useSSLArg.getLongIdentifier());
throw new ArgumentException(message);
}
@@ -495,7 +493,7 @@
}
catch (CLIException e)
{
- throw new ArgumentException(Message.raw("Error reading input: "
+ throw new ArgumentException(LocalizableMessage.raw("Error reading input: "
+ e.toString()));
}
if (bindRequest != null)
@@ -553,7 +551,7 @@
}
catch (LoginException e)
{
- Message message = ERR_LDAPAUTH_GSSAPI_LOCAL_AUTHENTICATION_FAILED
+ LocalizableMessage message = ERR_LDAPAUTH_GSSAPI_LOCAL_AUTHENTICATION_FAILED
.get(StaticUtils.getExceptionMessage(e));
throw new ArgumentException(message, e);
}
@@ -562,12 +560,12 @@
{
if (sslContext == null)
{
- Message message = ERR_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS.get();
+ LocalizableMessage message = ERR_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS.get();
throw new ArgumentException(message);
}
if (!keyStorePathArg.isPresent() && getKeyStore() == null)
{
- Message message = ERR_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE.get();
+ LocalizableMessage message = ERR_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE.get();
throw new ArgumentException(message);
}
return new ExternalSASLBindRequest(getAuthzID());
@@ -594,7 +592,7 @@
}
else if (app.isInteractive())
{
- value = app.readInput(Message.raw("Bind DN:"), bindDnArg
+ value = app.readInput(LocalizableMessage.raw("Bind DN:"), bindDnArg
.getDefaultValue() == null ? value : bindDnArg
.getDefaultValue());
}
@@ -629,13 +627,13 @@
}
if (value == null && app.isInteractive())
{
- value = app.readInput(Message.raw("Authentication ID:"),
+ value = app.readInput(LocalizableMessage.raw("Authentication ID:"),
bindDnArg.getDefaultValue() == null ? null : "dn: "
+ bindDnArg.getDefaultValue());
}
if (value == null)
{
- Message message = ERR_LDAPAUTH_SASL_AUTHID_REQUIRED.get(mech);
+ LocalizableMessage message = ERR_LDAPAUTH_SASL_AUTHID_REQUIRED.get(mech);
throw new ArgumentException(message);
}
return value;
@@ -679,7 +677,7 @@
}
if (value.length() == 0 && app.isInteractive())
{
- value = app.readLineOfInput(Message.raw("Bind Password:"));
+ value = app.readLineOfInput(LocalizableMessage.raw("Bind Password:"));
}
return ByteString.valueOf(value);
@@ -906,7 +904,7 @@
int equalPos = option.indexOf('=');
if (equalPos <= 0)
{
- Message message = ERR_LDAP_CONN_CANNOT_PARSE_SASL_OPTION
+ LocalizableMessage message = ERR_LDAP_CONN_CANNOT_PARSE_SASL_OPTION
.get(option);
throw new ArgumentException(message);
}
diff --git a/sdk/src/com/sun/opends/sdk/tools/BooleanArgument.java b/sdk/src/com/sun/opends/sdk/tools/BooleanArgument.java
index 6e051e6..de6d27f 100644
--- a/sdk/src/com/sun/opends/sdk/tools/BooleanArgument.java
+++ b/sdk/src/com/sun/opends/sdk/tools/BooleanArgument.java
@@ -30,8 +30,9 @@
import static com.sun.opends.sdk.messages.Messages.*;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
+
@@ -57,13 +58,13 @@
* The long identifier for this argument, or
* <CODE>null</CODE> if there is none.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public BooleanArgument(String name, Character shortIdentifier,
- String longIdentifier, Message description)
+ String longIdentifier, LocalizableMessage description)
throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, false, false, false,
@@ -85,7 +86,7 @@
* <CODE>false</CODE> if it is not.
*/
public boolean valueIsAcceptable(String valueString,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// This argument type should never have a value, so any value
// provided will
diff --git a/sdk/src/com/sun/opends/sdk/tools/CLIException.java b/sdk/src/com/sun/opends/sdk/tools/CLIException.java
index f9f7c2c..44ab05b 100755
--- a/sdk/src/com/sun/opends/sdk/tools/CLIException.java
+++ b/sdk/src/com/sun/opends/sdk/tools/CLIException.java
@@ -29,9 +29,10 @@
+import org.opends.sdk.LocalizableException;
+import org.opends.sdk.LocalizableMessage;
+
import com.sun.opends.sdk.messages.Messages;
-import com.sun.opends.sdk.util.LocalizableException;
-import com.sun.opends.sdk.util.Message;
@@ -68,7 +69,7 @@
* @param message
* The message explaining the problem that occurred.
*/
- CLIException(Message message)
+ CLIException(LocalizableMessage message)
{
super(message.toString());
this.message = message;
@@ -84,7 +85,7 @@
* @param cause
* The cause of this exception.
*/
- CLIException(Message message, Throwable cause)
+ CLIException(LocalizableMessage message, Throwable cause)
{
super(message.toString(), cause);
this.message = message;
@@ -92,11 +93,11 @@
- private final Message message;
+ private final LocalizableMessage message;
- public Message getMessageObject()
+ public LocalizableMessage getMessageObject()
{
return message;
}
diff --git a/sdk/src/com/sun/opends/sdk/tools/ConsoleApplication.java b/sdk/src/com/sun/opends/sdk/tools/ConsoleApplication.java
index d21f6da..06f77e2 100755
--- a/sdk/src/com/sun/opends/sdk/tools/ConsoleApplication.java
+++ b/sdk/src/com/sun/opends/sdk/tools/ConsoleApplication.java
@@ -35,7 +35,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
@@ -357,7 +358,7 @@
*/
final void pressReturnToContinue()
{
- Message msg = INFO_MENU_PROMPT_RETURN_TO_CONTINUE.get();
+ LocalizableMessage msg = INFO_MENU_PROMPT_RETURN_TO_CONTINUE.get();
try
{
readLineOfInput(msg);
@@ -386,7 +387,7 @@
* @param msg
* The message.
*/
- final void println(Message msg)
+ final void println(LocalizableMessage msg)
{
err.println(wrapText(msg, MAX_LINE_WIDTH));
}
@@ -399,7 +400,7 @@
* @param msg
* The message.
*/
- final void print(Message msg)
+ final void print(LocalizableMessage msg)
{
err.print(wrapText(msg, MAX_LINE_WIDTH));
}
@@ -427,7 +428,7 @@
* @param msg
* The message.
*/
- final void printProgress(Message msg)
+ final void printProgress(LocalizableMessage msg)
{
if (!isQuiet())
{
@@ -446,7 +447,7 @@
* @param indent
* The number of columns to indent.
*/
- final void println(Message msg, int indent)
+ final void println(LocalizableMessage msg, int indent)
{
err.println(wrapText(msg, MAX_LINE_WIDTH, indent));
}
@@ -459,7 +460,7 @@
* @param msg
* The verbose message.
*/
- final void printVerboseMessage(Message msg)
+ final void printVerboseMessage(LocalizableMessage msg)
{
if (isVerbose() || isInteractive())
{
@@ -480,7 +481,7 @@
* If the line of input could not be retrieved for some
* reason.
*/
- final String readLineOfInput(Message prompt) throws CLIException
+ final String readLineOfInput(LocalizableMessage prompt) throws CLIException
{
if (prompt != null)
{
@@ -526,7 +527,7 @@
* reason.
* @return The string value read from the user.
*/
- final String readInput(Message prompt, String defaultValue)
+ final String readInput(LocalizableMessage prompt, String defaultValue)
throws CLIException
{
while (true)
@@ -576,7 +577,7 @@
* the Logger to be used to log the error message.
* @return The string value read from the user.
*/
- final String readInput(Message prompt, String defaultValue,
+ final String readInput(LocalizableMessage prompt, String defaultValue,
Logger logger)
{
String s = defaultValue;
diff --git a/sdk/src/com/sun/opends/sdk/tools/FileBasedArgument.java b/sdk/src/com/sun/opends/sdk/tools/FileBasedArgument.java
index 1540586..c476bf2 100644
--- a/sdk/src/com/sun/opends/sdk/tools/FileBasedArgument.java
+++ b/sdk/src/com/sun/opends/sdk/tools/FileBasedArgument.java
@@ -36,8 +36,9 @@
import java.io.FileReader;
import java.util.LinkedHashMap;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
+
@@ -85,14 +86,14 @@
* displayed in usage information, or <CODE>null</CODE> if
* this argument does not require a value.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public FileBasedArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired,
- Message valuePlaceholder, Message description)
+ LocalizableMessage valuePlaceholder, LocalizableMessage description)
throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired, false,
@@ -135,15 +136,15 @@
* used to override the default value but will be overridden
* by a command-line argument.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public FileBasedArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean isMultiValued,
- Message valuePlaceholder, String defaultValue,
- String propertyName, Message description)
+ LocalizableMessage valuePlaceholder, String defaultValue,
+ String propertyName, LocalizableMessage description)
throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired,
@@ -182,7 +183,7 @@
* <CODE>false</CODE> if it is not.
*/
public boolean valueIsAcceptable(String valueString,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// First, make sure that the specified file exists.
File valueFile;
diff --git a/sdk/src/com/sun/opends/sdk/tools/IntegerArgument.java b/sdk/src/com/sun/opends/sdk/tools/IntegerArgument.java
index 272a714..57d8a68 100644
--- a/sdk/src/com/sun/opends/sdk/tools/IntegerArgument.java
+++ b/sdk/src/com/sun/opends/sdk/tools/IntegerArgument.java
@@ -30,8 +30,9 @@
import static com.sun.opends.sdk.messages.Messages.*;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
+
@@ -78,14 +79,14 @@
* displayed in usage information, or <CODE>null</CODE> if
* this argument does not require a value.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public IntegerArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean needsValue,
- Message valuePlaceholder, Message description)
+ LocalizableMessage valuePlaceholder, LocalizableMessage description)
throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired, false,
@@ -133,16 +134,16 @@
* The upper bound that should be enforced for values of this
* argument.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public IntegerArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean needsValue,
- Message valuePlaceholder, boolean hasLowerBound,
+ LocalizableMessage valuePlaceholder, boolean hasLowerBound,
double lowerBound, boolean hasUpperBound, double upperBound,
- Message description) throws ArgumentException
+ LocalizableMessage description) throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired, false,
needsValue, valuePlaceholder, null, null, description);
@@ -154,7 +155,7 @@
if (hasLowerBound && hasUpperBound && (lowerBound > upperBound))
{
- Message message =
+ LocalizableMessage message =
ERR_INTARG_LOWER_BOUND_ABOVE_UPPER_BOUND.get(name,
lowerBound, upperBound);
throw new ArgumentException(message);
@@ -197,15 +198,15 @@
* used to override the default value but will be overridden
* by a command-line argument.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public IntegerArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean isMultiValued,
- boolean needsValue, Message valuePlaceholder, int defaultValue,
- String propertyName, Message description)
+ boolean needsValue, LocalizableMessage valuePlaceholder, int defaultValue,
+ String propertyName, LocalizableMessage description)
throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired,
@@ -254,15 +255,15 @@
* used to override the default value but will be overridden
* by a command-line argument.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public IntegerArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean isMultiValued,
- boolean needsValue, Message valuePlaceholder,
- double defaultValue, String propertyName, Message description)
+ boolean needsValue, LocalizableMessage valuePlaceholder,
+ double defaultValue, String propertyName, LocalizableMessage description)
throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired,
@@ -323,16 +324,16 @@
* The upper bound that should be enforced for values of this
* argument.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public IntegerArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean isMultiValued,
- boolean needsValue, Message valuePlaceholder, int defaultValue,
+ boolean needsValue, LocalizableMessage valuePlaceholder, int defaultValue,
String propertyName, boolean hasLowerBound, double lowerBound,
- boolean hasUpperBound, double upperBound, Message description)
+ boolean hasUpperBound, double upperBound, LocalizableMessage description)
throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired,
@@ -346,7 +347,7 @@
if (hasLowerBound && hasUpperBound && (lowerBound > upperBound))
{
- Message message =
+ LocalizableMessage message =
ERR_INTARG_LOWER_BOUND_ABOVE_UPPER_BOUND.get(name,
lowerBound, upperBound);
throw new ArgumentException(message);
@@ -401,17 +402,17 @@
* The upper bound that should be enforced for values of this
* argument.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public IntegerArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean isMultiValued,
- boolean needsValue, Message valuePlaceholder,
+ boolean needsValue, LocalizableMessage valuePlaceholder,
double defaultValue, String propertyName, boolean hasLowerBound,
double lowerBound, boolean hasUpperBound, double upperBound,
- Message description) throws ArgumentException
+ LocalizableMessage description) throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired,
isMultiValued, needsValue, valuePlaceholder, String
@@ -424,7 +425,7 @@
if (hasLowerBound && hasUpperBound && (lowerBound > upperBound))
{
- Message message =
+ LocalizableMessage message =
ERR_INTARG_LOWER_BOUND_ABOVE_UPPER_BOUND.get(name,
lowerBound, upperBound);
throw new ArgumentException(message);
@@ -502,7 +503,7 @@
* <CODE>false</CODE> if it is not.
*/
public boolean valueIsAcceptable(String valueString,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// First, the value must be decodable as an integer.
double intValue;
diff --git a/sdk/src/com/sun/opends/sdk/tools/LDAPCompare.java b/sdk/src/com/sun/opends/sdk/tools/LDAPCompare.java
index b6d57fd..d7bbee1 100644
--- a/sdk/src/com/sun/opends/sdk/tools/LDAPCompare.java
+++ b/sdk/src/com/sun/opends/sdk/tools/LDAPCompare.java
@@ -46,8 +46,6 @@
import org.opends.sdk.responses.Result;
import com.sun.opends.sdk.util.Base64;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
@@ -135,7 +133,7 @@
{
// Create the command-line argument parser for use with this
// program.
- Message toolDescription = INFO_LDAPCOMPARE_TOOL_DESCRIPTION.get();
+ LocalizableMessage toolDescription = INFO_LDAPCOMPARE_TOOL_DESCRIPTION.get();
ArgumentParser argParser =
new ArgumentParser(LDAPCompare.class.getName(),
toolDescription, false, true, 1, 0,
@@ -246,7 +244,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -259,7 +257,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
println(message);
println(argParser.getUsageMessage());
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -295,7 +293,7 @@
if (attrAndDNStrings.isEmpty())
{
- Message message = ERR_LDAPCOMPARE_NO_ATTR.get();
+ LocalizableMessage message = ERR_LDAPCOMPARE_NO_ATTR.get();
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -328,7 +326,7 @@
int idx = attributeString.indexOf(":");
if (idx == -1)
{
- Message message =
+ LocalizableMessage message =
ERR_LDAPCOMPARE_INVALID_ATTR_STRING.get(attributeString);
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -393,7 +391,7 @@
}
catch (DecodeException de)
{
- Message message =
+ LocalizableMessage message =
ERR_TOOL_INVALID_CONTROL_STRING.get(ctrlString);
println(message);
ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -424,7 +422,7 @@
}
catch (LocalizedIllegalArgumentException le)
{
- Message message =
+ LocalizableMessage message =
ERR_LDAP_ASSERTION_INVALID_FILTER.get(le.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -460,7 +458,7 @@
}
catch (ErrorResultException ere)
{
- println(Message.raw(ere.getMessage()));
+ println(LocalizableMessage.raw(ere.getMessage()));
return ere.getResult().getResultCode().intValue();
}
}
@@ -566,7 +564,7 @@
}
catch (ErrorResultException ere)
{
- Message msg = INFO_OPERATION_FAILED.get("COMPARE");
+ LocalizableMessage msg = INFO_OPERATION_FAILED.get("COMPARE");
println(msg);
Result r = ere.getResult();
println(ERR_TOOL_RESULT_CODE.get(r.getResultCode().intValue(),
@@ -574,7 +572,7 @@
if ((r.getDiagnosticMessage() != null)
&& (r.getDiagnosticMessage().length() > 0))
{
- println(Message.raw(r.getDiagnosticMessage()));
+ println(LocalizableMessage.raw(r.getDiagnosticMessage()));
}
if (r.getMatchedDN() != null && r.getMatchedDN().length() > 0)
{
diff --git a/sdk/src/com/sun/opends/sdk/tools/LDAPModify.java b/sdk/src/com/sun/opends/sdk/tools/LDAPModify.java
index 93e656a..cf62330 100644
--- a/sdk/src/com/sun/opends/sdk/tools/LDAPModify.java
+++ b/sdk/src/com/sun/opends/sdk/tools/LDAPModify.java
@@ -51,8 +51,6 @@
import org.opends.sdk.responses.Responses;
import org.opends.sdk.responses.Result;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
@@ -146,7 +144,7 @@
{
// Create the command-line argument parser for use with this
// program.
- Message toolDescription = INFO_LDAPMODIFY_TOOL_DESCRIPTION.get();
+ LocalizableMessage toolDescription = INFO_LDAPMODIFY_TOOL_DESCRIPTION.get();
ArgumentParser argParser = new ArgumentParser(LDAPModify.class
.getName(), toolDescription, false);
ArgumentParserConnectionFactory connectionFactory;
@@ -264,7 +262,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -277,7 +275,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
println(message);
println(argParser.getUsageMessage());
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -325,7 +323,7 @@
}
catch (DecodeException de)
{
- Message message = ERR_TOOL_INVALID_CONTROL_STRING
+ LocalizableMessage message = ERR_TOOL_INVALID_CONTROL_STRING
.get(ctrlString);
println(message);
ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -356,7 +354,7 @@
}
catch (LocalizedIllegalArgumentException le)
{
- Message message = ERR_LDAP_ASSERTION_INVALID_FILTER.get(le
+ LocalizableMessage message = ERR_LDAP_ASSERTION_INVALID_FILTER.get(le
.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -416,7 +414,7 @@
}
catch (Exception e)
{
- Message message = ERR_LDIF_FILE_CANNOT_OPEN_FOR_READ.get(
+ LocalizableMessage message = ERR_LDIF_FILE_CANNOT_OPEN_FOR_READ.get(
filename.getValue(), e.getLocalizedMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -442,7 +440,7 @@
}
catch (IOException ioe)
{
- Message message = ERR_LDIF_FILE_READ_ERROR.get(filename
+ LocalizableMessage message = ERR_LDIF_FILE_READ_ERROR.get(filename
.getValue(), ioe.getLocalizedMessage());
println(message);
return ResultCode.CLIENT_SIDE_LOCAL_ERROR.intValue();
@@ -469,14 +467,14 @@
if (r.getResultCode() != ResultCode.SUCCESS
&& r.getResultCode() != ResultCode.REFERRAL)
{
- Message msg = INFO_OPERATION_FAILED.get(operationType);
+ LocalizableMessage msg = INFO_OPERATION_FAILED.get(operationType);
println(msg);
println(ERR_TOOL_RESULT_CODE.get(r.getResultCode().intValue(),
r.getResultCode().toString()));
if ((r.getDiagnosticMessage() != null)
&& (r.getDiagnosticMessage().length() > 0))
{
- println(Message.raw(r.getDiagnosticMessage()));
+ println(LocalizableMessage.raw(r.getDiagnosticMessage()));
}
if (r.getMatchedDN() != null && r.getMatchedDN().length() > 0)
{
@@ -485,19 +483,19 @@
}
else
{
- Message msg = INFO_OPERATION_SUCCESSFUL
+ LocalizableMessage msg = INFO_OPERATION_SUCCESSFUL
.get(operationType, name);
println(msg);
if ((r.getDiagnosticMessage() != null)
&& (r.getDiagnosticMessage().length() > 0))
{
- println(Message.raw(r.getDiagnosticMessage()));
+ println(LocalizableMessage.raw(r.getDiagnosticMessage()));
}
if (r.getReferralURIs() != null)
{
for (String uri : r.getReferralURIs())
{
- println(Message.raw(uri));
+ println(LocalizableMessage.raw(uri));
}
}
}
diff --git a/sdk/src/com/sun/opends/sdk/tools/LDAPPasswordModify.java b/sdk/src/com/sun/opends/sdk/tools/LDAPPasswordModify.java
index 437698a..ee016b4 100644
--- a/sdk/src/com/sun/opends/sdk/tools/LDAPPasswordModify.java
+++ b/sdk/src/com/sun/opends/sdk/tools/LDAPPasswordModify.java
@@ -12,7 +12,6 @@
import org.opends.sdk.extensions.PasswordModifyRequest;
import org.opends.sdk.extensions.PasswordModifyResult;
-import com.sun.opends.sdk.util.Message;
@@ -105,7 +104,7 @@
{
// Create the command-line argument parser for use with this
// program.
- Message toolDescription = INFO_LDAPPWMOD_TOOL_DESCRIPTION.get();
+ LocalizableMessage toolDescription = INFO_LDAPPWMOD_TOOL_DESCRIPTION.get();
ArgumentParser argParser =
new ArgumentParser(LDAPPasswordModify.class.getName(), toolDescription,
false);
@@ -211,7 +210,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -224,7 +223,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
println(message);
println(argParser.getUsageMessage());
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -266,7 +265,7 @@
}
catch (DecodeException de)
{
- Message message =
+ LocalizableMessage message =
ERR_TOOL_INVALID_CONTROL_STRING.get(ctrlString);
println(message);
ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -276,7 +275,7 @@
if (newPW.isPresent() && newPWFile.isPresent())
{
- Message message = ERR_LDAPPWMOD_CONFLICTING_ARGS.get(
+ LocalizableMessage message = ERR_LDAPPWMOD_CONFLICTING_ARGS.get(
newPW.getLongIdentifier(),
newPWFile.getLongIdentifier());
println(message);
@@ -285,7 +284,7 @@
if (currentPW.isPresent() && currentPWFile.isPresent())
{
- Message message = ERR_LDAPPWMOD_CONFLICTING_ARGS.get(
+ LocalizableMessage message = ERR_LDAPPWMOD_CONFLICTING_ARGS.get(
currentPW.getLongIdentifier(),
currentPWFile.getLongIdentifier());
println(message);
@@ -344,7 +343,7 @@
}
catch (ErrorResultException e)
{
- Message message =
+ LocalizableMessage message =
ERR_LDAPPWMOD_FAILED.get(e.getResult().getResultCode().intValue(),
e.getResult().getResultCode().toString());
println(message);
@@ -365,7 +364,7 @@
return e.getResult().getResultCode().intValue();
}
- Message message = INFO_LDAPPWMOD_SUCCESSFUL.get();
+ LocalizableMessage message = INFO_LDAPPWMOD_SUCCESSFUL.get();
println(message);
String additionalInfo = result.getDiagnosticMessage();
diff --git a/sdk/src/com/sun/opends/sdk/tools/LDAPSearch.java b/sdk/src/com/sun/opends/sdk/tools/LDAPSearch.java
index dd0e6d7..d58a2bb 100644
--- a/sdk/src/com/sun/opends/sdk/tools/LDAPSearch.java
+++ b/sdk/src/com/sun/opends/sdk/tools/LDAPSearch.java
@@ -49,8 +49,6 @@
import org.opends.sdk.responses.SearchResultEntry;
import org.opends.sdk.responses.SearchResultReference;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -110,7 +108,7 @@
if (dc.getSecondsBeforeExpiration() > 0)
{
int timeToExp = dc.getSecondsBeforeExpiration();
- Message timeToExpStr = Utils.secondsToTimeString(timeToExp);
+ LocalizableMessage timeToExpStr = Utils.secondsToTimeString(timeToExp);
println(INFO_LDAPSEARCH_ACCTUSABLE_TIME_UNTIL_EXPIRATION
.get(timeToExpStr));
@@ -144,7 +142,7 @@
if (dc.getSecondsBeforeUnlock() > 0)
{
int timeToUnlock = dc.getSecondsBeforeUnlock();
- Message timeToUnlockStr = Utils
+ LocalizableMessage timeToUnlockStr = Utils
.secondsToTimeString(timeToUnlock);
println(INFO_LDAPSEARCH_ACCTUSABLE_TIME_UNTIL_UNLOCK
@@ -172,7 +170,7 @@
*/
public void handleReference(Void p, SearchResultReference reference)
{
- println(Message.raw(reference.toString()));
+ println(LocalizableMessage.raw(reference.toString()));
}
}
@@ -282,7 +280,7 @@
{
// Create the command-line argument parser for use with this
// program.
- Message toolDescription = INFO_LDAPSEARCH_TOOL_DESCRIPTION.get();
+ LocalizableMessage toolDescription = INFO_LDAPSEARCH_TOOL_DESCRIPTION.get();
ArgumentParser argParser = new ArgumentParser(LDAPSearch.class
.getName(), toolDescription, false, true, 0, 0,
"[filter] [attributes ...]");
@@ -492,7 +490,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -505,7 +503,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
println(message);
println(argParser.getUsageMessage());
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -577,7 +575,7 @@
}
catch (IOException e)
{
- println(Message.raw(e.toString()));
+ println(LocalizableMessage.raw(e.toString()));
return ResultCode.CLIENT_SIDE_FILTER_ERROR.intValue();
}
finally
@@ -682,7 +680,7 @@
}
catch (DecodeException de)
{
- Message message = ERR_TOOL_INVALID_CONTROL_STRING
+ LocalizableMessage message = ERR_TOOL_INVALID_CONTROL_STRING
.get(ctrlString);
println(message);
ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -695,7 +693,7 @@
String authzID = effectiveRightsUser.getValue();
if (!authzID.startsWith("dn:"))
{
- Message message = ERR_EFFECTIVERIGHTS_INVALID_AUTHZID
+ LocalizableMessage message = ERR_EFFECTIVERIGHTS_INVALID_AUTHZID
.get(authzID);
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -725,7 +723,7 @@
if (!tokenizer.hasMoreTokens())
{
- Message message = ERR_PSEARCH_MISSING_DESCRIPTOR.get();
+ LocalizableMessage message = ERR_PSEARCH_MISSING_DESCRIPTOR.get();
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -734,7 +732,7 @@
String token = tokenizer.nextToken();
if (!token.equals("ps"))
{
- Message message = ERR_PSEARCH_DOESNT_START_WITH_PS.get(String
+ LocalizableMessage message = ERR_PSEARCH_DOESNT_START_WITH_PS.get(String
.valueOf(infoString));
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -784,7 +782,7 @@
}
else
{
- Message message = ERR_PSEARCH_INVALID_CHANGE_TYPE
+ LocalizableMessage message = ERR_PSEARCH_INVALID_CHANGE_TYPE
.get(String.valueOf(token));
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -807,7 +805,7 @@
}
else
{
- Message message = ERR_PSEARCH_INVALID_CHANGESONLY.get(String
+ LocalizableMessage message = ERR_PSEARCH_INVALID_CHANGESONLY.get(String
.valueOf(token));
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -829,7 +827,7 @@
}
else
{
- Message message = ERR_PSEARCH_INVALID_RETURN_ECS.get(String
+ LocalizableMessage message = ERR_PSEARCH_INVALID_RETURN_ECS.get(String
.valueOf(token));
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -857,7 +855,7 @@
}
catch (LocalizedIllegalArgumentException le)
{
- Message message = ERR_LDAP_ASSERTION_INVALID_FILTER.get(le
+ LocalizableMessage message = ERR_LDAP_ASSERTION_INVALID_FILTER.get(le
.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -878,7 +876,7 @@
}
catch (LocalizedIllegalArgumentException le)
{
- Message message = ERR_LDAP_MATCHEDVALUES_INVALID_FILTER
+ LocalizableMessage message = ERR_LDAP_MATCHEDVALUES_INVALID_FILTER
.get(le.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -899,7 +897,7 @@
}
catch (DecodeException le)
{
- Message message = ERR_LDAP_SORTCONTROL_INVALID_ORDER.get(le
+ LocalizableMessage message = ERR_LDAP_SORTCONTROL_INVALID_ORDER.get(le
.getMessageObject());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -910,7 +908,7 @@
{
if (!sortOrder.isPresent())
{
- Message message = ERR_LDAPSEARCH_VLV_REQUIRES_SORT.get(
+ LocalizableMessage message = ERR_LDAPSEARCH_VLV_REQUIRES_SORT.get(
vlvDescriptor.getLongIdentifier(), sortOrder
.getLongIdentifier());
println(message);
@@ -933,7 +931,7 @@
}
catch (Exception e)
{
- Message message = ERR_LDAPSEARCH_VLV_INVALID_DESCRIPTOR.get();
+ LocalizableMessage message = ERR_LDAPSEARCH_VLV_INVALID_DESCRIPTOR.get();
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -951,14 +949,14 @@
}
catch (Exception e)
{
- Message message = ERR_LDAPSEARCH_VLV_INVALID_DESCRIPTOR.get();
+ LocalizableMessage message = ERR_LDAPSEARCH_VLV_INVALID_DESCRIPTOR.get();
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
}
else
{
- Message message = ERR_LDAPSEARCH_VLV_INVALID_DESCRIPTOR.get();
+ LocalizableMessage message = ERR_LDAPSEARCH_VLV_INVALID_DESCRIPTOR.get();
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -969,7 +967,7 @@
{
if (filters.size() > 1)
{
- Message message = ERR_PAGED_RESULTS_REQUIRES_SINGLE_FILTER
+ LocalizableMessage message = ERR_PAGED_RESULTS_REQUIRES_SINGLE_FILTER
.get();
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -983,7 +981,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -991,11 +989,11 @@
/*
* if(connectionOptions.useSASLExternal()) {
* if(!connectionOptions.useSSL() &&
- * !connectionOptions.useStartTLS()) { Message message =
+ * !connectionOptions.useStartTLS()) { LocalizableMessage message =
* ERR_TOOL_SASLEXTERNAL_NEEDS_SSL_OR_TLS.get();
* err.println(wrapText(message, MAX_LINE_WIDTH)); return
* CLIENT_SIDE_PARAM_ERROR; } if(keyStorePathValue == null) {
- * Message message = ERR_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE.get();
+ * LocalizableMessage message = ERR_TOOL_SASLEXTERNAL_NEEDS_KEYSTORE.get();
* err.println(wrapText(message, MAX_LINE_WIDTH)); return
* CLIENT_SIDE_PARAM_ERROR; } }
* connectionOptions.setVerbose(verbose.isPresent());
@@ -1063,7 +1061,7 @@
ServerSideSortControl.Response dc = (ServerSideSortControl.Response) control;
if (dc.getSortResult() != SortResult.SUCCESS)
{
- Message msg = WARN_LDAPSEARCH_SORT_ERROR.get(dc
+ LocalizableMessage msg = WARN_LDAPSEARCH_SORT_ERROR.get(dc
.getSortResult().toString());
println(msg);
}
@@ -1075,7 +1073,7 @@
VLVControl.Response dc = (VLVControl.Response) control;
if (dc.getVLVResult() == VLVResult.SUCCESS)
{
- Message msg = INFO_LDAPSEARCH_VLV_TARGET_OFFSET.get(dc
+ LocalizableMessage msg = INFO_LDAPSEARCH_VLV_TARGET_OFFSET.get(dc
.getTargetPosition());
println(msg);
@@ -1085,7 +1083,7 @@
}
else
{
- Message msg = WARN_LDAPSEARCH_VLV_ERROR.get(dc
+ LocalizableMessage msg = WARN_LDAPSEARCH_VLV_ERROR.get(dc
.getVLVResult().toString());
println(msg);
}
@@ -1117,7 +1115,7 @@
if ((result.getDiagnosticMessage() != null)
&& (result.getDiagnosticMessage().length() > 0))
{
- println(Message.raw(result.getDiagnosticMessage()));
+ println(LocalizableMessage.raw(result.getDiagnosticMessage()));
}
if (result.getMatchedDN() != null
&& result.getMatchedDN().length() > 0)
@@ -1137,7 +1135,7 @@
}
if (countEntries.isPresent() && !isQuiet())
{
- Message message = INFO_LDAPSEARCH_MATCHING_ENTRY_COUNT
+ LocalizableMessage message = INFO_LDAPSEARCH_MATCHING_ENTRY_COUNT
.get(resultHandler.entryCount);
println(message);
println();
diff --git a/sdk/src/com/sun/opends/sdk/tools/ModRate.java b/sdk/src/com/sun/opends/sdk/tools/ModRate.java
index f4aa9d5..5147a0b 100644
--- a/sdk/src/com/sun/opends/sdk/tools/ModRate.java
+++ b/sdk/src/com/sun/opends/sdk/tools/ModRate.java
@@ -41,7 +41,6 @@
import org.opends.sdk.requests.Requests;
import org.opends.sdk.responses.Result;
-import com.sun.opends.sdk.util.Message;
@@ -129,8 +128,8 @@
{
// Create the command-line argument parser for use with this
// program.
- Message toolDescription =
- Message.raw("This utility can be used to "
+ LocalizableMessage toolDescription =
+ LocalizableMessage.raw("This utility can be used to "
+ "measure modify performance");
// TODO: correct usage
ArgumentParser argParser =
@@ -186,7 +185,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -200,7 +199,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
println(message);
println(argParser.getUsageMessage());
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -233,7 +232,7 @@
}
catch (Exception ex1)
{
- println(Message.raw("Error formatting filter or base DN: "
+ println(LocalizableMessage.raw("Error formatting filter or base DN: "
+ ex1.toString()));
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
diff --git a/sdk/src/com/sun/opends/sdk/tools/MultiChoiceArgument.java b/sdk/src/com/sun/opends/sdk/tools/MultiChoiceArgument.java
index 781ac3a..2a573b3 100644
--- a/sdk/src/com/sun/opends/sdk/tools/MultiChoiceArgument.java
+++ b/sdk/src/com/sun/opends/sdk/tools/MultiChoiceArgument.java
@@ -32,8 +32,9 @@
import java.util.Collection;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
+
@@ -83,15 +84,15 @@
* Indicates whether the set of allowed values should be
* treated in a case-sensitive manner.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public MultiChoiceArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean needsValue,
- Message valuePlaceholder, Collection<T> allowedValues,
- boolean caseSensitive, Message description)
+ LocalizableMessage valuePlaceholder, Collection<T> allowedValues,
+ boolean caseSensitive, LocalizableMessage description)
throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired, false,
@@ -145,17 +146,17 @@
* Indicates whether the set of allowed values should be
* treated in a case-sensitive manner.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public MultiChoiceArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean isMultiValued,
- boolean needsValue, Message valuePlaceholder,
+ boolean needsValue, LocalizableMessage valuePlaceholder,
String defaultValue, String propertyName,
Collection<T> allowedValues, boolean caseSensitive,
- Message description) throws ArgumentException
+ LocalizableMessage description) throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired,
isMultiValued, needsValue, valuePlaceholder, defaultValue,
@@ -207,7 +208,7 @@
* <CODE>false</CODE> if it is not.
*/
public boolean valueIsAcceptable(String valueString,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
for (T o : allowedValues)
{
diff --git a/sdk/src/com/sun/opends/sdk/tools/PerformanceRunner.java b/sdk/src/com/sun/opends/sdk/tools/PerformanceRunner.java
index db2f113..f2915c2 100644
--- a/sdk/src/com/sun/opends/sdk/tools/PerformanceRunner.java
+++ b/sdk/src/com/sun/opends/sdk/tools/PerformanceRunner.java
@@ -41,7 +41,6 @@
import org.opends.sdk.AuthenticatedConnectionFactory.AuthenticatedAsynchronousConnection;
import org.opends.sdk.responses.Result;
-import com.sun.opends.sdk.util.Message;
@@ -108,60 +107,60 @@
{
this.app = app;
numThreadsArgument = new IntegerArgument("numThreads", 't',
- "numThreads", false, false, true, Message.raw("{numThreads}"),
- 1, null, true, 1, false, 0, Message
+ "numThreads", false, false, true, LocalizableMessage.raw("{numThreads}"),
+ 1, null, true, 1, false, 0, LocalizableMessage
.raw("number of search threads per connection"));
numThreadsArgument.setPropertyName("numThreads");
argParser.addArgument(numThreadsArgument);
numConnectionsArgument = new IntegerArgument("numConnections", 'c',
- "numConnections", false, false, true, Message
+ "numConnections", false, false, true, LocalizableMessage
.raw("{numConnections}"), 1, null, true, 1, false, 0,
- Message.raw("number of connections"));
+ LocalizableMessage.raw("number of connections"));
numThreadsArgument.setPropertyName("numConnections");
argParser.addArgument(numConnectionsArgument);
maxIterationsArgument = new IntegerArgument("maxIterations", 'm',
- "maxIterations", false, false, true, Message
- .raw("{maxIterations}"), 0, null, Message
+ "maxIterations", false, false, true, LocalizableMessage
+ .raw("{maxIterations}"), 0, null, LocalizableMessage
.raw("max searches per thread, 0 for unlimited"));
numThreadsArgument.setPropertyName("maxIterations");
argParser.addArgument(maxIterationsArgument);
statsIntervalArgument = new IntegerArgument("statInterval", 'i',
- "statInterval", false, false, true, Message
- .raw("{statInterval}"), 5, null, true, 1, false, 0, Message
+ "statInterval", false, false, true, LocalizableMessage
+ .raw("{statInterval}"), 5, null, true, 1, false, 0, LocalizableMessage
.raw("Display results each specified number of seconds"));
numThreadsArgument.setPropertyName("statInterval");
argParser.addArgument(statsIntervalArgument);
targetThroughputArgument = new IntegerArgument("targetThroughput",
- 'M', "targetThroughput", false, false, true, Message
- .raw("{targetThroughput}"), 0, null, Message
+ 'M', "targetThroughput", false, false, true, LocalizableMessage
+ .raw("{targetThroughput}"), 0, null, LocalizableMessage
.raw("Target average throughput to achieve"));
targetThroughputArgument.setPropertyName("targetThroughput");
argParser.addArgument(targetThroughputArgument);
percentilesArgument = new IntegerArgument("percentile", 'e',
- "percentile", false, true, Message.raw("{percentile}"), true,
- 50, true, 100, Message.raw("Calculate max response time for a "
+ "percentile", false, true, LocalizableMessage.raw("{percentile}"), true,
+ 50, true, 100, LocalizableMessage.raw("Calculate max response time for a "
+ "percentile of operations"));
percentilesArgument.setPropertyName("percentile");
argParser.addArgument(percentilesArgument);
keepConnectionsOpen = new BooleanArgument("keepConnectionsOpen",
- 'f', "keepConnectionsOpen", Message
+ 'f', "keepConnectionsOpen", LocalizableMessage
.raw("keep connections open"));
keepConnectionsOpen.setPropertyName("keepConnectionsOpen");
argParser.addArgument(keepConnectionsOpen);
noRebindArgument = new BooleanArgument("noRebind", 'F', "noRebind",
- Message.raw("keep connections open and don't rebind"));
+ LocalizableMessage.raw("keep connections open and don't rebind"));
keepConnectionsOpen.setPropertyName("noRebind");
argParser.addArgument(noRebindArgument);
asyncArgument = new BooleanArgument("asynchronous", 'A',
- "asynchronous", Message.raw("asynch, don't wait for results"));
+ "asynchronous", LocalizableMessage.raw("asynch, don't wait for results"));
keepConnectionsOpen.setPropertyName("asynchronous");
argParser.addArgument(asyncArgument);
@@ -172,10 +171,10 @@
false,
true,
true,
- Message.raw("{arguments}"),
+ LocalizableMessage.raw("{arguments}"),
null,
null,
- Message
+ LocalizableMessage
.raw("arguments for variables in the filter and/or base DN"));
arguments.setPropertyName("arguments");
argParser.addArgument(arguments);
@@ -196,7 +195,7 @@
if (!noRebindArgument.isPresent() && this.numThreads > 1)
{
- throw new ArgumentException(Message.raw("--"
+ throw new ArgumentException(LocalizableMessage.raw("--"
+ noRebindArgument.getLongIdentifier()
+ " must be used if --"
+ numThreadsArgument.getLongIdentifier() + " is > 1"));
@@ -204,7 +203,7 @@
if (!noRebindArgument.isPresent() && asyncArgument.isPresent())
{
- throw new ArgumentException(Message.raw("--"
+ throw new ArgumentException(LocalizableMessage.raw("--"
+ noRebindArgument.getLongIdentifier()
+ " must be used when using --"
+ asyncArgument.getLongIdentifier()));
@@ -216,7 +215,7 @@
}
catch (IOException ioe)
{
- throw new ArgumentException(Message
+ throw new ArgumentException(LocalizableMessage
.raw("Error occured while parsing arguments: "
+ ioe.toString()));
}
@@ -266,7 +265,7 @@
catch (ErrorResultException e)
{
stopRequested = true;
- app.println(Message.raw(e.getResult().getDiagnosticMessage()));
+ app.println(LocalizableMessage.raw(e.getResult().getDiagnosticMessage()));
}
return 0;
@@ -337,7 +336,7 @@
public void handleErrorResult(Void p, ErrorResultException error)
{
failedRecentCount.getAndIncrement();
- app.println(Message.raw(error.getResult().toString()));
+ app.println(LocalizableMessage.raw(error.getResult().toString()));
}
@@ -422,7 +421,7 @@
}
catch (ErrorResultException e)
{
- app.println(Message.raw(e.getResult()
+ app.println(LocalizableMessage.raw(e.getResult()
.getDiagnosticMessage()));
if (e.getCause() != null && app.isVerbose())
{
@@ -450,7 +449,7 @@
}
catch (ErrorResultException e)
{
- app.println(Message.raw(e.getResult().toString()));
+ app.println(LocalizableMessage.raw(e.getResult().toString()));
if (e.getCause() != null && app.isVerbose())
{
e.getCause().printStackTrace(app.getErrorStream());
diff --git a/sdk/src/com/sun/opends/sdk/tools/PromptingTrustManager.java b/sdk/src/com/sun/opends/sdk/tools/PromptingTrustManager.java
index 400ee46..ec74304 100644
--- a/sdk/src/com/sun/opends/sdk/tools/PromptingTrustManager.java
+++ b/sdk/src/com/sun/opends/sdk/tools/PromptingTrustManager.java
@@ -49,8 +49,9 @@
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
+
import com.sun.opends.sdk.util.Validator;
@@ -84,7 +85,7 @@
private Integer choice;
- private Message msg;
+ private LocalizableMessage msg;
@@ -96,7 +97,7 @@
* @param msg
* the message message.
*/
- private TrustOption(int i, Message msg)
+ private TrustOption(int i, LocalizableMessage msg)
{
choice = i;
this.msg = msg;
@@ -121,7 +122,7 @@
*
* @return the menu message.
*/
- Message getMenuMessage()
+ LocalizableMessage getMenuMessage()
{
return msg;
}
@@ -338,7 +339,7 @@
{
menuOptions.put(t.getChoice().toString(), t);
- MessageBuilder builder = new MessageBuilder();
+ LocalizableMessageBuilder builder = new LocalizableMessageBuilder();
builder.append(t.getChoice());
builder.append(") ");
builder.append(t.getMenuMessage());
@@ -346,7 +347,7 @@
}
TrustOption defaultTrustMethod = TrustOption.SESSION;
- Message promptMsg = INFO_MENU_PROMPT_SINGLE_DEFAULT
+ LocalizableMessage promptMsg = INFO_MENU_PROMPT_SINGLE_DEFAULT
.get(defaultTrustMethod.getChoice().toString());
while (true)
diff --git a/sdk/src/com/sun/opends/sdk/tools/SearchRate.java b/sdk/src/com/sun/opends/sdk/tools/SearchRate.java
index 9c4f156..d2af841 100644
--- a/sdk/src/com/sun/opends/sdk/tools/SearchRate.java
+++ b/sdk/src/com/sun/opends/sdk/tools/SearchRate.java
@@ -47,7 +47,6 @@
import org.opends.sdk.responses.SearchResultEntry;
import org.opends.sdk.responses.SearchResultReference;
-import com.sun.opends.sdk.util.Message;
@@ -136,7 +135,7 @@
{
// Create the command-line argument parser for use with this
// program.
- Message toolDescription = Message
+ LocalizableMessage toolDescription = LocalizableMessage
.raw("This utility can be used to "
+ "measure search performance");
// TODO: correct usage
@@ -209,7 +208,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
println(message);
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
@@ -223,7 +222,7 @@
}
catch (ArgumentException ae)
{
- Message message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
+ LocalizableMessage message = ERR_ERROR_PARSING_ARGS.get(ae.getMessage());
println(message);
println(argParser.getUsageMessage());
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
@@ -277,7 +276,7 @@
}
catch (Exception ex1)
{
- println(Message.raw("Error formatting filter or base DN: "
+ println(LocalizableMessage.raw("Error formatting filter or base DN: "
+ ex1.toString()));
return ResultCode.CLIENT_SIDE_PARAM_ERROR.intValue();
}
diff --git a/sdk/src/com/sun/opends/sdk/tools/StringArgument.java b/sdk/src/com/sun/opends/sdk/tools/StringArgument.java
index e80bd46..832ec24 100644
--- a/sdk/src/com/sun/opends/sdk/tools/StringArgument.java
+++ b/sdk/src/com/sun/opends/sdk/tools/StringArgument.java
@@ -28,8 +28,8 @@
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
@@ -61,14 +61,14 @@
* displayed in usage information, or <CODE>null</CODE> if
* this argument does not require a value.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public StringArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean needsValue,
- Message valuePlaceholder, Message description)
+ LocalizableMessage valuePlaceholder, LocalizableMessage description)
throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired, false,
@@ -111,15 +111,15 @@
* used to override the default value but will be overridden
* by a command-line argument.
* @param description
- * Message for the description of this argument.
+ * LocalizableMessage for the description of this argument.
* @throws ArgumentException
* If there is a problem with any of the parameters used to
* create this argument.
*/
public StringArgument(String name, Character shortIdentifier,
String longIdentifier, boolean isRequired, boolean isMultiValued,
- boolean needsValue, Message valuePlaceholder,
- String defaultValue, String propertyName, Message description)
+ boolean needsValue, LocalizableMessage valuePlaceholder,
+ String defaultValue, String propertyName, LocalizableMessage description)
throws ArgumentException
{
super(name, shortIdentifier, longIdentifier, isRequired,
@@ -142,7 +142,7 @@
* <CODE>false</CODE> if it is not.
*/
public boolean valueIsAcceptable(String valueString,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// All values will be acceptable for this argument.
return true;
diff --git a/sdk/src/com/sun/opends/sdk/tools/Utils.java b/sdk/src/com/sun/opends/sdk/tools/Utils.java
index ed04169..bc17110 100644
--- a/sdk/src/com/sun/opends/sdk/tools/Utils.java
+++ b/sdk/src/com/sun/opends/sdk/tools/Utils.java
@@ -36,15 +36,11 @@
import java.io.IOException;
import java.util.StringTokenizer;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.Connection;
-import org.opends.sdk.DecodeException;
-import org.opends.sdk.ErrorResultException;
+import org.opends.sdk.*;
import org.opends.sdk.AuthenticatedConnectionFactory.AuthenticatedConnection;
import org.opends.sdk.controls.*;
import org.opends.sdk.responses.BindResult;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -106,9 +102,9 @@
* there is a suitable breaking point.
* @return The wrapped text.
*/
- static String wrapText(Message message, int width)
+ static String wrapText(LocalizableMessage message, int width)
{
- return wrapText(Message.toString(message), width, 0);
+ return wrapText(message.toString(), width, 0);
}
@@ -152,9 +148,9 @@
* The number of columns to indent each line.
* @return The wrapped text.
*/
- static String wrapText(Message message, int width, int indent)
+ static String wrapText(LocalizableMessage message, int width, int indent)
{
- return wrapText(Message.toString(message), width, indent);
+ return wrapText(message.toString(), width, indent);
}
@@ -412,7 +408,7 @@
else
{
// TODO: I18N
- throw DecodeException.error(Message
+ throw DecodeException.error(LocalizableMessage
.raw("Invalid format for criticality value:" + remainder));
}
return new GenericControl(controlOID, controlCriticality);
@@ -431,7 +427,7 @@
else
{
// TODO: I18N
- throw DecodeException.error(Message
+ throw DecodeException.error(LocalizableMessage
.raw("Invalid format for criticality value:" + critical));
}
@@ -532,7 +528,7 @@
// if ((ere.getMessage() != null) && (ere.getMessage().length() >
// 0))
// {
- // app.println(Message.raw(ere.getMessage()));
+ // app.println(LocalizableMessage.raw(ere.getMessage()));
// }
if (ere.getResult().getResultCode().intValue() >= 0)
@@ -577,7 +573,7 @@
* @return The user-friendly representation of the specified number of
* seconds.
*/
- static Message secondsToTimeString(int numSeconds)
+ static LocalizableMessage secondsToTimeString(int numSeconds)
{
if (numSeconds < 60)
{
@@ -625,7 +621,7 @@
if (control != null)
{
AuthorizationIdentityControl.Response dc = (AuthorizationIdentityControl.Response) control;
- Message message = INFO_BIND_AUTHZID_RETURNED.get(dc
+ LocalizableMessage message = INFO_BIND_AUTHZID_RETURNED.get(dc
.getAuthorizationID());
app.println(message);
}
@@ -633,7 +629,7 @@
.getControl(PasswordExpiredControl.OID_NS_PASSWORD_EXPIRED);
if (control != null)
{
- Message message = INFO_BIND_PASSWORD_EXPIRED.get();
+ LocalizableMessage message = INFO_BIND_PASSWORD_EXPIRED.get();
app.println(message);
}
control = result
@@ -641,9 +637,9 @@
if (control != null)
{
PasswordExpiringControl dc = (PasswordExpiringControl) control;
- Message timeString = Utils.secondsToTimeString(dc
+ LocalizableMessage timeString = Utils.secondsToTimeString(dc
.getSecondsUntilExpiration());
- Message message = INFO_BIND_PASSWORD_EXPIRING.get(timeString);
+ LocalizableMessage message = INFO_BIND_PASSWORD_EXPIRING.get(timeString);
app.println(message);
}
control = result
@@ -654,32 +650,32 @@
PasswordPolicyErrorType errorType = dc.getErrorType();
if (errorType == PasswordPolicyErrorType.PASSWORD_EXPIRED)
{
- Message message = INFO_BIND_PASSWORD_EXPIRED.get();
+ LocalizableMessage message = INFO_BIND_PASSWORD_EXPIRED.get();
app.println(message);
}
else if (errorType == PasswordPolicyErrorType.ACCOUNT_LOCKED)
{
- Message message = INFO_BIND_ACCOUNT_LOCKED.get();
+ LocalizableMessage message = INFO_BIND_ACCOUNT_LOCKED.get();
app.println(message);
}
else if (errorType == PasswordPolicyErrorType.CHANGE_AFTER_RESET)
{
- Message message = INFO_BIND_MUST_CHANGE_PASSWORD.get();
+ LocalizableMessage message = INFO_BIND_MUST_CHANGE_PASSWORD.get();
app.println(message);
}
PasswordPolicyWarningType warningType = dc.getWarningType();
if (warningType == PasswordPolicyWarningType.TIME_BEFORE_EXPIRATION)
{
- Message timeString = Utils.secondsToTimeString(dc
+ LocalizableMessage timeString = Utils.secondsToTimeString(dc
.getWarningValue());
- Message message = INFO_BIND_PASSWORD_EXPIRING.get(timeString);
+ LocalizableMessage message = INFO_BIND_PASSWORD_EXPIRING.get(timeString);
app.println(message);
}
else if (warningType == PasswordPolicyWarningType.GRACE_LOGINS_REMAINING)
{
- Message message = INFO_BIND_GRACE_LOGINS_REMAINING.get(dc
+ LocalizableMessage message = INFO_BIND_GRACE_LOGINS_REMAINING.get(dc
.getWarningValue());
app.println(message);
}
diff --git a/sdk/src/com/sun/opends/sdk/util/Base64.java b/sdk/src/com/sun/opends/sdk/util/Base64.java
index b9dcde1..446962e 100755
--- a/sdk/src/com/sun/opends/sdk/util/Base64.java
+++ b/sdk/src/com/sun/opends/sdk/util/Base64.java
@@ -31,9 +31,7 @@
import static com.sun.opends.sdk.messages.Messages.*;
import static com.sun.opends.sdk.util.Validator.*;
-import org.opends.sdk.ByteSequence;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.ByteStringBuilder;
+import org.opends.sdk.*;
@@ -141,7 +139,7 @@
int length = base64.length();
if ((length % 4) != 0)
{
- Message message = ERR_BASE64_DECODE_INVALID_LENGTH.get(base64);
+ LocalizableMessage message = ERR_BASE64_DECODE_INVALID_LENGTH.get(base64);
throw new LocalizedIllegalArgumentException(message);
}
@@ -361,7 +359,7 @@
}
break;
default:
- Message message =
+ LocalizableMessage message =
ERR_BASE64_DECODE_INVALID_CHARACTER.get(base64, base64
.charAt(i + j));
throw new LocalizedIllegalArgumentException(message);
diff --git a/sdk/src/com/sun/opends/sdk/util/MessageDescriptor.java b/sdk/src/com/sun/opends/sdk/util/LocalizableMessageDescriptor.java
similarity index 65%
rename from sdk/src/com/sun/opends/sdk/util/MessageDescriptor.java
rename to sdk/src/com/sun/opends/sdk/util/LocalizableMessageDescriptor.java
index 1863f96..b276542 100755
--- a/sdk/src/com/sun/opends/sdk/util/MessageDescriptor.java
+++ b/sdk/src/com/sun/opends/sdk/util/LocalizableMessageDescriptor.java
@@ -22,37 +22,29 @@
* CDDL HEADER END
*
*
- * Copyright 2008 Sun Microsystems, Inc.
+ * Copyright 2009 Sun Microsystems, Inc.
*/
package com.sun.opends.sdk.util;
-import java.util.HashMap;
import java.util.Locale;
-import java.util.Map;
import java.util.ResourceBundle;
+import org.opends.sdk.LocalizableMessage;
+
/**
- * Base class for all Message descriptor classes.
+ * An opaque handle to a localizable message.
*/
-public abstract class MessageDescriptor
+public abstract class LocalizableMessageDescriptor
{
-
- /**
- * ID for messages that don't have a real ID.
- */
- public static final int NULL_ID = -1;
-
-
-
/**
* Subclass for creating messages with no arguments.
*/
- static public final class Arg0 extends MessageDescriptor
+ public static final class Arg0 extends LocalizableMessageDescriptor
{
/**
@@ -60,9 +52,9 @@
* away with this for the zero argument message because it is
* immutable.
*/
- private Message message;
+ private final LocalizableMessage message;
- private boolean requiresFormat;
+ private final boolean requiresFormat;
@@ -79,7 +71,7 @@
public Arg0(String rbBase, String key, ClassLoader classLoader)
{
super(rbBase, key, classLoader);
- message = new Message(this);
+ message = newMessage(this);
requiresFormat = containsArgumentLiterals(getFormatString());
}
@@ -88,9 +80,9 @@
/**
* Creates a message.
*
- * @return Message object
+ * @return LocalizableMessage object
*/
- public Message get()
+ public LocalizableMessage get()
{
return message;
}
@@ -100,7 +92,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return requiresFormat;
}
@@ -114,7 +106,7 @@
* @param <T1>
* The type of the first message argument.
*/
- static public final class Arg1<T1> extends MessageDescriptor
+ public static final class Arg1<T1> extends LocalizableMessageDescriptor
{
/**
@@ -139,13 +131,13 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param a1
* message argument
*/
- public Message get(T1 a1)
+ public LocalizableMessage get(T1 a1)
{
- return new Message(this, a1);
+ return newMessage(this, a1);
}
@@ -153,7 +145,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return true;
}
@@ -170,7 +162,7 @@
* @param <T2>
* The type of the second message argument.
*/
- static public final class Arg2<T1, T2> extends MessageDescriptor
+ public static final class Arg2<T1, T2> extends LocalizableMessageDescriptor
{
/**
@@ -195,15 +187,15 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param a1
* message argument
* @param a2
* message argument
*/
- public Message get(T1 a1, T2 a2)
+ public LocalizableMessage get(T1 a1, T2 a2)
{
- return new Message(this, a1, a2);
+ return newMessage(this, a1, a2);
}
@@ -211,7 +203,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return true;
}
@@ -230,7 +222,7 @@
* @param <T3>
* The type of the third message argument.
*/
- static public final class Arg3<T1, T2, T3> extends MessageDescriptor
+ public static final class Arg3<T1, T2, T3> extends LocalizableMessageDescriptor
{
/**
@@ -255,7 +247,7 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param a1
* message argument
* @param a2
@@ -263,9 +255,9 @@
* @param a3
* message argument
*/
- public Message get(T1 a1, T2 a2, T3 a3)
+ public LocalizableMessage get(T1 a1, T2 a2, T3 a3)
{
- return new Message(this, a1, a2, a3);
+ return newMessage(this, a1, a2, a3);
}
@@ -273,7 +265,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return true;
}
@@ -294,8 +286,8 @@
* @param <T4>
* The type of the fourth message argument.
*/
- static public final class Arg4<T1, T2, T3, T4> extends
- MessageDescriptor
+ public static final class Arg4<T1, T2, T3, T4> extends
+ LocalizableMessageDescriptor
{
/**
@@ -320,7 +312,7 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param a1
* message argument
* @param a2
@@ -330,9 +322,9 @@
* @param a4
* message argument
*/
- public Message get(T1 a1, T2 a2, T3 a3, T4 a4)
+ public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4)
{
- return new Message(this, a1, a2, a3, a4);
+ return newMessage(this, a1, a2, a3, a4);
}
@@ -340,7 +332,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return true;
}
@@ -363,8 +355,8 @@
* @param <T5>
* The type of the fifth message argument.
*/
- static public final class Arg5<T1, T2, T3, T4, T5> extends
- MessageDescriptor
+ public static final class Arg5<T1, T2, T3, T4, T5> extends
+ LocalizableMessageDescriptor
{
/**
@@ -389,7 +381,7 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param a1
* message argument
* @param a2
@@ -401,9 +393,9 @@
* @param a5
* message argument
*/
- public Message get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
+ public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5)
{
- return new Message(this, a1, a2, a3, a4, a5);
+ return newMessage(this, a1, a2, a3, a4, a5);
}
@@ -411,7 +403,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return true;
}
@@ -436,8 +428,8 @@
* @param <T6>
* The type of the sixth message argument.
*/
- static public final class Arg6<T1, T2, T3, T4, T5, T6> extends
- MessageDescriptor
+ public static final class Arg6<T1, T2, T3, T4, T5, T6> extends
+ LocalizableMessageDescriptor
{
/**
@@ -462,7 +454,7 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param a1
* message argument
* @param a2
@@ -476,9 +468,9 @@
* @param a6
* message argument
*/
- public Message get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
+ public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6)
{
- return new Message(this, a1, a2, a3, a4, a5, a6);
+ return newMessage(this, a1, a2, a3, a4, a5, a6);
}
@@ -486,7 +478,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return true;
}
@@ -513,8 +505,8 @@
* @param <T7>
* The type of the seventh message argument.
*/
- static public final class Arg7<T1, T2, T3, T4, T5, T6, T7> extends
- MessageDescriptor
+ public static final class Arg7<T1, T2, T3, T4, T5, T6, T7> extends
+ LocalizableMessageDescriptor
{
/**
@@ -539,7 +531,7 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param a1
* message argument
* @param a2
@@ -555,9 +547,9 @@
* @param a7
* message argument
*/
- public Message get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
+ public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7)
{
- return new Message(this, a1, a2, a3, a4, a5, a6, a7);
+ return newMessage(this, a1, a2, a3, a4, a5, a6, a7);
}
@@ -565,7 +557,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return true;
}
@@ -594,8 +586,8 @@
* @param <T8>
* The type of the eighth message argument.
*/
- static public final class Arg8<T1, T2, T3, T4, T5, T6, T7, T8>
- extends MessageDescriptor
+ public static final class Arg8<T1, T2, T3, T4, T5, T6, T7, T8>
+ extends LocalizableMessageDescriptor
{
/**
@@ -620,7 +612,7 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param a1
* message argument
* @param a2
@@ -638,10 +630,10 @@
* @param a8
* message argument
*/
- public Message get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7,
+ public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7,
T8 a8)
{
- return new Message(this, a1, a2, a3, a4, a5, a6, a7, a8);
+ return newMessage(this, a1, a2, a3, a4, a5, a6, a7, a8);
}
@@ -649,7 +641,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return true;
}
@@ -680,8 +672,8 @@
* @param <T9>
* The type of the ninth message argument.
*/
- static public final class Arg9<T1, T2, T3, T4, T5, T6, T7, T8, T9>
- extends MessageDescriptor
+ public static final class Arg9<T1, T2, T3, T4, T5, T6, T7, T8, T9>
+ extends LocalizableMessageDescriptor
{
/**
@@ -706,7 +698,7 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param a1
* message argument
* @param a2
@@ -726,10 +718,10 @@
* @param a9
* message argument
*/
- public Message get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7,
+ public LocalizableMessage get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7,
T8 a8, T9 a9)
{
- return new Message(this, a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ return newMessage(this, a1, a2, a3, a4, a5, a6, a7, a8, a9);
}
@@ -737,196 +729,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
- {
- return true;
- }
-
- }
-
-
-
- /**
- * Subclass for creating messages with ten arguments.
- *
- * @param <T1>
- * The type of the first message argument.
- * @param <T2>
- * The type of the second message argument.
- * @param <T3>
- * The type of the third message argument.
- * @param <T4>
- * The type of the fourth message argument.
- * @param <T5>
- * The type of the fifth message argument.
- * @param <T6>
- * The type of the sixth message argument.
- * @param <T7>
- * The type of the seventh message argument.
- * @param <T8>
- * The type of the eighth message argument.
- * @param <T9>
- * The type of the ninth message argument.
- * @param <T10>
- * The type of the tenth message argument.
- */
- static public final class Arg10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
- extends MessageDescriptor
- {
-
- /**
- * Creates a parameterized instance.
- *
- * @param rbBase
- * base of the backing resource bundle
- * @param key
- * for accessing the format string from the resource bundle
- * @param classLoader
- * the class loader to be used to get the ResourceBundle
- */
- public Arg10(String rbBase, String key, ClassLoader classLoader)
- {
- super(rbBase, key, classLoader);
- }
-
-
-
- /**
- * Creates a message with arguments that will replace format
- * specifiers in the assocated format string when the message is
- * rendered to string representation.
- *
- * @return Message object
- * @param a1
- * message argument
- * @param a2
- * message argument
- * @param a3
- * message argument
- * @param a4
- * message argument
- * @param a5
- * message argument
- * @param a6
- * message argument
- * @param a7
- * message argument
- * @param a8
- * message argument
- * @param a9
- * message argument
- * @param a10
- * message argument
- */
- public Message get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7,
- T8 a8, T9 a9, T10 a10)
- {
- return new Message(this, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
- }
-
-
-
- /**
- * {@inheritDoc}
- */
- boolean requiresFormatter()
- {
- return true;
- }
-
- }
-
-
-
- /**
- * Subclass for creating messages with eleven arguments.
- *
- * @param <T1>
- * The type of the first message argument.
- * @param <T2>
- * The type of the second message argument.
- * @param <T3>
- * The type of the third message argument.
- * @param <T4>
- * The type of the fourth message argument.
- * @param <T5>
- * The type of the fifth message argument.
- * @param <T6>
- * The type of the sixth message argument.
- * @param <T7>
- * The type of the seventh message argument.
- * @param <T8>
- * The type of the eighth message argument.
- * @param <T9>
- * The type of the ninth message argument.
- * @param <T10>
- * The type of the tenth message argument.
- * @param <T11>
- * The type of the eleventh message argument.
- */
- static public final class Arg11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
- extends MessageDescriptor
- {
-
- /**
- * Creates a parameterized instance.
- *
- * @param rbBase
- * base of the backing resource bundle
- * @param key
- * for accessing the format string from the resource bundle
- * @param classLoader
- * the class loader to be used to get the ResourceBundle
- */
- public Arg11(String rbBase, String key, ClassLoader classLoader)
- {
- super(rbBase, key, classLoader);
- }
-
-
-
- /**
- * Creates a message with arguments that will replace format
- * specifiers in the assocated format string when the message is
- * rendered to string representation.
- *
- * @return Message object
- * @param a1
- * message argument
- * @param a2
- * message argument
- * @param a3
- * message argument
- * @param a4
- * message argument
- * @param a5
- * message argument
- * @param a6
- * message argument
- * @param a7
- * message argument
- * @param a8
- * message argument
- * @param a9
- * message argument
- * @param a10
- * message argument
- * @param a11
- * message argument
- */
- public Message get(T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7,
- T8 a8, T9 a9, T10 a10, T11 a11)
- {
- return new Message(this, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
- a11);
- }
-
-
-
- /**
- * {@inheritDoc}
- */
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return true;
}
@@ -941,7 +744,7 @@
* defined with more arguments that can be handled with the current
* number of subclasses
*/
- static public final class ArgN extends MessageDescriptor
+ public static final class ArgN extends LocalizableMessageDescriptor
{
/**
@@ -966,13 +769,13 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param args
* message arguments
*/
- public Message get(Object... args)
+ public LocalizableMessage get(Object... args)
{
- return new Message(this, args);
+ return newMessage(this, args);
}
@@ -980,7 +783,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return true;
}
@@ -995,12 +798,12 @@
* plugins may want to use the mechanism to create messages without
* storing their strings in resource bundles.
*/
- static final class Raw extends MessageDescriptor
+ public static final class Raw extends LocalizableMessageDescriptor
{
- private String formatString;
+ private final String formatString;
- private boolean requiresFormatter;
+ private final boolean requiresFormatter;
@@ -1010,7 +813,7 @@
* @param formatString
* for created messages
*/
- Raw(CharSequence formatString)
+ public Raw(CharSequence formatString)
{
super(null, null, null);
this.formatString = formatString != null ? formatString
@@ -1025,13 +828,13 @@
* specifiers in the assocated format string when the message is
* rendered to string representation.
*
- * @return Message object
+ * @return LocalizableMessage object
* @param args
* message arguments
*/
- public Message get(Object... args)
+ public LocalizableMessage get(Object... args)
{
- return new Message(this, args);
+ return newMessage(this, args);
}
@@ -1044,8 +847,7 @@
* ignored
* @return format string
*/
- @Override
- String getFormatString(Locale locale)
+ public String getFormatString(Locale locale)
{
return this.formatString;
}
@@ -1055,7 +857,7 @@
/**
* {@inheritDoc}
*/
- boolean requiresFormatter()
+ public boolean requiresFormatter()
{
return this.requiresFormatter;
}
@@ -1064,92 +866,61 @@
- /** String for accessing backing resource bundle. */
- private final String rbBase;
-
- /** Used for accessing format string from the resource bundle. */
- private final String key;
-
- /**
- * The class loader to be used to retrieve the ResourceBundle. If null
- * the default class loader will be used.
- */
- private final ClassLoader classLoader;
-
- private final Map<Locale, String> formatStrMap = new HashMap<Locale, String>();
-
-
-
- /**
- * Returns the key for accessing the message template in a resource
- * bundle. May be null for raw messages.
- *
- * @return key of this message
- */
- public final String getKey()
+ // Container for caching the last locale specific format string.
+ private static final class CachedFormatString
{
- return this.key;
- }
+ private final Locale locale;
+
+ private final String formatString;
- /**
- * Obtains the resource bundle base string used to access the resource
- * bundle containing created message's format string. May be null for
- * raw messages.
- *
- * @return string base
- */
- public final String getBase()
- {
- return this.rbBase;
- }
-
-
-
- /**
- * Indicates whether or not this descriptor format string should be
- * processed by Formatter during string rendering.
- *
- * @return boolean where true means Formatter should be used; false
- * otherwise
- * @see java.util.Formatter
- */
- abstract boolean requiresFormatter();
-
-
-
- /**
- * Obtains the format string for constructing the string value of this
- * message according to the default locale.
- *
- * @return format string
- */
- final String getFormatString()
- {
- return getFormatString(Locale.getDefault());
- }
-
-
-
- /**
- * Obtains the format string for constructing the string value of this
- * message according to the requested locale.
- *
- * @param locale
- * for the returned format string
- * @return format string
- */
- String getFormatString(Locale locale)
- {
- String fmtStr = formatStrMap.get(locale);
- if (fmtStr == null)
+ private CachedFormatString(Locale locale, String formatString)
{
- ResourceBundle bundle = getBundle(locale);
- fmtStr = bundle.getString(this.key);
- formatStrMap.put(locale, fmtStr);
+ this.locale = locale;
+ this.formatString = formatString;
}
- return fmtStr;
+ }
+
+
+
+ /**
+ * Factory interface for creating messages. Only LocalizableMessage should
+ * implement this.
+ */
+ public static interface MessageFactory
+ {
+ /**
+ * Creates a new parameterized message instance.
+ *
+ * @param descriptor
+ * The message descriptor.
+ * @param args
+ * The message parameters.
+ * @return The new message.
+ */
+ LocalizableMessage newMessage(LocalizableMessageDescriptor descriptor, Object... args);
+ }
+
+
+
+ /**
+ * We use a factory for creating LocalizableMessage objects in order to avoid
+ * exposing this class in the public API.
+ */
+ public static MessageFactory MESSAGE_FACTORY;
+
+ // Force MESSAGE_FACTORY to be set.
+ static
+ {
+ try
+ {
+ Class.forName("org.opends.sdk.LocalizableMessage");
+ }
+ catch (ClassNotFoundException e)
+ {
+ throw new RuntimeException(e);
+ }
}
@@ -1161,32 +932,42 @@
* not replaced by arguments.
*
* @param s
- * candiate for formatting
+ * candidate for formatting
* @return boolean where true indicates that the format string
* requires formatting
*/
- protected final boolean containsArgumentLiterals(String s)
+ private static final boolean containsArgumentLiterals(String s)
{
return s.matches(".*%[n|%].*"); // match Formatter literals
}
- private ResourceBundle getBundle(Locale locale)
+ private static LocalizableMessage newMessage(LocalizableMessageDescriptor descriptor,
+ Object... args)
{
- if (locale == null) locale = Locale.getDefault();
- if (classLoader == null)
- {
- return ResourceBundle.getBundle(this.rbBase, locale);
- }
- else
- {
- return ResourceBundle.getBundle(this.rbBase, locale, classLoader);
- }
+ return MESSAGE_FACTORY.newMessage(descriptor, args);
}
+ // String for accessing backing resource bundle.
+ private final String rbBase;
+
+ // Used for accessing format string from the resource bundle.
+ private final String key;
+
+ /*
+ * The class loader to be used to retrieve the ResourceBundle. If null
+ * the default class loader will be used.
+ */
+ private final ClassLoader classLoader;
+
+ // It's ok if there are race conditions.
+ private CachedFormatString cachedFormatString = null;
+
+
+
/**
* Creates a parameterized message descriptor.
*
@@ -1197,7 +978,7 @@
* @param classLoader
* the class loader to be used to get the ResourceBundle
*/
- private MessageDescriptor(String rbBase, String key,
+ private LocalizableMessageDescriptor(String rbBase, String key,
ClassLoader classLoader)
{
this.rbBase = rbBase;
@@ -1205,4 +986,79 @@
this.classLoader = classLoader;
}
+
+
+ /**
+ * Returns the format string which should be used when creating the
+ * string representation of this message using the specified locale.
+ *
+ * @param locale
+ * The locale.
+ * @return The format string.
+ * @throws NullPointerException
+ * If {@code locale} was {@code null}.
+ */
+ public String getFormatString(Locale locale)
+ throws NullPointerException
+ {
+ Validator.ensureNotNull(locale);
+
+ // Fast path.
+ final CachedFormatString cfs = cachedFormatString;
+ if (cfs != null && cfs.locale == locale)
+ {
+ return cfs.formatString;
+ }
+
+ // There's a potential race condition here but it's benign - we'll
+ // just do a bit more work than needed.
+ final ResourceBundle bundle = getBundle(locale);
+ final String formatString = bundle.getString(key);
+ cachedFormatString = new CachedFormatString(locale, formatString);
+
+ return formatString;
+ }
+
+
+
+ /**
+ * Indicates whether or not this descriptor format string should be
+ * processed by {@code Formatter} during string rendering.
+ *
+ * @return {@code true} if a {@code Formatter} should be used,
+ * otherwise {@code false}.
+ */
+ public abstract boolean requiresFormatter();
+
+
+
+ private ResourceBundle getBundle(Locale locale)
+ {
+ if (locale == null)
+ {
+ locale = Locale.getDefault();
+ }
+ if (classLoader == null)
+ {
+ return ResourceBundle.getBundle(this.rbBase, locale);
+ }
+ else
+ {
+ return ResourceBundle.getBundle(this.rbBase, locale, classLoader);
+ }
+ }
+
+
+
+ /**
+ * Returns the format string which should be used when creating the
+ * string representation of this message using the default locale.
+ *
+ * @return The format string.
+ */
+ final String getFormatString()
+ {
+ return getFormatString(Locale.getDefault());
+ }
+
}
diff --git a/sdk/src/com/sun/opends/sdk/util/Message.java b/sdk/src/com/sun/opends/sdk/util/Message.java
deleted file mode 100755
index b97b1e0..0000000
--- a/sdk/src/com/sun/opends/sdk/util/Message.java
+++ /dev/null
@@ -1,543 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2008 Sun Microsystems, Inc.
- */
-
-package com.sun.opends.sdk.util;
-
-
-
-import java.util.Formattable;
-import java.util.Formatter;
-import java.util.IllegalFormatException;
-import java.util.Locale;
-
-
-
-/**
- * Renders sensitive textural strings. In most cases message are
- * intended to render textural strings in a locale-sensitive manner
- * although this class defines convenience methods for creating
- * uninternationalized <code>Message</code> objects that render the same
- * text regardless of the requested locale. This class implements
- * <code>CharSequence</code> so that messages can be supplied as
- * arguments to other messages. This way messages can be composed of
- * fragments of other messages if necessary.
- *
- * @see MessageDescriptor
- */
-public final class Message implements CharSequence, Formattable,
- Comparable<Message>
-{
-
- /** Represents an empty message string. */
- public static final Message EMPTY = Message.raw("");
-
- // Variable used to workaround a bug in AIX Java 1.6
- // TODO: remove this code once the JDK issue referenced in 3077 is
- // closed.
- private final boolean isAIXPost5 = isAIXPost5();
-
-
-
- /**
- * Creates an uninternationalized message that will render itself the
- * same way regardless of the locale requested in
- * <code>toString(Locale)</code>. The message will have a category of
- * <code>Category.USER_DEFINED</code> and a severity of
- * <code>Severity.INFORMATION</code> Note that the types for
- * <code>args</code> must be consistent with any argument specifiers
- * appearing in <code>formatString</code> according to the rules of
- * java.util.Formatter. A mismatch in type information will cause this
- * message to render without argument substitution. Before using this
- * method you should be sure that the message you are creating is
- * locale sensitive. If so you should instead create a formal message.
- *
- * @param formatString
- * of the message or the message itself if not arguments are
- * necessary
- * @param args
- * any arguments for the format string
- * @return a message object that will render the same in all locales;
- * null if <code>formatString</code> is null
- */
- static public Message raw(CharSequence formatString, Object... args)
- {
- Message message = null;
- if (formatString != null)
- {
- message = new MessageDescriptor.Raw(formatString).get(args);
- }
- return message;
- }
-
-
-
- /**
- * Creates an uninternationalized message from the string
- * representation of an object. Note that the types for
- * <code>args</code> must be consistent with any argument specifiers
- * appearing in <code>formatString</code> according to the rules of
- * java.util.Formatter. A mismatch in type information will cause this
- * message to render without argument substitution.
- *
- * @param object
- * from which the message will be created
- * @param arguments
- * for message
- * @return a message object that will render the same in all locales;
- * null if <code>object</code> is null
- */
- static public Message fromObject(Object object, Object... arguments)
- {
- Message message = null;
- if (object != null)
- {
- CharSequence cs = object.toString();
- message = raw(cs, arguments);
- }
- return message;
- }
-
-
-
- /**
- * Returns the string representation of the message in the default
- * locale.
- *
- * @param message
- * to stringify
- * @return String representation of of <code>message</code> of null if
- * <code>message</code> is null
- */
- static public String toString(Message message)
- {
- return message != null ? message.toString() : null;
- }
-
-
-
- /** Descriptor of this message. */
- private final MessageDescriptor descriptor;
-
- /** Values used to replace argument specifiers in the format string. */
- private final Object[] args;
-
-
-
- /**
- * Gets the string representation of this message.
- *
- * @return String representation of this message
- */
- public String toString()
- {
- return toString(Locale.getDefault());
- }
-
-
-
- /**
- * Gets the string representation of this message appropriate for
- * <code>locale</code>.
- *
- * @param locale
- * for which the string representation will be returned
- * @return String representation of this message
- */
- public String toString(Locale locale)
- {
- String s;
- String fmt = descriptor.getFormatString(locale);
- if (descriptor.requiresFormatter())
- {
- try
- {
- // TODO: remove this code once the JDK issue referenced in 3077
- // is
- // closed.
- if (isAIXPost5)
- {
- // Java 6 in AIX Formatter does not handle properly
- // Formattable
- // arguments; this code is a workaround for the problem.
- boolean changeType = false;
- for (Object o : args)
- {
- if (o instanceof Formattable)
- {
- changeType = true;
- break;
- }
- }
- if (changeType)
- {
- Object[] newArgs = new Object[args.length];
- for (int i = 0; i < args.length; i++)
- {
- if (args[i] instanceof Formattable)
- {
- newArgs[i] = args[i].toString();
- }
- else
- {
- newArgs[i] = args[i];
- }
- }
- s = new Formatter(locale).format(locale, fmt, newArgs)
- .toString();
- }
- else
- {
- s = new Formatter(locale).format(locale, fmt, args)
- .toString();
- }
- }
- else
- {
- s = new Formatter(locale).format(locale, fmt, args)
- .toString();
- }
- }
- catch (IllegalFormatException e)
- {
- // This should not happend with any of our internal messages.
- // However, this may happen for raw messages that have a
- // mismatch between argument specifier type and argument type.
- s = fmt;
- }
- }
- else
- {
- s = fmt;
- }
- if (s == null) s = "";
- return s;
- }
-
-
-
- /**
- * Gets the descriptor that holds descriptive information about this
- * message.
- *
- * @return MessageDescriptor information
- */
- public MessageDescriptor getDescriptor()
- {
- return this.descriptor;
- }
-
-
-
- /**
- * Returns the length of this message as rendered using the default
- * locale.
- *
- * @return the number of <code>char</code>s in this message
- */
- public int length()
- {
- return length(Locale.getDefault());
- }
-
-
-
- /**
- * Returns the byte representation of this messages in the default
- * locale.
- *
- * @return bytes for this message
- */
- public byte[] getBytes()
- {
- return toString().getBytes();
- }
-
-
-
- /**
- * Returns the <code>char</code> value at the specified index of this
- * message rendered using the default locale.
- *
- * @param index
- * the index of the <code>char</code> value to be returned
- * @return the specified <code>char</code> value
- * @throws IndexOutOfBoundsException
- * if the <tt>index</tt> argument is negative or not less
- * than <tt>length()</tt>
- */
- public char charAt(int index) throws IndexOutOfBoundsException
- {
- return charAt(Locale.getDefault(), index);
- }
-
-
-
- /**
- * Returns a new <code>CharSequence</code> that is a subsequence of
- * this message rendered using the default locale. The subsequence
- * starts with the <code>char</code> value at the specified index and
- * ends with the <code>char</code> value at index <tt>end - 1</tt>.
- * The length (in <code>char</code>s) of the returned sequence is
- * <tt>end - start</tt>, so if <tt>start == end</tt> then an empty
- * sequence is returned.
- *
- * @param start
- * the start index, inclusive
- * @param end
- * the end index, exclusive
- * @return the specified subsequence
- * @throws IndexOutOfBoundsException
- * if <tt>start</tt> or <tt>end</tt> are negative, if
- * <tt>end</tt> is greater than <tt>length()</tt>, or if
- * <tt>start</tt> is greater than <tt>end</tt>
- */
- public CharSequence subSequence(int start, int end)
- throws IndexOutOfBoundsException
- {
- return subSequence(Locale.getDefault(), start, end);
- }
-
-
-
- /**
- * Returns the length of this message as rendered using a specific
- * locale.
- *
- * @param locale
- * for which the rendering of this message will be used in
- * determining the length
- * @return the number of <code>char</code>s in this message
- */
- public int length(Locale locale)
- {
- return toString(locale).length();
- }
-
-
-
- /**
- * Returns the <code>char</code> value at the specified index of this
- * message rendered using a specific.
- *
- * @param locale
- * for which the rendering of this message will be used in
- * determining the character
- * @param index
- * the index of the <code>char</code> value to be returned
- * @return the specified <code>char</code> value
- * @throws IndexOutOfBoundsException
- * if the <tt>index</tt> argument is negative or not less
- * than <tt>length()</tt>
- */
- public char charAt(Locale locale, int index)
- throws IndexOutOfBoundsException
- {
- return toString(locale).charAt(index);
- }
-
-
-
- /**
- * Returns a new <code>CharSequence</code> that is a subsequence of
- * this message rendered using a specific locale. The subsequence
- * starts with the <code>char</code> value at the specified index and
- * ends with the <code>char</code> value at index <tt>end - 1</tt>.
- * The length (in <code>char</code>s) of the returned sequence is
- * <tt>end - start</tt>, so if <tt>start == end</tt> then an empty
- * sequence is returned.
- *
- * @param locale
- * for which the rendering of this message will be used in
- * determining the character
- * @param start
- * the start index, inclusive
- * @param end
- * the end index, exclusive
- * @return the specified subsequence
- * @throws IndexOutOfBoundsException
- * if <tt>start</tt> or <tt>end</tt> are negative, if
- * <tt>end</tt> is greater than <tt>length()</tt>, or if
- * <tt>start</tt> is greater than <tt>end</tt>
- */
- public CharSequence subSequence(Locale locale, int start, int end)
- throws IndexOutOfBoundsException
- {
- return toString(locale).subSequence(start, end);
- }
-
-
-
- /**
- * Formats the object using the provided {@link Formatter formatter}.
- *
- * @param formatter
- * The {@link Formatter formatter}.
- * @param flags
- * The flags modify the output format. The value is
- * interpreted as a bitmask. Any combination of the following
- * flags may be set:
- * {@link java.util.FormattableFlags#LEFT_JUSTIFY},
- * {@link java.util.FormattableFlags#UPPERCASE}, and
- * {@link java.util.FormattableFlags#ALTERNATE}. If no flags
- * are set, the default formatting of the implementing class
- * will apply.
- * @param width
- * The minimum number of characters to be written to the
- * output. If the length of the converted value is less than
- * the <tt>width</tt> then the output will be padded by <tt>' '</tt>
- * until the total number of characters equals width. The
- * padding is at the beginning by default. If the
- * {@link java.util.FormattableFlags#LEFT_JUSTIFY} flag is
- * set then the padding will be at the end. If <tt>width</tt>
- * is <tt>-1</tt> then there is no minimum.
- * @param precision
- * The maximum number of characters to be written to the
- * output. The precision is applied before the width, thus
- * the output will be truncated to <tt>precision</tt>
- * characters even if the <tt>width</tt> is greater than the
- * <tt>precision</tt>. If <tt>precision</tt> is <tt>-1</tt>
- * then there is no explicit limit on the number of
- * characters.
- * @throws IllegalFormatException
- * If any of the parameters are invalid. For specification
- * of all possible formatting errors, see the <a
- * href="../util/Formatter.html#detail">Details</a> section
- * of the formatter class specification.
- */
- public void formatTo(Formatter formatter, int flags, int width,
- int precision) throws IllegalFormatException
- {
- // Ignores flags, width and precission for now.
- // see javadoc for Formattable
- Locale l = formatter.locale();
- formatter.format(l, descriptor.getFormatString(l), args);
- }
-
-
-
- /**
- * Creates a parameterized instance. See the class header for
- * instructions on how to create messages outside this package.
- *
- * @param descriptor
- * for this message
- * @param args
- * arguments for replacing specifiers in the message's format
- * string
- */
- Message(MessageDescriptor descriptor, Object... args)
- {
- this.descriptor = descriptor;
- this.args = args;
- }
-
-
-
- /**
- * Compares this object with the specified object for order. Returns a
- * negative integer, zero, or a positive integer as this object is
- * less than, equal to, or greater than the specified object.
- *
- * @param o
- * the object to be compared.
- * @return a negative integer, zero, or a positive integer as this
- * object is less than, equal to, or greater than the
- * specified object.
- */
- public int compareTo(Message o)
- {
- return toString().compareTo(o.toString());
- }
-
-
-
- /**
- * Indicates whether some other message is "equal to" this one.
- * Messages are considered equal if their string representation in the
- * default locale are equal.
- *
- * @param o
- * the reference object with which to compare.
- * @return <code>true</code> if this object is the same as the obj
- * argument; <code>false</code> otherwise.
- * @see #hashCode()
- * @see java.util.Hashtable
- */
- public boolean equals(Object o)
- {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- Message message = (Message) o;
-
- return toString().equals(message.toString());
- }
-
-
-
- /**
- * Returns a hash code value for the object.
- *
- * @return a hash code value for this object.
- * @see java.lang.Object#equals(java.lang.Object)
- * @see java.util.Hashtable
- */
- public int hashCode()
- {
- int result;
- result = 31 * toString().hashCode();
- return result;
- }
-
-
-
- // TODO: remove this code once the JDK issue referenced in 3077 is
- // closed.
- /**
- * Returns whether we are running post 1.5 on AIX or not.
- *
- * @return <CODE>true</CODE> if we are running post 1.5 on AIX and
- * <CODE>false</CODE> otherwise.
- */
- private boolean isAIXPost5()
- {
- boolean isJDK15 = false;
- try
- {
- String javaRelease = System.getProperty("java.version");
- isJDK15 = javaRelease.startsWith("1.5");
- }
- catch (Throwable t)
- {
- System.err.println("Cannot get the java version: " + t);
- }
- boolean isAIX = "aix".equalsIgnoreCase(System
- .getProperty("os.name"));
- return !isJDK15 && isAIX;
- }
-
-}
diff --git a/sdk/src/com/sun/opends/sdk/util/MessageBuilder.java b/sdk/src/com/sun/opends/sdk/util/MessageBuilder.java
deleted file mode 100755
index 7c9d4ba..0000000
--- a/sdk/src/com/sun/opends/sdk/util/MessageBuilder.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE
- * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at
- * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
- * add the following below this CDDL HEADER, with the fields enclosed
- * by brackets "[]" replaced with your own identifying information:
- * Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- *
- * Copyright 2007-2009 Sun Microsystems, Inc.
- */
-
-package com.sun.opends.sdk.util;
-
-
-
-import java.io.Serializable;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-
-
-
-;
-
-/**
- * A builder used specifically for messages. As messages are appended
- * they are translated to their string representation for storage using
- * the locale specified in the constructor. Note that before you use
- * this class you should consider whether it is appropriate. In general
- * composing messages by appending message to each other may not produce
- * a message that is formatted appropriately for all locales. It is
- * usually better to create messages by composition. In other words you
- * should create a base message that contains one or more string
- * argument specifiers (%s) and define other message objects to use as
- * replacement variables. In this way language translators have a change
- * to reformat the message for a particular locale if necessary.
- */
-public final class MessageBuilder implements Appendable, CharSequence,
- Serializable
-{
-
- private static final long serialVersionUID = -3292823563904285315L;
-
- /** Used internally to store appended messages. */
- private final StringBuilder sb = new StringBuilder();
-
- /** Used internally to store appended messages. */
- private final List<Message> messages = new LinkedList<Message>();
-
- /** Used to render the string representation of appended messages. */
- private final Locale locale;
-
-
-
- /**
- * Constructs an instance that will build messages in the default
- * locale.
- */
- public MessageBuilder()
- {
- this(Locale.getDefault());
- }
-
-
-
- /**
- * Constructs an instance that will build messages in the default
- * locale having an initial message.
- *
- * @param message
- * initial message
- */
- public MessageBuilder(Message message)
- {
- this(Locale.getDefault());
- append(message);
- }
-
-
-
- /**
- * Constructs an instance that will build messages in the default
- * locale having an initial message.
- *
- * @param message
- * initial message
- */
- public MessageBuilder(String message)
- {
- this(Locale.getDefault());
- append(message);
- }
-
-
-
- /**
- * Constructs an instance from another <code>MessageBuilder</code>.
- *
- * @param mb
- * from which to construct a new message builder
- */
- public MessageBuilder(MessageBuilder mb)
- {
- for (Message msg : mb.messages)
- {
- this.messages.add(msg);
- }
- this.sb.append(sb);
- this.locale = mb.locale;
- }
-
-
-
- /**
- * Constructs an instance that will build messages in a specified
- * locale.
- *
- * @param locale
- * used for translating appended messages
- */
- public MessageBuilder(Locale locale)
- {
- this.locale = locale;
- }
-
-
-
- /**
- * Append a message to this builder. The string representation of the
- * locale specifed in the constructor will be stored in this builder.
- *
- * @param message
- * to be appended
- * @return reference to this builder
- */
- public MessageBuilder append(Message message)
- {
- if (message != null)
- {
- sb.append(message.toString(locale));
- messages.add(message);
- }
- return this;
- }
-
-
-
- /**
- * Append an integer to this builder.
- *
- * @param number
- * to append
- * @return reference to this builder
- */
- public MessageBuilder append(int number)
- {
- append(String.valueOf(number));
- return this;
- }
-
-
-
- /**
- * Append an object to this builder.
- *
- * @param object
- * to append
- * @return reference to this builder
- */
- public MessageBuilder append(Object object)
- {
- if (object != null)
- {
- append(String.valueOf(object));
- }
- return this;
- }
-
-
-
- /**
- * Append a string to this builder.
- *
- * @param cs
- * to append
- * @return reference to this builder
- */
- public MessageBuilder append(CharSequence cs)
- {
- if (cs != null)
- {
- sb.append(cs);
- if (cs instanceof Message)
- {
- messages.add((Message) cs);
- }
- else
- {
- messages.add(Message.raw(cs));
- }
- }
- return this;
- }
-
-
-
- /**
- * Appends a subsequence of the specified character sequence to this
- * <tt>Appendable</tt>.
- * <p>
- * An invocation of this method of the form <tt>out.append(csq, start,
- * end)</tt> when <tt>csq</tt> is not <tt>null</tt>, behaves in
- * exactly the same way as the invocation
- *
- * <pre>
- * out.append(csq.subSequence(start, end))
- * </pre>
- *
- * @param csq
- * The character sequence from which a subsequence will be
- * appended. If <tt>csq</tt> is <tt>null</tt>, then
- * characters will be appended as if <tt>csq</tt> contained
- * the four characters <tt>"null"</tt>.
- * @param start
- * The index of the first character in the subsequence
- * @param end
- * The index of the character following the last character in
- * the subsequence
- * @return A reference to this <tt>Appendable</tt>
- * @throws IndexOutOfBoundsException
- * If <tt>start</tt> or <tt>end</tt> are negative,
- * <tt>start</tt> is greater than <tt>end</tt>, or
- * <tt>end</tt> is greater than <tt>csq.length()</tt>
- */
- public MessageBuilder append(CharSequence csq, int start, int end)
- throws IndexOutOfBoundsException
- {
- return append(csq.subSequence(start, end));
- }
-
-
-
- /**
- * Appends the specified character to this <tt>Appendable</tt>.
- *
- * @param c
- * The character to append
- * @return A reference to this <tt>Appendable</tt>
- */
- public MessageBuilder append(char c)
- {
- return append(String.valueOf(c));
- }
-
-
-
- /**
- * Returns a string containing the characters in this sequence in the
- * same order as this sequence. The length of the string will be the
- * length of this sequence.
- *
- * @return a string consisting of exactly this sequence of characters
- */
- public String toString()
- {
- return sb.toString();
- }
-
-
-
- /**
- * Returns a string representation of the appended content in the
- * specific locale. Only <code>Message</code>s appended to this
- * builder are rendered in the requested locale. Raw strings appended
- * to this buffer are not translated to different locale.
- *
- * @param locale
- * requested
- * @return String representation
- */
- public String toString(Locale locale)
- {
- StringBuilder sb = new StringBuilder();
- for (Message m : messages)
- {
- sb.append(m.toString(locale));
- }
- return sb.toString();
- }
-
-
-
- /**
- * Returns a raw message representation of the appended content.
- *
- * @return Message raw message representing builder content
- */
- public Message toMessage()
- {
- if (messages.isEmpty())
- {
- return Message.EMPTY;
- }
-
- StringBuffer fmtString = new StringBuffer();
- for (int i = 0; i < messages.size(); i++)
- {
- fmtString.append("%s");
- }
-
- return Message.raw(fmtString, messages.toArray());
- }
-
-
-
- /**
- * Returns the length of the string representation of this builder
- * using the default locale.
- *
- * @return the number of <code>char</code>s in this message
- */
- public int length()
- {
- return length(Locale.getDefault());
- }
-
-
-
- /**
- * Returns the <code>char</code> value at the specified index of the
- * string representation of this builder using the default locale.
- *
- * @param index
- * the index of the <code>char</code> value to be returned
- * @return the specified <code>char</code> value
- * @throws IndexOutOfBoundsException
- * if the <tt>index</tt> argument is negative or not less
- * than <tt>length()</tt>
- */
- public char charAt(int index) throws IndexOutOfBoundsException
- {
- return charAt(Locale.getDefault(), index);
- }
-
-
-
- /**
- * Returns a new <code>CharSequence</code> that is a subsequence of
- * the string representation of this builder using the default locale.
- * The subsequence starts with the <code>char</code> value at the
- * specified index and ends with the <code>char</code> value at index
- * <tt>end - 1</tt>. The length (in <code>char</code>s) of the
- * returned sequence is <tt>end - start</tt>, so if
- * <tt>start == end</tt> then an empty sequence is returned.
- *
- * @param start
- * the start index, inclusive
- * @param end
- * the end index, exclusive
- * @return the specified subsequence
- * @throws IndexOutOfBoundsException
- * if <tt>start</tt> or <tt>end</tt> are negative, if
- * <tt>end</tt> is greater than <tt>length()</tt>, or if
- * <tt>start</tt> is greater than <tt>end</tt>
- */
- public CharSequence subSequence(int start, int end)
- throws IndexOutOfBoundsException
- {
- return subSequence(Locale.getDefault(), start, end);
- }
-
-
-
- /**
- * Returns the length of the string representation of this builder
- * using a specific locale.
- *
- * @param locale
- * for which the rendering of this message will be used in
- * determining the length
- * @return the number of <code>char</code>s in this message
- */
- public int length(Locale locale)
- {
- return toString(locale).length();
- }
-
-
-
- /**
- * Returns the <code>char</code> value at the specified index of the
- * string representation of this builder using a specific locale.
- *
- * @param locale
- * for which the rendering of this message will be used in
- * determining the character
- * @param index
- * the index of the <code>char</code> value to be returned
- * @return the specified <code>char</code> value
- * @throws IndexOutOfBoundsException
- * if the <tt>index</tt> argument is negative or not less
- * than <tt>length()</tt>
- */
- public char charAt(Locale locale, int index)
- throws IndexOutOfBoundsException
- {
- return toString(locale).charAt(index);
- }
-
-
-
- /**
- * Returns a new <code>CharSequence</code> that is a subsequence of
- * the string representation of this builder using a specific locale.
- * The subsequence starts with the <code>char</code> value at the
- * specified index and ends with the <code>char</code> value at index
- * <tt>end - 1</tt>. The length (in <code>char</code>s) of the
- * returned sequence is <tt>end - start</tt>, so if
- * <tt>start == end</tt> then an empty sequence is returned.
- *
- * @param locale
- * for which the rendering of this message will be used in
- * determining the character
- * @param start
- * the start index, inclusive
- * @param end
- * the end index, exclusive
- * @return the specified subsequence
- * @throws IndexOutOfBoundsException
- * if <tt>start</tt> or <tt>end</tt> are negative, if
- * <tt>end</tt> is greater than <tt>length()</tt>, or if
- * <tt>start</tt> is greater than <tt>end</tt>
- */
- public CharSequence subSequence(Locale locale, int start, int end)
- throws IndexOutOfBoundsException
- {
- return toString(locale).subSequence(start, end);
- }
-
-}
diff --git a/sdk/src/com/sun/opends/sdk/util/Platform.java b/sdk/src/com/sun/opends/sdk/util/Platform.java
index f3954bc..53bed41 100644
--- a/sdk/src/com/sun/opends/sdk/util/Platform.java
+++ b/sdk/src/com/sun/opends/sdk/util/Platform.java
@@ -38,6 +38,8 @@
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
+import org.opends.sdk.LocalizableMessage;
+
/**
* Provides a wrapper class that collects all of the JVM vendor
@@ -146,13 +148,13 @@
X500SignerCons =
X500SignerClass.getConstructor(Signature.class, X500NameClass);
} catch (ClassNotFoundException e) {
- Message msg = ERR_CERTMGR_CLASS_NOT_FOUND.get(e.getMessage());
+ LocalizableMessage msg = ERR_CERTMGR_CLASS_NOT_FOUND.get(e.getMessage());
throw new ExceptionInInitializerError(msg.toString());
} catch (SecurityException e) {
- Message msg = ERR_CERTMGR_SECURITY.get(e.getMessage());
+ LocalizableMessage msg = ERR_CERTMGR_SECURITY.get(e.getMessage());
throw new ExceptionInInitializerError(msg.toString());
} catch (NoSuchMethodException e) {
- Message msg = ERR_CERTMGR_NO_METHOD.get(e.getMessage());
+ LocalizableMessage msg = ERR_CERTMGR_NO_METHOD.get(e.getMessage());
throw new ExceptionInInitializerError(msg.toString());
}
}
@@ -181,7 +183,7 @@
String alias, char[] pwd, String dn) throws KeyStoreException {
if(!certReqAllowed) {
String vendor = System.getProperty("java.vendor");
- Message msg =
+ LocalizableMessage msg =
ERR_CERTMGR_CERT_SIGN_REQ_NOT_SUPPORTED.get(vendor);
throw new KeyStoreException(msg.toString());
}
@@ -194,17 +196,17 @@
PrintStream printStream =
new PrintStream(new FileOutputStream(csrFile.getAbsolutePath()));
if(keyStore == null) {
- Message msg = ERR_CERTMGR_KEYSTORE_NONEXISTANT.get();
+ LocalizableMessage msg = ERR_CERTMGR_KEYSTORE_NONEXISTANT.get();
throw new KeyStoreException(msg.toString());
}
PrivateKey privateKey = getPrivateKey(keyStore, alias, pwd);
if(privateKey == null) {
- Message msg = ERR_CERTMGR_PRIVATE_KEY.get(alias);
+ LocalizableMessage msg = ERR_CERTMGR_PRIVATE_KEY.get(alias);
throw new KeyStoreException(msg.toString());
}
Certificate cert = keyStore.getCertificate(alias);
if(cert == null) {
- Message msg = ERR_CERTMGR_ALIAS_NO_CERTIFICATE.get(alias);
+ LocalizableMessage msg = ERR_CERTMGR_ALIAS_NO_CERTIFICATE.get(alias);
throw new KeyStoreException(msg.toString());
}
Signature signature = Signature.getInstance(SIG_ALGORITHM);
@@ -221,7 +223,7 @@
print.invoke(request, printStream);
printStream.close();
} catch (Exception e) {
- Message msg = ERR_CERTMGR_CERT_REQUEST.get(alias,e.getMessage());
+ LocalizableMessage msg = ERR_CERTMGR_CERT_REQUEST.get(alias,e.getMessage());
throw new KeyStoreException(msg.toString());
}
return csrFile;
@@ -241,7 +243,7 @@
String alias, char[] pwd) throws KeyStoreException {
try {
if(ks == null) {
- Message msg = ERR_CERTMGR_KEYSTORE_NONEXISTANT.get();
+ LocalizableMessage msg = ERR_CERTMGR_KEYSTORE_NONEXISTANT.get();
throw new KeyStoreException(msg.toString());
}
ks.deleteEntry(alias);
@@ -249,7 +251,7 @@
ks.store(fs, pwd);
fs.close();
} catch (Exception e) {
- Message msg =
+ LocalizableMessage msg =
ERR_CERTMGR_DELETE_ALIAS.get(alias,e.getMessage());
throw new KeyStoreException(msg.toString());
}
@@ -282,14 +284,14 @@
}
//Do not support certificate replies.
if (ks.entryInstanceOf(alias ,KeyStore.PrivateKeyEntry.class)) {
- Message msg = ERR_CERTMGR_CERT_REPLIES_INVALID.get(alias);
+ LocalizableMessage msg = ERR_CERTMGR_CERT_REPLIES_INVALID.get(alias);
throw new KeyStoreException(msg.toString());
} else if(!ks.containsAlias(alias) ||
ks.entryInstanceOf(alias,
KeyStore.TrustedCertificateEntry.class))
trustedCert(alias, cf, ks, inStream);
else {
- Message msg = ERR_CERTMGR_ALIAS_INVALID.get(alias);
+ LocalizableMessage msg = ERR_CERTMGR_ALIAS_INVALID.get(alias);
throw new KeyStoreException(msg.toString());
}
FileOutputStream fileOutStream = new FileOutputStream(ksPath);
@@ -297,7 +299,7 @@
fileOutStream.close();
inStream.close();
} catch (Exception e) {
- Message msg =
+ LocalizableMessage msg =
ERR_CERTMGR_ADD_CERT.get(alias, e.getMessage());
throw new KeyStoreException(msg.toString());
}
@@ -330,7 +332,7 @@
ks = KeyStore.getInstance(ksType);
ks.load(null, pwd);
} else if(ks.containsAlias(alias)) {
- Message msg = ERR_CERTMGR_ALIAS_ALREADY_EXISTS.get(alias);
+ LocalizableMessage msg = ERR_CERTMGR_ALIAS_ALREADY_EXISTS.get(alias);
throw new KeyStoreException(msg.toString());
}
Object keypair =
@@ -355,7 +357,7 @@
ks.store(fileOutStream, pwd);
fileOutStream.close();
} catch (Exception e) {
- Message msg =
+ LocalizableMessage msg =
ERR_CERTMGR_GEN_SELF_SIGNED_CERT.get(alias, e.getMessage());
throw new KeyStoreException(msg.toString());
}
@@ -378,7 +380,7 @@
KeyStore ks, InputStream in) throws KeyStoreException {
try {
if (ks.containsAlias(alias) == true) {
- Message msg = ERR_CERTMGR_ALIAS_ALREADY_EXISTS.get(alias);
+ LocalizableMessage msg = ERR_CERTMGR_ALIAS_ALREADY_EXISTS.get(alias);
throw new KeyStoreException(msg.toString());
}
X509Certificate cert = (X509Certificate) cf.generateCertificate(in);
@@ -386,7 +388,7 @@
cert.verify(cert.getPublicKey());
ks.setCertificateEntry(alias, cert);
} catch (Exception e) {
- Message msg =
+ LocalizableMessage msg =
ERR_CERTMGR_TRUSTED_CERT.get(alias,e.getMessage());
throw new KeyStoreException(msg.toString());
}
@@ -419,18 +421,18 @@
PrivateKey key = null;
try {
if(!ks.containsAlias(alias)) {
- Message msg = ERR_CERTMGR_ALIAS_DOES_NOT_EXIST.get(alias);
+ LocalizableMessage msg = ERR_CERTMGR_ALIAS_DOES_NOT_EXIST.get(alias);
throw new KeyStoreException(msg.toString());
}
if(!ks.entryInstanceOf(alias, KeyStore.PrivateKeyEntry.class) &&
!ks.entryInstanceOf(alias, KeyStore.SecretKeyEntry.class)) {
- Message msg =
+ LocalizableMessage msg =
ERR_CERTMGR_ALIAS_INVALID_ENTRY_TYPE.get(alias);
throw new KeyStoreException(msg.toString());
}
key = (PrivateKey)ks.getKey(alias, pwd);
} catch (Exception e) {
- Message msg =
+ LocalizableMessage msg =
ERR_CERTMGR_GET_KEY.get(alias,e.getMessage());
throw new KeyStoreException(msg.toString());
}
diff --git a/sdk/src/com/sun/opends/sdk/util/StaticUtils.java b/sdk/src/com/sun/opends/sdk/util/StaticUtils.java
index eff368a..8cdd478 100644
--- a/sdk/src/com/sun/opends/sdk/util/StaticUtils.java
+++ b/sdk/src/com/sun/opends/sdk/util/StaticUtils.java
@@ -40,10 +40,7 @@
import java.util.zip.Deflater;
import java.util.zip.Inflater;
-import org.opends.sdk.ByteSequence;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.ByteStringBuilder;
-import org.opends.sdk.DecodeException;
+import org.opends.sdk.*;
@@ -1001,7 +998,7 @@
* @return The human-readable message generated for the provided
* exception.
*/
- public static Message getExceptionMessage(Throwable t)
+ public static LocalizableMessage getExceptionMessage(Throwable t)
{
if (t instanceof LocalizableException)
{
@@ -1012,7 +1009,7 @@
{
final StackTraceElement[] stackElements = t.getStackTrace();
- final MessageBuilder message = new MessageBuilder();
+ final LocalizableMessageBuilder message = new LocalizableMessageBuilder();
message.append("NullPointerException(");
message.append(stackElements[0].getFileName());
message.append(":");
@@ -1067,7 +1064,7 @@
message.append(")");
- return Message.raw(message.toString());
+ return LocalizableMessage.raw(message.toString());
}
}
@@ -1095,7 +1092,7 @@
if (length % 2 == 1)
{
- final Message message = ERR_HEX_DECODE_INVALID_LENGTH
+ final LocalizableMessage message = ERR_HEX_DECODE_INVALID_LENGTH
.get(hexString);
throw new ParseException(message.toString(), 0);
}
@@ -1186,7 +1183,7 @@
b = (byte) 0xF0;
break;
default:
- final Message message = ERR_HEX_DECODE_INVALID_CHARACTER.get(
+ final LocalizableMessage message = ERR_HEX_DECODE_INVALID_CHARACTER.get(
new String(new char[] { c1, c2 }), c1);
throw new ParseException(message.toString(), 0);
}
@@ -1248,7 +1245,7 @@
b |= 0x0F;
break;
default:
- final Message message = ERR_HEX_DECODE_INVALID_CHARACTER.get(
+ final LocalizableMessage message = ERR_HEX_DECODE_INVALID_CHARACTER.get(
new String(new char[] { c1, c2 }), c1);
throw new ParseException(message.toString(), 0);
}
@@ -1837,7 +1834,7 @@
}
}
}
- final Message message = ERR_INVALID_ESCAPE_CHAR.get(reader
+ final LocalizableMessage message = ERR_INVALID_ESCAPE_CHAR.get(reader
.getString(), c1);
throw DecodeException.error(message);
}
@@ -1846,7 +1843,7 @@
// comprise the escaped value.
if (reader.remaining() == 0)
{
- final Message message = ERR_HEX_DECODE_INVALID_LENGTH.get(reader
+ final LocalizableMessage message = ERR_HEX_DECODE_INVALID_LENGTH.get(reader
.getString());
throw DecodeException.error(message);
@@ -1910,7 +1907,7 @@
b |= 0x0F;
break;
default:
- final Message message = ERR_HEX_DECODE_INVALID_CHARACTER.get(
+ final LocalizableMessage message = ERR_HEX_DECODE_INVALID_CHARACTER.get(
new String(new char[] { c1, c2 }), c1);
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/AbstractConnection.java b/sdk/src/org/opends/sdk/AbstractConnection.java
index 01ee2a4..f13dc9f 100644
--- a/sdk/src/org/opends/sdk/AbstractConnection.java
+++ b/sdk/src/org/opends/sdk/AbstractConnection.java
@@ -39,7 +39,6 @@
import org.opends.sdk.requests.SearchRequest;
import org.opends.sdk.responses.*;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/AttributeDescription.java b/sdk/src/org/opends/sdk/AttributeDescription.java
index af75c39..d02fe25 100644
--- a/sdk/src/org/opends/sdk/AttributeDescription.java
+++ b/sdk/src/org/opends/sdk/AttributeDescription.java
@@ -905,7 +905,7 @@
c = attributeDescription.charAt(i);
if (c != ' ')
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_INTERNAL_WHITESPACE
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_INTERNAL_WHITESPACE
.get(attributeDescription);
throw new LocalizedIllegalArgumentException(message);
}
@@ -940,7 +940,7 @@
// contained whitespace.
if (i == length)
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_EMPTY
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_EMPTY
.get(attributeDescription);
throw new LocalizedIllegalArgumentException(message);
}
@@ -949,7 +949,7 @@
ASCIICharProp cp = ASCIICharProp.valueOf(c);
if (cp == null)
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
.get(attributeDescription, c, i);
throw new LocalizedIllegalArgumentException(message);
}
@@ -972,7 +972,7 @@
cp = ASCIICharProp.valueOf(c);
if (!cp.isKeyChar())
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
.get(attributeDescription, c, i);
throw new LocalizedIllegalArgumentException(message);
}
@@ -996,7 +996,7 @@
cp = ASCIICharProp.valueOf(c);
if (c != '.' && !cp.isDigit())
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
.get(attributeDescription, c, i);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1007,7 +1007,7 @@
}
else
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
.get(attributeDescription, c, i);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1034,7 +1034,7 @@
if (oid.length() == 0)
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_NO_TYPE
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_NO_TYPE
.get(attributeDescription);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1047,7 +1047,7 @@
}
catch (final UnknownSchemaElementException e)
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_TYPE_NOT_FOUND
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_TYPE_NOT_FOUND
.get(attributeDescription, e.getMessageObject());
throw new LocalizedIllegalArgumentException(message);
}
@@ -1085,7 +1085,7 @@
cp = ASCIICharProp.valueOf(c);
if (!cp.isKeyChar())
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
.get(attributeDescription, c, i);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1120,7 +1120,7 @@
if (option.length() == 0)
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_EMPTY_OPTION
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_EMPTY_OPTION
.get(attributeDescription);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1164,7 +1164,7 @@
cp = ASCIICharProp.valueOf(c);
if (!cp.isKeyChar())
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_ILLEGAL_CHARACTER
.get(attributeDescription, c, i);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1198,7 +1198,7 @@
if (option.length() == 0)
{
- final Message message = ERR_ATTRIBUTE_DESCRIPTION_EMPTY_OPTION
+ final LocalizableMessage message = ERR_ATTRIBUTE_DESCRIPTION_EMPTY_OPTION
.get(attributeDescription);
throw new LocalizedIllegalArgumentException(message);
}
diff --git a/sdk/src/org/opends/sdk/Connection.java b/sdk/src/org/opends/sdk/Connection.java
index d4caacc..14796ea 100644
--- a/sdk/src/org/opends/sdk/Connection.java
+++ b/sdk/src/org/opends/sdk/Connection.java
@@ -36,7 +36,6 @@
import org.opends.sdk.requests.*;
import org.opends.sdk.responses.*;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/DN.java b/sdk/src/org/opends/sdk/DN.java
index 86e5679..5363f28 100644
--- a/sdk/src/org/opends/sdk/DN.java
+++ b/sdk/src/org/opends/sdk/DN.java
@@ -36,8 +36,6 @@
import org.opends.sdk.schema.Schema;
import org.opends.sdk.schema.UnknownSchemaElementException;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.SubstringReader;
import com.sun.opends.sdk.util.Validator;
@@ -176,7 +174,7 @@
}
catch (final UnknownSchemaElementException e)
{
- final Message message = ERR_DN_TYPE_NOT_FOUND.get(reader
+ final LocalizableMessage message = ERR_DN_TYPE_NOT_FOUND.get(reader
.getString(), e.getMessageObject());
throw new LocalizedIllegalArgumentException(message);
}
diff --git a/sdk/src/org/opends/sdk/DecodeException.java b/sdk/src/org/opends/sdk/DecodeException.java
index 10e229e..c3c3384 100644
--- a/sdk/src/org/opends/sdk/DecodeException.java
+++ b/sdk/src/org/opends/sdk/DecodeException.java
@@ -31,8 +31,6 @@
import java.io.IOException;
-import com.sun.opends.sdk.util.LocalizableException;
-import com.sun.opends.sdk.util.Message;
@@ -46,7 +44,7 @@
public final class DecodeException extends IOException implements
LocalizableException
{
- private final Message message;
+ private final LocalizableMessage message;
private final boolean isFatal;
@@ -60,7 +58,7 @@
* The message that explains the problem that occurred.
* @return The new fatal decode exception.
*/
- public static DecodeException fatalError(Message message)
+ public static DecodeException fatalError(LocalizableMessage message)
{
return new DecodeException(message, true, null);
}
@@ -77,7 +75,7 @@
* The underlying cause of this exception.
* @return The new fatal decode exception.
*/
- public static DecodeException fatalError(Message message,
+ public static DecodeException fatalError(LocalizableMessage message,
Throwable cause)
{
return new DecodeException(message, true, cause);
@@ -92,7 +90,7 @@
* The message that explains the problem that occurred.
* @return The new non-fatal decode exception.
*/
- public static DecodeException error(Message message)
+ public static DecodeException error(LocalizableMessage message)
{
return new DecodeException(message, false, null);
}
@@ -109,7 +107,7 @@
* The underlying cause of this exception.
* @return The new non-fatal decode exception.
*/
- public static DecodeException error(Message message, Throwable cause)
+ public static DecodeException error(LocalizableMessage message, Throwable cause)
{
return new DecodeException(message, false, cause);
}
@@ -117,7 +115,7 @@
// Construction is provided via factory methods.
- private DecodeException(Message message, boolean isFatal,
+ private DecodeException(LocalizableMessage message, boolean isFatal,
Throwable cause)
{
super(message.toString(), cause);
@@ -130,9 +128,9 @@
/**
* Returns the message that explains the problem that occurred.
*
- * @return Message of the problem
+ * @return LocalizableMessage of the problem
*/
- public Message getMessageObject()
+ public LocalizableMessage getMessageObject()
{
return message;
}
diff --git a/sdk/src/org/opends/sdk/Entry.java b/sdk/src/org/opends/sdk/Entry.java
index 1e5776c..38c1541 100644
--- a/sdk/src/org/opends/sdk/Entry.java
+++ b/sdk/src/org/opends/sdk/Entry.java
@@ -33,7 +33,6 @@
import org.opends.sdk.schema.ObjectClass;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/Filter.java b/sdk/src/org/opends/sdk/Filter.java
index 242a106..cc4c7fe 100644
--- a/sdk/src/org/opends/sdk/Filter.java
+++ b/sdk/src/org/opends/sdk/Filter.java
@@ -36,8 +36,6 @@
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -1110,7 +1108,7 @@
if ((string.length() > 1) && string.startsWith("'")
&& string.endsWith("'"))
{
- Message message = ERR_LDAP_FILTER_ENCLOSED_IN_APOSTROPHES
+ LocalizableMessage message = ERR_LDAP_FILTER_ENCLOSED_IN_APOSTROPHES
.get(string);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1123,7 +1121,7 @@
}
else
{
- Message message = ERR_LDAP_FILTER_MISMATCHED_PARENTHESES.get(
+ LocalizableMessage message = ERR_LDAP_FILTER_MISMATCHED_PARENTHESES.get(
string, 1, string.length());
throw new LocalizedIllegalArgumentException(message);
}
@@ -1144,7 +1142,7 @@
{
if (beginIndex >= endIndex)
{
- Message message = ERR_LDAP_FILTER_STRING_NULL.get();
+ LocalizableMessage message = ERR_LDAP_FILTER_STRING_NULL.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -1182,7 +1180,7 @@
if ((string.charAt(index + 1) != '(')
|| (string.charAt(endIndex - 1) != ')'))
{
- Message message = ERR_LDAP_FILTER_COMPOUND_MISSING_PARENTHESES
+ LocalizableMessage message = ERR_LDAP_FILTER_COMPOUND_MISSING_PARENTHESES
.get(string, index, endIndex - 1);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1273,7 +1271,7 @@
// the binary value.
if ((i + 2) >= valueBytes.length)
{
- Message message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
+ LocalizableMessage message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
string, startIndex + i + 1);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1335,7 +1333,7 @@
byteValue = (byte) 0xF0;
break;
default:
- Message message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
+ LocalizableMessage message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
string, startIndex + i + 1);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1396,7 +1394,7 @@
byteValue |= (byte) 0x0F;
break;
default:
- Message message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
+ LocalizableMessage message = ERR_LDAP_FILTER_INVALID_ESCAPED_BYTE.get(
string, startIndex + i + 1);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1521,7 +1519,7 @@
// can help make the switch statement more efficient. We'll fall
// through to the default clause to reject them.
default:
- Message message = ERR_LDAP_FILTER_INVALID_CHAR_IN_ATTR_TYPE
+ LocalizableMessage message = ERR_LDAP_FILTER_INVALID_CHAR_IN_ATTR_TYPE
.get(attrType, String.valueOf(attrType.charAt(i)), i);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1569,7 +1567,7 @@
int colonPos = string.indexOf(':', startIndex);
if (colonPos < 0)
{
- Message message = ERR_LDAP_FILTER_EXTENSIBLE_MATCH_NO_COLON
+ LocalizableMessage message = ERR_LDAP_FILTER_EXTENSIBLE_MATCH_NO_COLON
.get(string, startIndex);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1605,7 +1603,7 @@
// description and/or a matching rule ID.
if ((attributeDescription == null) && (matchingRule == null))
{
- Message message = ERR_LDAP_FILTER_EXTENSIBLE_MATCH_NO_AD_OR_MR
+ LocalizableMessage message = ERR_LDAP_FILTER_EXTENSIBLE_MATCH_NO_AD_OR_MR
.get(string, startIndex);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1636,7 +1634,7 @@
if ((string.charAt(startIndex) != '(')
|| (string.charAt(endIndex - 1) != ')'))
{
- Message message = ERR_LDAP_FILTER_COMPOUND_MISSING_PARENTHESES
+ LocalizableMessage message = ERR_LDAP_FILTER_COMPOUND_MISSING_PARENTHESES
.get(string, startIndex, endIndex);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1682,14 +1680,14 @@
}
else if (pendingOpens < 0)
{
- Message message = ERR_LDAP_FILTER_NO_CORRESPONDING_OPEN_PARENTHESIS
+ LocalizableMessage message = ERR_LDAP_FILTER_NO_CORRESPONDING_OPEN_PARENTHESIS
.get(string, i);
throw new LocalizedIllegalArgumentException(message);
}
}
else if (pendingOpens <= 0)
{
- Message message = ERR_LDAP_FILTER_COMPOUND_MISSING_PARENTHESES
+ LocalizableMessage message = ERR_LDAP_FILTER_COMPOUND_MISSING_PARENTHESES
.get(string, startIndex, endIndex);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1699,7 +1697,7 @@
// components. The list of open parenthesis positions must be empty.
if (pendingOpens != 0)
{
- Message message = ERR_LDAP_FILTER_NO_CORRESPONDING_CLOSE_PARENTHESIS
+ LocalizableMessage message = ERR_LDAP_FILTER_NO_CORRESPONDING_CLOSE_PARENTHESIS
.get(string, openIndex);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1769,7 +1767,7 @@
if (s == i)
{
// A zero length substring.
- Message message = ERR_LDAP_FILTER_BAD_SUBSTRING.get(
+ LocalizableMessage message = ERR_LDAP_FILTER_BAD_SUBSTRING.get(
string, string.subSequence(startIndex, endIndex));
throw new LocalizedIllegalArgumentException(message);
}
diff --git a/sdk/src/org/opends/sdk/LinkedAttribute.java b/sdk/src/org/opends/sdk/LinkedAttribute.java
index 7701aee..8198463 100644
--- a/sdk/src/org/opends/sdk/LinkedAttribute.java
+++ b/sdk/src/org/opends/sdk/LinkedAttribute.java
@@ -31,7 +31,6 @@
import java.util.*;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/com/sun/opends/sdk/util/LocalizableException.java b/sdk/src/org/opends/sdk/LocalizableException.java
similarity index 94%
rename from sdk/src/com/sun/opends/sdk/util/LocalizableException.java
rename to sdk/src/org/opends/sdk/LocalizableException.java
index cf63aa3..2ea8568 100644
--- a/sdk/src/com/sun/opends/sdk/util/LocalizableException.java
+++ b/sdk/src/org/opends/sdk/LocalizableException.java
@@ -24,7 +24,8 @@
*
* Copyright 2009 Sun Microsystems, Inc.
*/
-package com.sun.opends.sdk.util;
+package org.opends.sdk;
+
@@ -42,6 +43,6 @@
*
* @return The message that explains the problem that occurred.
*/
- Message getMessageObject();
+ LocalizableMessage getMessageObject();
}
diff --git a/sdk/src/org/opends/sdk/LocalizableMessage.java b/sdk/src/org/opends/sdk/LocalizableMessage.java
new file mode 100755
index 0000000..58fbf4b
--- /dev/null
+++ b/sdk/src/org/opends/sdk/LocalizableMessage.java
@@ -0,0 +1,541 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
+ * add the following below this CDDL HEADER, with the fields enclosed
+ * by brackets "[]" replaced with your own identifying information:
+ * Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ *
+ * Copyright 2009 Sun Microsystems, Inc.
+ */
+
+package org.opends.sdk;
+
+
+
+import java.util.Formattable;
+import java.util.Formatter;
+import java.util.IllegalFormatException;
+import java.util.Locale;
+
+import com.sun.opends.sdk.util.LocalizableMessageDescriptor;
+import com.sun.opends.sdk.util.Validator;
+
+
+
+/**
+ * A localizable message whose {@code String} representation can be
+ * retrieved in one or more locales. A message is localized each time it
+ * is converted to a {@code String} using one of its {@link #toString}
+ * methods.
+ * <p>
+ * Localizable messages are particularly useful in situations where a
+ * message a destined for multiple recipients, potentially in different
+ * locales. For example, a server application may record a message in
+ * its log file using its default locale, but also send the same message
+ * to the client using the client's locale (if known).
+ * <p>
+ * In most cases messages are intended for use in a locale-sensitive
+ * manner although this class defines convenience methods for creating
+ * uninternationalized messages whose {@code String} representation is
+ * always the same regardless of the requested locale.
+ * <p>
+ * This class implements {@code CharSequence} so that messages can be
+ * supplied as arguments to other messages. This way messages can be
+ * composed of fragments of other messages if necessary.
+ *
+ * @see LocalizableMessageBuilder
+ */
+public final class LocalizableMessage implements CharSequence, Formattable,
+ Comparable<LocalizableMessage>
+{
+ static
+ {
+ LocalizableMessageDescriptor.MESSAGE_FACTORY = new LocalizableMessageDescriptor.MessageFactory()
+ {
+
+ public LocalizableMessage newMessage(LocalizableMessageDescriptor descriptor,
+ Object... args)
+ {
+ return new LocalizableMessage(descriptor, args);
+ }
+ };
+ }
+
+ /**
+ * Represents an empty message string.
+ */
+ public static final LocalizableMessage EMPTY = LocalizableMessage.raw("");
+
+ // Variable used to workaround a bug in AIX Java 1.6
+ // TODO: remove this code once the JDK issue referenced in 3077 is
+ // closed.
+ private static final boolean IS_AIX_POST5 = isAIXPost5();
+
+
+
+ /**
+ * Creates an uninternationalized message whose {@code String}
+ * representation is always the same regardless of the requested
+ * locale.
+ * <p>
+ * Note that the types for {@code args} must be consistent with any
+ * argument specifiers appearing in {@code formatString} according to
+ * the rules of {@link java.util.Formatter}. A mismatch in type
+ * information will cause this message to render without argument
+ * substitution. Before using this method you should be sure that the
+ * message you are creating is not locale sensitive. If it is locale
+ * sensitive consider defining an appropriate
+ * {@link LocalizableMessageDescriptor}.
+ *
+ * @param formatString
+ * The raw message format string.
+ * @param args
+ * The raw message parameters.
+ * @return An uninternationalized messages whose {@code String}
+ * representation is always the same regardless of the
+ * requested locale.
+ * @throws NullPointerException
+ * If {@code formatString} was {@code null}.
+ */
+ public static LocalizableMessage raw(CharSequence formatString, Object... args)
+ {
+ Validator.ensureNotNull(formatString);
+ return new LocalizableMessageDescriptor.Raw(formatString).get(args);
+ }
+
+
+
+ /**
+ * Creates a new message whose content is the {@code String}
+ * representation of the provided {@code Object}.
+ *
+ * @param object
+ * The object to be converted to a message, may be {@code
+ * null}.
+ * @return The new message.
+ */
+ public static LocalizableMessage valueOf(Object object)
+ {
+ if (object instanceof LocalizableMessage)
+ {
+ return (LocalizableMessage) object;
+ }
+ else if (object instanceof LocalizableMessageBuilder)
+ {
+ return ((LocalizableMessageBuilder) object).toMessage();
+ }
+ else
+ {
+ return new LocalizableMessageDescriptor.Raw(String.valueOf(object)).get();
+ }
+ }
+
+
+
+ /**
+ * Returns whether we are running post 1.5 on AIX or not.
+ *
+ * @return {@code true} if we are running post 1.5 on AIX and {@code
+ * false} otherwise.
+ */
+ private static boolean isAIXPost5()
+ {
+ // TODO: remove this code once the JDK issue referenced in 3077 is
+ // closed.
+ boolean isJDK15 = false;
+ try
+ {
+ final String javaRelease = System.getProperty("java.version");
+ isJDK15 = javaRelease.startsWith("1.5");
+ }
+ catch (final Throwable t)
+ {
+ System.err.println("Cannot get the java version: " + t);
+ }
+ final boolean isAIX = "aix".equalsIgnoreCase(System
+ .getProperty("os.name"));
+ return !isJDK15 && isAIX;
+ }
+
+
+
+ // Descriptor of this message.
+ private final LocalizableMessageDescriptor descriptor;
+
+ // Values used to replace argument specifiers in the format string.
+ private final Object[] args;
+
+
+
+ /**
+ * Creates a new parameterized message instance. See the class header
+ * for instructions on how to create messages outside of this package.
+ *
+ * @param descriptor
+ * The message descriptor.
+ * @param args
+ * The message parameters.
+ */
+ private LocalizableMessage(LocalizableMessageDescriptor descriptor, Object... args)
+ {
+ this.descriptor = descriptor;
+ this.args = args;
+ }
+
+
+
+ /**
+ * Returns the {@code char} value at the specified index of the
+ * {@code String} representation of this message in the default
+ * locale.
+ *
+ * @param index
+ * The index of the {@code char} value to be returned.
+ * @return The specified {@code char} value.
+ * @throws IndexOutOfBoundsException
+ * If the {@code index} argument is negative or not less
+ * than {@code length()}.
+ */
+ public char charAt(int index) throws IndexOutOfBoundsException
+ {
+ return charAt(Locale.getDefault(), index);
+ }
+
+
+
+ /**
+ * Returns the {@code char} value at the specified index of the
+ * {@code String} representation of this message in the specified
+ * locale.
+ *
+ * @param locale
+ * The locale.
+ * @param index
+ * The index of the {@code char} value to be returned.
+ * @return The specified {@code char} value.
+ * @throws IndexOutOfBoundsException
+ * If the {@code index} argument is negative or not less
+ * than {@code length()}.
+ * @throws NullPointerException
+ * If {@code locale} was {@code null}.
+ */
+ public char charAt(Locale locale, int index)
+ throws IndexOutOfBoundsException, NullPointerException
+ {
+ return toString(locale).charAt(index);
+ }
+
+
+
+ /**
+ * Compares this message with the specified message for order in the
+ * default locale. Returns a negative integer, zero, or a positive
+ * integer as this object is less than, equal to, or greater than the
+ * specified object.
+ *
+ * @param message
+ * The message to be compared.
+ * @return A negative integer, zero, or a positive integer as this
+ * object is less than, equal to, or greater than the
+ * specified object.
+ */
+ public int compareTo(LocalizableMessage message)
+ {
+ return toString().compareTo(message.toString());
+ }
+
+
+
+ /**
+ * Returns {@code true} if the provided object is a message whose
+ * {@code String} representation is equal to the {@code String}
+ * representation of this message in the default locale.
+ *
+ * @param o
+ * The object to be compared for equality with this message.
+ * @return {@code true} if this message is the equal to {@code o},
+ * otherwise {@code false}.
+ */
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ else if (o instanceof LocalizableMessage)
+ {
+ final LocalizableMessage message = (LocalizableMessage) o;
+ return toString().equals(message.toString());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+
+ /**
+ * Formats this message using the provided {@link Formatter}.
+ *
+ * @param formatter
+ * The {@link Formatter}.
+ * @param flags
+ * The flags modify the output format. The value is
+ * interpreted as a bitmask. Any combination of the following
+ * flags may be set:
+ * {@link java.util.FormattableFlags#LEFT_JUSTIFY},
+ * {@link java.util.FormattableFlags#UPPERCASE}, and
+ * {@link java.util.FormattableFlags#ALTERNATE}. If no flags
+ * are set, the default formatting of the implementing class
+ * will apply.
+ * @param width
+ * The minimum number of characters to be written to the
+ * output. If the length of the converted value is less than
+ * the {@code width} then the output will be padded by white
+ * space until the total number of characters equals width.
+ * The padding is at the beginning by default. If the
+ * {@link java.util.FormattableFlags#LEFT_JUSTIFY} flag is
+ * set then the padding will be at the end. If {@code width}
+ * is {@code -1} then there is no minimum.
+ * @param precision
+ * The maximum number of characters to be written to the
+ * output. The precision is applied before the width, thus
+ * the output will be truncated to {@code precision}
+ * characters even if the {@code width} is greater than the
+ * {@code precision}. If {@code precision} is {@code -1} then
+ * there is no explicit limit on the number of characters.
+ * @throws IllegalFormatException
+ * If any of the parameters are invalid. For specification
+ * of all possible formatting errors, see the <a
+ * href="../util/Formatter.html#detail">Details</a> section
+ * of the formatter class specification.
+ */
+ public void formatTo(Formatter formatter, int flags, int width,
+ int precision) throws IllegalFormatException
+ {
+ // Ignores flags, width and precision for now.
+ // see javadoc for Formattable
+ final Locale l = formatter.locale();
+ formatter.format(l, descriptor.getFormatString(l), args);
+ }
+
+
+
+ /**
+ * Returns the hash code value for this message calculated using the
+ * hash code of the {@code String} representation of this message in
+ * the default locale.
+ *
+ * @return The hash code value for this message.
+ */
+ public int hashCode()
+ {
+ return toString().hashCode();
+ }
+
+
+
+ /**
+ * Returns the length of the {@code String} representation of this
+ * message in the default locale.
+ *
+ * @return The length of the {@code String} representation of this
+ * message in the default locale.
+ */
+ public int length()
+ {
+ return length(Locale.getDefault());
+ }
+
+
+
+ /**
+ * Returns the length of the {@code String} representation of this
+ * message in the specified locale.
+ *
+ * @param locale
+ * The locale.
+ * @return The length of the {@code String} representation of this
+ * message in the specified locale.
+ * @throws NullPointerException
+ * If {@code locale} was {@code null}.
+ */
+ public int length(Locale locale) throws NullPointerException
+ {
+ return toString(locale).length();
+ }
+
+
+
+ /**
+ * Returns a new {@code CharSequence} which is a subsequence of the
+ * {@code String} representation of this message in the default
+ * locale. The subsequence starts with the {@code char} value at the
+ * specified index and ends with the {@code char} value at index
+ * {@code end - 1} . The length (in {@code char}s) of the returned
+ * sequence is {@code end - start}, so if {@code start == end} then an
+ * empty sequence is returned.
+ *
+ * @param start
+ * The start index, inclusive.
+ * @param end
+ * The end index, exclusive.
+ * @return The specified subsequence.
+ * @throws IndexOutOfBoundsException
+ * If {@code start} or {@code end} are negative, if {@code
+ * end} is greater than {@code length()}, or if {@code
+ * start} is greater than {@code end}.
+ */
+ public CharSequence subSequence(int start, int end)
+ throws IndexOutOfBoundsException
+ {
+ return subSequence(Locale.getDefault(), start, end);
+ }
+
+
+
+ /**
+ * Returns a new {@code CharSequence} which is a subsequence of the
+ * {@code String} representation of this message in the specified
+ * locale. The subsequence starts with the {@code char} value at the
+ * specified index and ends with the {@code char} value at index
+ * {@code end - 1} . The length (in {@code char}s) of the returned
+ * sequence is {@code end - start}, so if {@code start == end} then an
+ * empty sequence is returned.
+ *
+ * @param locale
+ * The locale.
+ * @param start
+ * The start index, inclusive.
+ * @param end
+ * The end index, exclusive.
+ * @return The specified subsequence.
+ * @throws IndexOutOfBoundsException
+ * If {@code start} or {@code end} are negative, if {@code
+ * end} is greater than {@code length()}, or if {@code
+ * start} is greater than {@code end}.
+ * @throws NullPointerException
+ * If {@code locale} was {@code null}.
+ */
+ public CharSequence subSequence(Locale locale, int start, int end)
+ throws IndexOutOfBoundsException, NullPointerException
+ {
+ return toString(locale).subSequence(start, end);
+ }
+
+
+
+ /**
+ * Returns the {@code String} representation of this message in the
+ * default locale.
+ *
+ * @return The {@code String} representation of this message.
+ */
+ public String toString()
+ {
+ return toString(Locale.getDefault());
+ }
+
+
+
+ /**
+ * Returns the {@code String} representation of this message in the
+ * specified locale.
+ *
+ * @param locale
+ * The locale.
+ * @return The {@code String} representation of this message.
+ * @throws NullPointerException
+ * If {@code locale} was {@code null}.
+ */
+ public String toString(Locale locale) throws NullPointerException
+ {
+ String s;
+ final String fmt = descriptor.getFormatString(locale);
+ if (descriptor.requiresFormatter())
+ {
+ try
+ {
+ // TODO: remove this code once the JDK issue referenced in 3077
+ // is closed.
+ if (IS_AIX_POST5)
+ {
+ // Java 6 in AIX Formatter does not handle properly
+ // Formattable arguments; this code is a workaround for the
+ // problem.
+ boolean changeType = false;
+ for (final Object o : args)
+ {
+ if (o instanceof Formattable)
+ {
+ changeType = true;
+ break;
+ }
+ }
+ if (changeType)
+ {
+ final Object[] newArgs = new Object[args.length];
+ for (int i = 0; i < args.length; i++)
+ {
+ if (args[i] instanceof Formattable)
+ {
+ newArgs[i] = args[i].toString();
+ }
+ else
+ {
+ newArgs[i] = args[i];
+ }
+ }
+ s = new Formatter(locale).format(locale, fmt, newArgs)
+ .toString();
+ }
+ else
+ {
+ s = new Formatter(locale).format(locale, fmt, args)
+ .toString();
+ }
+ }
+ else
+ {
+ s = new Formatter(locale).format(locale, fmt, args)
+ .toString();
+ }
+ }
+ catch (final IllegalFormatException e)
+ {
+ // This should not happend with any of our internal messages.
+ // However, this may happen for raw messages that have a
+ // mismatch between argument specifier type and argument type.
+ s = fmt;
+ }
+ }
+ else
+ {
+ s = fmt;
+ }
+ if (s == null)
+ {
+ s = "";
+ }
+ return s;
+ }
+
+}
diff --git a/sdk/src/org/opends/sdk/LocalizableMessageBuilder.java b/sdk/src/org/opends/sdk/LocalizableMessageBuilder.java
new file mode 100755
index 0000000..97ea423
--- /dev/null
+++ b/sdk/src/org/opends/sdk/LocalizableMessageBuilder.java
@@ -0,0 +1,437 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (the "License"). You may not use this file except in compliance
+ * with the License.
+ *
+ * You can obtain a copy of the license at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE
+ * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at
+ * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
+ * add the following below this CDDL HEADER, with the fields enclosed
+ * by brackets "[]" replaced with your own identifying information:
+ * Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ *
+ *
+ * Copyright 2007-2009 Sun Microsystems, Inc.
+ */
+
+package org.opends.sdk;
+
+
+
+import java.io.Serializable;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+
+import com.sun.opends.sdk.util.Validator;
+
+
+
+/**
+ * A mutable sequence of localizable messages and their parameters. As
+ * messages are appended they are translated to their string
+ * representation for storage using the locale specified in the
+ * constructor.
+ * <p>
+ * Note that before you use this class you should consider whether it is
+ * appropriate. In general composing messages by appending message to
+ * each other may not produce a message that is formatted appropriately
+ * for all locales.
+ * <p>
+ * It is usually better to create messages by composition. In other
+ * words you should create a base message that contains one or more
+ * string argument specifiers (%s) and define other message objects to
+ * use as replacement variables. In this way language translators have a
+ * change to reformat the message for a particular locale if necessary.
+ *
+ * @see LocalizableMessage
+ */
+public final class LocalizableMessageBuilder implements Appendable, CharSequence,
+ Serializable
+{
+
+ private static final long serialVersionUID = -3292823563904285315L;
+
+ // Used internally to store appended messages.
+ private final List<LocalizableMessage> messages = new LinkedList<LocalizableMessage>();
+
+
+
+ /**
+ * Creates a new message builder whose content is initially empty.
+ */
+ public LocalizableMessageBuilder()
+ {
+ // Nothing to do.
+ }
+
+
+
+ /**
+ * Creates a new message builder whose content is initially equal to
+ * the provided message.
+ *
+ * @param message
+ * The initial content of the message builder.
+ * @throws NullPointerException
+ * If {@code message} was {@code null}.
+ */
+ public LocalizableMessageBuilder(LocalizableMessage message) throws NullPointerException
+ {
+ append(message);
+ }
+
+
+
+ /**
+ * Creates a new message builder whose content is initially equal to
+ * the provided message builder.
+ *
+ * @param builder
+ * The initial content of the message builder.
+ * @throws NullPointerException
+ * If {@code builder} was {@code null}.
+ */
+ public LocalizableMessageBuilder(LocalizableMessageBuilder builder)
+ {
+ for (final LocalizableMessage message : builder.messages)
+ {
+ this.messages.add(message);
+ }
+ }
+
+
+
+ /**
+ * Creates a new message builder whose content is initially equal to
+ * the {@code String} representation of the provided {@code Object}.
+ *
+ * @param object
+ * The initial content of the message builder, may be {@code
+ * null}.
+ */
+ public LocalizableMessageBuilder(Object object)
+ {
+ append(object);
+ }
+
+
+
+ /**
+ * Appends the provided character to this message builder.
+ *
+ * @param c
+ * The character to be appended.
+ * @return A reference to this message builder.
+ */
+ public LocalizableMessageBuilder append(char c)
+ {
+ return append(LocalizableMessage.valueOf(c));
+ }
+
+
+
+ /**
+ * Appends the provided character sequence to this message builder.
+ *
+ * @param cs
+ * The character sequence to be appended.
+ * @return A reference to this message builder.
+ * @throws NullPointerException
+ * If {@code cs} was {@code null}.
+ */
+ public LocalizableMessageBuilder append(CharSequence cs)
+ throws NullPointerException
+ {
+ Validator.ensureNotNull(cs);
+ return append((Object) cs);
+ }
+
+
+
+ /**
+ * Appends a subsequence of the provided character sequence to this
+ * message builder.
+ * <p>
+ * An invocation of this method of the form {@code append(cs, start,
+ * end)}, behaves in exactly the same way as the invocation
+ *
+ * <pre>
+ * append(cs.subSequence(start, end))
+ * </pre>
+ *
+ * @param cs
+ * The character sequence to be appended.
+ * @param start
+ * The index of the first character in the subsequence.
+ * @param end
+ * The index of the character following the last character in
+ * the subsequence.
+ * @return A reference to this message builder.
+ * @throws IndexOutOfBoundsException
+ * If {@code start} or {@code end} are negative, {@code
+ * start} is greater than {@code end}, or {@code end} is
+ * greater than {@code csq.length()}.
+ * @throws NullPointerException
+ * If {@code cs} was {@code null}.
+ */
+ public LocalizableMessageBuilder append(CharSequence cs, int start, int end)
+ throws IndexOutOfBoundsException, NullPointerException
+ {
+ return append(cs.subSequence(start, end));
+ }
+
+
+
+ /**
+ * Appends the provided integer to this message builder.
+ *
+ * @param value
+ * The integer to be appended.
+ * @return A reference to this message builder.
+ */
+ public LocalizableMessageBuilder append(int value)
+ {
+ return append(LocalizableMessage.valueOf(value));
+ }
+
+
+
+ /**
+ * Appends the provided message to this message builder.
+ *
+ * @param message
+ * The message to be appended.
+ * @return A reference to this message builder.
+ * @throws NullPointerException
+ * If {@code message} was {@code null}.
+ */
+ public LocalizableMessageBuilder append(LocalizableMessage message)
+ throws NullPointerException
+ {
+ Validator.ensureNotNull(message);
+ messages.add(message);
+ return this;
+ }
+
+
+
+ /**
+ * Appends the {@code String} representation of the provided {@code
+ * Object} to this message builder.
+ *
+ * @param object
+ * The object to be appended, may be {@code null}.
+ * @return A reference to this message builder.
+ */
+ public LocalizableMessageBuilder append(Object object)
+ {
+ return append(LocalizableMessage.valueOf(object));
+ }
+
+
+
+ /**
+ * Returns the {@code char} value at the specified index of the
+ * {@code String} representation of this message builder in the
+ * default locale.
+ *
+ * @param index
+ * The index of the {@code char} value to be returned.
+ * @return The specified {@code char} value.
+ * @throws IndexOutOfBoundsException
+ * If the {@code index} argument is negative or not less
+ * than {@code length()}.
+ */
+ public char charAt(int index) throws IndexOutOfBoundsException
+ {
+ return charAt(Locale.getDefault(), index);
+ }
+
+
+
+ /**
+ * Returns the {@code char} value at the specified index of the
+ * {@code String} representation of this message builder in the
+ * specified locale.
+ *
+ * @param locale
+ * The locale.
+ * @param index
+ * The index of the {@code char} value to be returned.
+ * @return The specified {@code char} value.
+ * @throws IndexOutOfBoundsException
+ * If the {@code index} argument is negative or not less
+ * than {@code length()}.
+ * @throws NullPointerException
+ * If {@code locale} was {@code null}.
+ */
+ public char charAt(Locale locale, int index)
+ throws IndexOutOfBoundsException, NullPointerException
+ {
+ return toString(locale).charAt(index);
+ }
+
+
+
+ /**
+ * Returns the length of the {@code String} representation of this
+ * message builder in the default locale.
+ *
+ * @return The length of the {@code String} representation of this
+ * message builder in the default locale.
+ */
+ public int length()
+ {
+ return length(Locale.getDefault());
+ }
+
+
+
+ /**
+ * Returns the length of the {@code String} representation of this
+ * message builder in the specified locale.
+ *
+ * @param locale
+ * The locale.
+ * @return The length of the {@code String} representation of this
+ * message builder in the specified locale.
+ * @throws NullPointerException
+ * If {@code locale} was {@code null}.
+ */
+ public int length(Locale locale) throws NullPointerException
+ {
+ return toString(locale).length();
+ }
+
+
+
+ /**
+ * Returns a new {@code CharSequence} which is a subsequence of the
+ * {@code String} representation of this message builder in the
+ * default locale. The subsequence starts with the {@code char} value
+ * at the specified index and ends with the {@code char} value at
+ * index {@code end - 1} . The length (in {@code char}s) of the
+ * returned sequence is {@code end - start}, so if {@code start ==
+ * end} then an empty sequence is returned.
+ *
+ * @param start
+ * The start index, inclusive.
+ * @param end
+ * The end index, exclusive.
+ * @return The specified subsequence.
+ * @throws IndexOutOfBoundsException
+ * If {@code start} or {@code end} are negative, if {@code
+ * end} is greater than {@code length()}, or if {@code
+ * start} is greater than {@code end}.
+ */
+ public CharSequence subSequence(int start, int end)
+ throws IndexOutOfBoundsException
+ {
+ return subSequence(Locale.getDefault(), start, end);
+ }
+
+
+
+ /**
+ * Returns a new {@code CharSequence} which is a subsequence of the
+ * {@code String} representation of this message builder in the
+ * specified locale. The subsequence starts with the {@code char}
+ * value at the specified index and ends with the {@code char} value
+ * at index {@code end - 1} . The length (in {@code char}s) of the
+ * returned sequence is {@code end - start}, so if {@code start ==
+ * end} then an empty sequence is returned.
+ *
+ * @param locale
+ * The locale.
+ * @param start
+ * The start index, inclusive.
+ * @param end
+ * The end index, exclusive.
+ * @return The specified subsequence.
+ * @throws IndexOutOfBoundsException
+ * If {@code start} or {@code end} are negative, if {@code
+ * end} is greater than {@code length()}, or if {@code
+ * start} is greater than {@code end}.
+ * @throws NullPointerException
+ * If {@code locale} was {@code null}.
+ */
+ public CharSequence subSequence(Locale locale, int start, int end)
+ throws IndexOutOfBoundsException, NullPointerException
+ {
+ return toString(locale).subSequence(start, end);
+ }
+
+
+
+ /**
+ * Returns the {@link LocalizableMessage} representation of this message builder.
+ * Subsequent changes to this message builder will not modify the
+ * returned {@code LocalizableMessage}.
+ *
+ * @return The {@code LocalizableMessage} representation of this message builder.
+ */
+ public LocalizableMessage toMessage()
+ {
+ if (messages.isEmpty())
+ {
+ return LocalizableMessage.EMPTY;
+ }
+
+ final int sz = messages.size();
+ final StringBuffer fmtString = new StringBuffer(sz * 2);
+ for (int i = 0; i < sz; i++)
+ {
+ fmtString.append("%s");
+ }
+
+ return LocalizableMessage.raw(fmtString, messages.toArray());
+ }
+
+
+
+ /**
+ * Returns the {@code String} representation of this message builder
+ * in the default locale.
+ *
+ * @return The {@code String} representation of this message builder.
+ */
+ public String toString()
+ {
+ return toString(Locale.getDefault());
+ }
+
+
+
+ /**
+ * Returns the {@code String} representation of this message builder
+ * in the specified locale.
+ *
+ * @param locale
+ * The locale.
+ * @return The {@code String} representation of this message builder.
+ * @throws NullPointerException
+ * If {@code locale} was {@code null}.
+ */
+ public String toString(Locale locale)
+ {
+ final StringBuilder builder = new StringBuilder();
+ for (final LocalizableMessage message : messages)
+ {
+ builder.append(message.toString(locale));
+ }
+ return builder.toString();
+ }
+
+}
diff --git a/sdk/src/com/sun/opends/sdk/util/LocalizedIllegalArgumentException.java b/sdk/src/org/opends/sdk/LocalizedIllegalArgumentException.java
similarity index 90%
rename from sdk/src/com/sun/opends/sdk/util/LocalizedIllegalArgumentException.java
rename to sdk/src/org/opends/sdk/LocalizedIllegalArgumentException.java
index a1bdac6..8ab18d8 100644
--- a/sdk/src/com/sun/opends/sdk/util/LocalizedIllegalArgumentException.java
+++ b/sdk/src/org/opends/sdk/LocalizedIllegalArgumentException.java
@@ -25,7 +25,8 @@
* Copyright 2009 Sun Microsystems, Inc.
*/
-package com.sun.opends.sdk.util;
+package org.opends.sdk;
+
@@ -50,7 +51,7 @@
IllegalArgumentException implements LocalizableException
{
// The I18N message associated with this exception.
- private final Message message;
+ private final LocalizableMessage message;
@@ -61,7 +62,7 @@
* @param message
* The message that explains the problem that occurred.
*/
- public LocalizedIllegalArgumentException(Message message)
+ public LocalizedIllegalArgumentException(LocalizableMessage message)
{
super(String.valueOf(message));
this.message = message;
@@ -81,7 +82,7 @@
* permitted, and indicates that the cause is nonexistent or
* unknown.
*/
- public LocalizedIllegalArgumentException(Message message,
+ public LocalizedIllegalArgumentException(LocalizableMessage message,
Throwable cause)
{
super(String.valueOf(message), cause);
@@ -93,7 +94,7 @@
/**
* {@inheritDoc}
*/
- public Message getMessageObject()
+ public LocalizableMessage getMessageObject()
{
return this.message;
}
diff --git a/sdk/src/org/opends/sdk/Matcher.java b/sdk/src/org/opends/sdk/Matcher.java
index 2c27ea8..2a9f488 100644
--- a/sdk/src/org/opends/sdk/Matcher.java
+++ b/sdk/src/org/opends/sdk/Matcher.java
@@ -40,7 +40,6 @@
import org.opends.sdk.schema.Schema;
import org.opends.sdk.schema.UnknownSchemaElementException;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.StaticUtils;
diff --git a/sdk/src/org/opends/sdk/RDN.java b/sdk/src/org/opends/sdk/RDN.java
index 2f3cabb..c5b840a 100644
--- a/sdk/src/org/opends/sdk/RDN.java
+++ b/sdk/src/org/opends/sdk/RDN.java
@@ -376,7 +376,7 @@
}
catch (final UnknownSchemaElementException e)
{
- final Message message = ERR_RDN_TYPE_NOT_FOUND.get(rdn, e
+ final LocalizableMessage message = ERR_RDN_TYPE_NOT_FOUND.get(rdn, e
.getMessageObject());
throw new LocalizedIllegalArgumentException(message);
}
@@ -397,7 +397,7 @@
// that would be invalid.
if (reader.remaining() == 0)
{
- final Message message = ERR_ATTR_SYNTAX_DN_END_WITH_ATTR_NAME
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_END_WITH_ATTR_NAME
.get(reader.getString(), attribute.getNameOrOID());
throw new LocalizedIllegalArgumentException(message);
}
@@ -407,7 +407,7 @@
char c;
if ((c = reader.read()) != '=')
{
- final Message message = ERR_ATTR_SYNTAX_DN_NO_EQUAL.get(reader
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_NO_EQUAL.get(reader
.getString(), attribute.getNameOrOID(), c);
throw new LocalizedIllegalArgumentException(message);
}
@@ -444,7 +444,7 @@
{
if (lastWasPeriod)
{
- final Message message = ERR_ATTR_SYNTAX_OID_CONSECUTIVE_PERIODS
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_OID_CONSECUTIVE_PERIODS
.get(reader.getString(), reader.pos() - 1);
throw new LocalizedIllegalArgumentException(message);
}
@@ -456,7 +456,7 @@
else if (!isDigit(c))
{
// This must have been an illegal character.
- final Message message = ERR_ATTR_SYNTAX_OID_ILLEGAL_CHARACTER
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_OID_ILLEGAL_CHARACTER
.get(reader.getString(), reader.pos() - 1);
throw new LocalizedIllegalArgumentException(message);
}
@@ -477,7 +477,7 @@
if (length == 0 && !isAlpha(c))
{
// This is an illegal character.
- final Message message = ERR_ATTR_SYNTAX_DN_ATTR_ILLEGAL_CHAR
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_ATTR_ILLEGAL_CHAR
.get(reader.getString(), c, reader.pos() - 1);
throw new LocalizedIllegalArgumentException(message);
}
@@ -485,7 +485,7 @@
if (!isAlpha(c) && !isDigit(c) && c != '-')
{
// This is an illegal character.
- final Message message = ERR_ATTR_SYNTAX_DN_ATTR_ILLEGAL_CHAR
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_ATTR_ILLEGAL_CHAR
.get(reader.getString(), c, reader.pos() - 1);
throw new LocalizedIllegalArgumentException(message);
}
@@ -495,7 +495,7 @@
}
else
{
- final Message message = ERR_ATTR_SYNTAX_DN_ATTR_ILLEGAL_CHAR.get(
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_ATTR_ILLEGAL_CHAR.get(
reader.getString(), c, reader.pos() - 1);
throw new LocalizedIllegalArgumentException(message);
}
@@ -532,7 +532,7 @@
reader.mark();
if (reader.remaining() < 2)
{
- final Message message = ERR_ATTR_SYNTAX_DN_HEX_VALUE_TOO_SHORT
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_HEX_VALUE_TOO_SHORT
.get(reader.getString());
throw new LocalizedIllegalArgumentException(message);
}
@@ -546,7 +546,7 @@
}
else
{
- final Message message = ERR_ATTR_SYNTAX_DN_INVALID_HEX_DIGIT
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_INVALID_HEX_DIGIT
.get(reader.getString(), c);
throw new LocalizedIllegalArgumentException(message);
}
@@ -571,14 +571,14 @@
}
else
{
- final Message message = ERR_ATTR_SYNTAX_DN_INVALID_HEX_DIGIT
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_INVALID_HEX_DIGIT
.get(reader.getString(), c);
throw new LocalizedIllegalArgumentException(message);
}
}
else
{
- final Message message = ERR_ATTR_SYNTAX_DN_HEX_VALUE_TOO_SHORT
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_HEX_VALUE_TOO_SHORT
.get(reader.getString());
throw new LocalizedIllegalArgumentException(message);
}
@@ -590,7 +590,7 @@
}
else
{
- final Message message = ERR_ATTR_SYNTAX_DN_INVALID_HEX_DIGIT
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_INVALID_HEX_DIGIT
.get(reader.getString(), c);
throw new LocalizedIllegalArgumentException(message);
}
@@ -607,7 +607,7 @@
}
catch (final Exception e)
{
- final Message message = ERR_ATTR_SYNTAX_DN_ATTR_VALUE_DECODE_FAILURE
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_ATTR_VALUE_DECODE_FAILURE
.get(reader.getString(), String.valueOf(e));
throw new LocalizedIllegalArgumentException(message);
}
@@ -646,7 +646,7 @@
if (bytes.length() == 0)
{
// We don't allow an empty attribute value.
- final Message message = ERR_ATTR_SYNTAX_DN_INVALID_REQUIRES_ESCAPE_CHAR
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DN_INVALID_REQUIRES_ESCAPE_CHAR
.get(reader.getString(), reader.pos());
throw new LocalizedIllegalArgumentException(message);
}
diff --git a/sdk/src/org/opends/sdk/ResultCode.java b/sdk/src/org/opends/sdk/ResultCode.java
index 5f8c464..a8453b4 100644
--- a/sdk/src/org/opends/sdk/ResultCode.java
+++ b/sdk/src/org/opends/sdk/ResultCode.java
@@ -35,7 +35,6 @@
import java.util.Collections;
import java.util.List;
-import com.sun.opends.sdk.util.Message;
@@ -586,7 +585,7 @@
* @return The new error result code.
*/
private static ResultCode registerErrorResultCode(int intValue,
- Message name)
+ LocalizableMessage name)
{
ResultCode t = new ResultCode(intValue, name, true);
ELEMENTS[intValue] = t;
@@ -607,7 +606,7 @@
* @return The new success result code.
*/
private static ResultCode registerSuccessResultCode(int intValue,
- Message name)
+ LocalizableMessage name)
{
ResultCode t = new ResultCode(intValue, name, false);
ELEMENTS[intValue] = t;
@@ -638,7 +637,7 @@
if (resultCode == null)
{
- resultCode = new ResultCode(intValue, Message.raw("undefined("
+ resultCode = new ResultCode(intValue, LocalizableMessage.raw("undefined("
+ intValue + ")"), true);
}
@@ -664,14 +663,14 @@
private final int intValue;
- private final Message name;
+ private final LocalizableMessage name;
private final boolean exceptional;
// Prevent direct instantiation.
- private ResultCode(int intValue, Message name, boolean exceptional)
+ private ResultCode(int intValue, LocalizableMessage name, boolean exceptional)
{
this.intValue = intValue;
this.name = name;
@@ -701,7 +700,7 @@
*
* @return The short human-readable name of this result code.
*/
- public Message getName()
+ public LocalizableMessage getName()
{
return name;
}
diff --git a/sdk/src/org/opends/sdk/SortedEntry.java b/sdk/src/org/opends/sdk/SortedEntry.java
index da1ce00..02b2b1a 100644
--- a/sdk/src/org/opends/sdk/SortedEntry.java
+++ b/sdk/src/org/opends/sdk/SortedEntry.java
@@ -35,7 +35,6 @@
import org.opends.sdk.requests.Requests;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/asn1/ASN1ByteSequenceReader.java b/sdk/src/org/opends/sdk/asn1/ASN1ByteSequenceReader.java
index 2c21de6..e0dd0a6 100644
--- a/sdk/src/org/opends/sdk/asn1/ASN1ByteSequenceReader.java
+++ b/sdk/src/org/opends/sdk/asn1/ASN1ByteSequenceReader.java
@@ -36,12 +36,8 @@
import java.util.LinkedList;
import java.util.logging.Level;
-import org.opends.sdk.ByteSequenceReader;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.ByteStringBuilder;
-import org.opends.sdk.DecodeException;
+import org.opends.sdk.*;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -155,7 +151,7 @@
// Read just the type.
if (reader.remaining() <= 0)
{
- Message message = ERR_ASN1_TRUCATED_TYPE_BYTE.get();
+ LocalizableMessage message = ERR_ASN1_TRUCATED_TYPE_BYTE.get();
throw DecodeException.fatalError(message);
}
int type = reader.get();
@@ -179,13 +175,13 @@
if (peekLength != 1)
{
- Message message = ERR_ASN1_BOOLEAN_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_BOOLEAN_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
if (reader.remaining() < peekLength)
{
- Message message = ERR_ASN1_BOOLEAN_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_BOOLEAN_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -205,7 +201,7 @@
{
if (readerStack.isEmpty())
{
- Message message = ERR_ASN1_SEQUENCE_READ_NOT_STARTED.get();
+ LocalizableMessage message = ERR_ASN1_SEQUENCE_READ_NOT_STARTED.get();
throw new IllegalStateException(message.toString());
}
@@ -246,7 +242,7 @@
if ((peekLength < 1) || (peekLength > 4))
{
- Message message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -267,13 +263,13 @@
if ((peekLength < 1) || (peekLength > 8))
{
- Message message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
if (reader.remaining() < peekLength)
{
- Message message = ERR_ASN1_INTEGER_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_INTEGER_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -324,7 +320,7 @@
// Make sure that the decoded length is exactly zero byte.
if (peekLength != 0)
{
- Message message = ERR_ASN1_NULL_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_NULL_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -343,7 +339,7 @@
if (reader.remaining() < peekLength)
{
- Message message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -366,7 +362,7 @@
// Copy the value.
if (reader.remaining() < peekLength)
{
- Message message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -388,7 +384,7 @@
if (reader.remaining() < peekLength)
{
- Message message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -409,7 +405,7 @@
if (reader.remaining() < peekLength)
{
- Message message = ERR_ASN1_SEQUENCE_SET_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_SEQUENCE_SET_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -447,7 +443,7 @@
if (reader.remaining() < peekLength)
{
- Message message = ERR_ASN1_SKIP_TRUNCATED_VALUE.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_SKIP_TRUNCATED_VALUE.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -477,7 +473,7 @@
{
if (throwEofException)
{
- Message message = ERR_ASN1_TRUNCATED_LENGTH_BYTE.get();
+ LocalizableMessage message = ERR_ASN1_TRUNCATED_LENGTH_BYTE.get();
throw DecodeException.fatalError(message);
}
return false;
@@ -489,7 +485,7 @@
int lengthBytesNeeded = peekLength;
if (lengthBytesNeeded > 4)
{
- Message message = ERR_ASN1_INVALID_NUM_LENGTH_BYTES
+ LocalizableMessage message = ERR_ASN1_INVALID_NUM_LENGTH_BYTES
.get(lengthBytesNeeded);
throw DecodeException.fatalError(message);
}
@@ -499,7 +495,7 @@
{
if (throwEofException)
{
- Message message = ERR_ASN1_TRUNCATED_LENGTH_BYTES
+ LocalizableMessage message = ERR_ASN1_TRUNCATED_LENGTH_BYTES
.get(lengthBytesNeeded);
throw DecodeException.fatalError(message);
}
@@ -518,7 +514,7 @@
// message size.
if ((maxElementSize > 0) && (peekLength > maxElementSize))
{
- Message message = ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
+ LocalizableMessage message = ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
.get(peekLength, maxElementSize);
throw DecodeException.fatalError(message);
}
@@ -548,7 +544,7 @@
{
if (throwEofException)
{
- Message message = ERR_ASN1_TRUCATED_TYPE_BYTE.get();
+ LocalizableMessage message = ERR_ASN1_TRUCATED_TYPE_BYTE.get();
throw DecodeException.fatalError(message);
}
return false;
diff --git a/sdk/src/org/opends/sdk/asn1/ASN1InputStreamReader.java b/sdk/src/org/opends/sdk/asn1/ASN1InputStreamReader.java
index 194e273..25e57a6 100644
--- a/sdk/src/org/opends/sdk/asn1/ASN1InputStreamReader.java
+++ b/sdk/src/org/opends/sdk/asn1/ASN1InputStreamReader.java
@@ -40,8 +40,8 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.SizeLimitInputStream;
import com.sun.opends.sdk.util.StaticUtils;
@@ -197,14 +197,14 @@
if (peekLength != 1)
{
- Message message = ERR_ASN1_BOOLEAN_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_BOOLEAN_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
int readByte = in.read();
if (readByte == -1)
{
- Message message = ERR_ASN1_BOOLEAN_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_BOOLEAN_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -230,7 +230,7 @@
{
if (streamStack.isEmpty())
{
- Message message = ERR_ASN1_SEQUENCE_READ_NOT_STARTED.get();
+ LocalizableMessage message = ERR_ASN1_SEQUENCE_READ_NOT_STARTED.get();
throw new IllegalStateException(message.toString());
}
@@ -285,7 +285,7 @@
if ((peekLength < 1) || (peekLength > 4))
{
- Message message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -306,7 +306,7 @@
if ((peekLength < 1) || (peekLength > 8))
{
- Message message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -318,7 +318,7 @@
int readByte = in.read();
if (readByte == -1)
{
- Message message = ERR_ASN1_INTEGER_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_INTEGER_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -340,7 +340,7 @@
int readByte = in.read();
if (readByte == -1)
{
- Message message = ERR_ASN1_INTEGER_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_INTEGER_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -376,7 +376,7 @@
// Make sure that the decoded length is exactly zero byte.
if (peekLength != 0)
{
- Message message = ERR_ASN1_NULL_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_NULL_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -415,7 +415,7 @@
bytesRead = in.read(value, peekLength - bytesNeeded, bytesNeeded);
if (bytesRead < 0)
{
- Message message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -459,7 +459,7 @@
bytesRead = builder.append(in, bytesNeeded);
if (bytesRead < 0)
{
- Message message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -507,7 +507,7 @@
.read(buffer, peekLength - bytesNeeded, bytesNeeded);
if (bytesRead < 0)
{
- Message message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
+ LocalizableMessage message = ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE
.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -595,7 +595,7 @@
long bytesSkipped = in.skip(peekLength);
if (bytesSkipped != peekLength)
{
- Message message = ERR_ASN1_SKIP_TRUNCATED_VALUE.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_SKIP_TRUNCATED_VALUE.get(peekLength);
throw DecodeException.fatalError(message);
}
state = ELEMENT_READ_STATE_NEED_TYPE;
@@ -637,7 +637,7 @@
state = ELEMENT_READ_STATE_NEED_ADDITIONAL_LENGTH_BYTES;
if (throwEofException)
{
- Message message = ERR_ASN1_TRUNCATED_LENGTH_BYTES
+ LocalizableMessage message = ERR_ASN1_TRUNCATED_LENGTH_BYTES
.get(lengthBytesNeeded);
throw DecodeException.fatalError(message);
}
@@ -651,7 +651,7 @@
// message size.
if ((maxElementSize > 0) && (peekLength > maxElementSize))
{
- Message message = ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
+ LocalizableMessage message = ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
.get(peekLength, maxElementSize);
throw DecodeException.fatalError(message);
}
@@ -689,7 +689,7 @@
{
if (throwEofException)
{
- Message message = ERR_ASN1_TRUNCATED_LENGTH_BYTE.get();
+ LocalizableMessage message = ERR_ASN1_TRUNCATED_LENGTH_BYTE.get();
throw DecodeException.fatalError(message);
}
return false;
@@ -700,7 +700,7 @@
lengthBytesNeeded = peekLength;
if (lengthBytesNeeded > 4)
{
- Message message = ERR_ASN1_INVALID_NUM_LENGTH_BYTES
+ LocalizableMessage message = ERR_ASN1_INVALID_NUM_LENGTH_BYTES
.get(lengthBytesNeeded);
throw DecodeException.fatalError(message);
}
@@ -720,7 +720,7 @@
state = ELEMENT_READ_STATE_NEED_ADDITIONAL_LENGTH_BYTES;
if (throwEofException)
{
- Message message = ERR_ASN1_TRUNCATED_LENGTH_BYTES
+ LocalizableMessage message = ERR_ASN1_TRUNCATED_LENGTH_BYTES
.get(lengthBytesNeeded);
throw DecodeException.fatalError(message);
}
@@ -735,7 +735,7 @@
// message size.
if ((maxElementSize > 0) && (peekLength > maxElementSize))
{
- Message message = ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
+ LocalizableMessage message = ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED
.get(peekLength, maxElementSize);
throw DecodeException.fatalError(message);
}
@@ -774,7 +774,7 @@
{
if (throwEofException)
{
- Message message = ERR_ASN1_TRUCATED_TYPE_BYTE.get();
+ LocalizableMessage message = ERR_ASN1_TRUCATED_TYPE_BYTE.get();
throw DecodeException.fatalError(message);
}
return false;
diff --git a/sdk/src/org/opends/sdk/asn1/ASN1OutputStreamWriter.java b/sdk/src/org/opends/sdk/asn1/ASN1OutputStreamWriter.java
index bdaf6bb..206e8d4 100644
--- a/sdk/src/org/opends/sdk/asn1/ASN1OutputStreamWriter.java
+++ b/sdk/src/org/opends/sdk/asn1/ASN1OutputStreamWriter.java
@@ -38,9 +38,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteStringBuilder;
+import org.opends.sdk.LocalizableMessage;
import com.sun.opends.sdk.util.ByteSequenceOutputStream;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -128,7 +128,7 @@
{
if (stackDepth < 0)
{
- Message message = ERR_ASN1_SEQUENCE_WRITE_NOT_STARTED.get();
+ LocalizableMessage message = ERR_ASN1_SEQUENCE_WRITE_NOT_STARTED.get();
throw new IllegalStateException(message.toString());
}
diff --git a/sdk/src/org/opends/sdk/asn1/AbstractASN1Reader.java b/sdk/src/org/opends/sdk/asn1/AbstractASN1Reader.java
index 8540c52..a6fb65a 100644
--- a/sdk/src/org/opends/sdk/asn1/AbstractASN1Reader.java
+++ b/sdk/src/org/opends/sdk/asn1/AbstractASN1Reader.java
@@ -37,8 +37,8 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
@@ -203,7 +203,7 @@
{
if (peekType() != expectedType)
{
- Message message = ERR_ASN1_UNEXPECTED_TAG.get(expectedType,
+ LocalizableMessage message = ERR_ASN1_UNEXPECTED_TAG.get(expectedType,
peekType());
throw DecodeException.fatalError(message);
}
diff --git a/sdk/src/org/opends/sdk/controls/AccountUsabilityControl.java b/sdk/src/org/opends/sdk/controls/AccountUsabilityControl.java
index e435032..88f1256 100644
--- a/sdk/src/org/opends/sdk/controls/AccountUsabilityControl.java
+++ b/sdk/src/org/opends/sdk/controls/AccountUsabilityControl.java
@@ -10,12 +10,12 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -518,7 +518,7 @@
{
if (value != null)
{
- Message message = ERR_ACCTUSABLEREQ_CONTROL_HAS_VALUE.get();
+ LocalizableMessage message = ERR_ACCTUSABLEREQ_CONTROL_HAS_VALUE.get();
throw DecodeException.error(message);
}
@@ -552,7 +552,7 @@
if (value == null)
{
// The response control must always have a value.
- Message message = ERR_ACCTUSABLERES_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_ACCTUSABLERES_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -606,7 +606,7 @@
secondsBeforeUnlock);
default:
- Message message = ERR_ACCTUSABLERES_UNKNOWN_VALUE_ELEMENT_TYPE
+ LocalizableMessage message = ERR_ACCTUSABLERES_UNKNOWN_VALUE_ELEMENT_TYPE
.get(byteToHex(reader.peekType()));
throw DecodeException.error(message);
}
@@ -616,7 +616,7 @@
StaticUtils.DEBUG_LOG.throwing(
"AccountUsabilityControl.ResponseDecoder", "decode", e);
- Message message = ERR_ACCTUSABLERES_DECODE_ERROR
+ LocalizableMessage message = ERR_ACCTUSABLERES_DECODE_ERROR
.get(getExceptionMessage(e));
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/controls/AssertionControl.java b/sdk/src/org/opends/sdk/controls/AssertionControl.java
index de8e2b7..2affdc6 100644
--- a/sdk/src/org/opends/sdk/controls/AssertionControl.java
+++ b/sdk/src/org/opends/sdk/controls/AssertionControl.java
@@ -34,17 +34,13 @@
import java.io.IOException;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.ByteStringBuilder;
-import org.opends.sdk.DecodeException;
-import org.opends.sdk.Filter;
+import org.opends.sdk.*;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.ldap.LDAPUtils;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -75,7 +71,7 @@
{
if (value == null)
{
- Message message = ERR_LDAPASSERT_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_LDAPASSERT_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/controls/AuthorizationIdentityControl.java b/sdk/src/org/opends/sdk/controls/AuthorizationIdentityControl.java
index a7f4a08..cbf1442 100644
--- a/sdk/src/org/opends/sdk/controls/AuthorizationIdentityControl.java
+++ b/sdk/src/org/opends/sdk/controls/AuthorizationIdentityControl.java
@@ -7,9 +7,9 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -231,7 +231,7 @@
{
if (value != null)
{
- Message message = ERR_AUTHZIDREQ_CONTROL_HAS_VALUE.get();
+ LocalizableMessage message = ERR_AUTHZIDREQ_CONTROL_HAS_VALUE.get();
throw DecodeException.error(message);
}
@@ -263,7 +263,7 @@
{
if (value == null)
{
- Message message = ERR_AUTHZIDRESP_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_AUTHZIDRESP_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/controls/EntryChangeNotificationControl.java b/sdk/src/org/opends/sdk/controls/EntryChangeNotificationControl.java
index 4981c4b..36c713e 100644
--- a/sdk/src/org/opends/sdk/controls/EntryChangeNotificationControl.java
+++ b/sdk/src/org/opends/sdk/controls/EntryChangeNotificationControl.java
@@ -8,16 +8,12 @@
import java.io.IOException;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.ByteStringBuilder;
-import org.opends.sdk.DN;
-import org.opends.sdk.DecodeException;
+import org.opends.sdk.*;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -52,7 +48,7 @@
{
if (value == null)
{
- Message message = ERR_ECN_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_ECN_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -71,7 +67,7 @@
{
if (changeType != PersistentSearchChangeType.MODIFY_DN)
{
- Message message = ERR_ECN_ILLEGAL_PREVIOUS_DN.get(String
+ LocalizableMessage message = ERR_ECN_ILLEGAL_PREVIOUS_DN.get(String
.valueOf(changeType));
throw DecodeException.error(message);
}
@@ -89,7 +85,7 @@
StaticUtils.DEBUG_LOG.throwing(
"EntryChangeNotificationControl.Decoder", "decode", e);
- Message message = ERR_ECN_CANNOT_DECODE_VALUE
+ LocalizableMessage message = ERR_ECN_CANNOT_DECODE_VALUE
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
diff --git a/sdk/src/org/opends/sdk/controls/GetEffectiveRightsRequestControl.java b/sdk/src/org/opends/sdk/controls/GetEffectiveRightsRequestControl.java
index f355daf..8820f0a 100644
--- a/sdk/src/org/opends/sdk/controls/GetEffectiveRightsRequestControl.java
+++ b/sdk/src/org/opends/sdk/controls/GetEffectiveRightsRequestControl.java
@@ -7,17 +7,13 @@
import java.io.IOException;
import java.util.*;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.ByteStringBuilder;
-import org.opends.sdk.DN;
-import org.opends.sdk.DecodeException;
+import org.opends.sdk.*;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.schema.AttributeType;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -90,7 +86,7 @@
authzDN = authzIDString.substring(3);
else
{
- Message message = INFO_GETEFFECTIVERIGHTS_INVALID_AUTHZID
+ LocalizableMessage message = INFO_GETEFFECTIVERIGHTS_INVALID_AUTHZID
.get(lowerAuthzIDString);
throw DecodeException.error(message);
}
@@ -111,7 +107,7 @@
}
catch (IOException e)
{
- Message message = INFO_GETEFFECTIVERIGHTS_DECODE_ERROR.get(e
+ LocalizableMessage message = INFO_GETEFFECTIVERIGHTS_DECODE_ERROR.get(e
.getMessage());
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/controls/MatchedValuesControl.java b/sdk/src/org/opends/sdk/controls/MatchedValuesControl.java
index 6bd04a0..432d3d4 100644
--- a/sdk/src/org/opends/sdk/controls/MatchedValuesControl.java
+++ b/sdk/src/org/opends/sdk/controls/MatchedValuesControl.java
@@ -44,8 +44,6 @@
import org.opends.sdk.ldap.LDAPUtils;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -79,7 +77,7 @@
public LocalizedIllegalArgumentException visitAndFilter(Filter p,
List<Filter> subFilters)
{
- Message message = ERR_MVFILTER_BAD_FILTER_AND.get(p.toString());
+ LocalizableMessage message = ERR_MVFILTER_BAD_FILTER_AND.get(p.toString());
return new LocalizedIllegalArgumentException(message);
}
@@ -92,7 +90,7 @@
{
if (dnAttributes)
{
- Message message = ERR_MVFILTER_BAD_FILTER_EXT.get(p.toString());
+ LocalizableMessage message = ERR_MVFILTER_BAD_FILTER_EXT.get(p.toString());
return new LocalizedIllegalArgumentException(message);
}
else
@@ -107,7 +105,7 @@
public LocalizedIllegalArgumentException visitNotFilter(Filter p,
Filter subFilter)
{
- Message message = ERR_MVFILTER_BAD_FILTER_NOT.get(p.toString());
+ LocalizableMessage message = ERR_MVFILTER_BAD_FILTER_NOT.get(p.toString());
return new LocalizedIllegalArgumentException(message);
}
@@ -117,7 +115,7 @@
public LocalizedIllegalArgumentException visitOrFilter(Filter p,
List<Filter> subFilters)
{
- Message message = ERR_MVFILTER_BAD_FILTER_OR.get(p.toString());
+ LocalizableMessage message = ERR_MVFILTER_BAD_FILTER_OR.get(p.toString());
return new LocalizedIllegalArgumentException(message);
}
@@ -127,7 +125,7 @@
public LocalizedIllegalArgumentException visitUnrecognizedFilter(
Filter p, byte filterTag, ByteSequence filterBytes)
{
- Message message = ERR_MVFILTER_BAD_FILTER_UNRECOGNIZED.get(p
+ LocalizableMessage message = ERR_MVFILTER_BAD_FILTER_UNRECOGNIZED.get(p
.toString(), filterTag);
return new LocalizedIllegalArgumentException(message);
}
@@ -149,7 +147,7 @@
{
if (value == null)
{
- Message message = ERR_MATCHEDVALUES_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_MATCHEDVALUES_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -159,7 +157,7 @@
reader.readStartSequence();
if (!reader.hasNextElement())
{
- Message message = ERR_MATCHEDVALUES_NO_FILTERS.get();
+ LocalizableMessage message = ERR_MATCHEDVALUES_NO_FILTERS.get();
throw DecodeException.error(message);
}
@@ -191,7 +189,7 @@
StaticUtils.DEBUG_LOG.throwing("MatchedValuesControl.Decoder",
"decode", e);
- Message message = ERR_MATCHEDVALUES_CANNOT_DECODE_VALUE_AS_SEQUENCE
+ LocalizableMessage message = ERR_MATCHEDVALUES_CANNOT_DECODE_VALUE_AS_SEQUENCE
.get(getExceptionMessage(e));
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/controls/PagedResultsControl.java b/sdk/src/org/opends/sdk/controls/PagedResultsControl.java
index 45d80a8..c30b60e 100644
--- a/sdk/src/org/opends/sdk/controls/PagedResultsControl.java
+++ b/sdk/src/org/opends/sdk/controls/PagedResultsControl.java
@@ -9,12 +9,12 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -51,7 +51,7 @@
{
if (value == null)
{
- Message message = ERR_LDAP_PAGED_RESULTS_DECODE_NULL.get();
+ LocalizableMessage message = ERR_LDAP_PAGED_RESULTS_DECODE_NULL.get();
throw DecodeException.error(message);
}
@@ -65,7 +65,7 @@
StaticUtils.DEBUG_LOG.throwing("PagedResultsControl.Decoder",
"decode", e);
- Message message = ERR_LDAP_PAGED_RESULTS_DECODE_SEQUENCE
+ LocalizableMessage message = ERR_LDAP_PAGED_RESULTS_DECODE_SEQUENCE
.get(String.valueOf(e));
throw DecodeException.error(message, e);
}
@@ -80,7 +80,7 @@
StaticUtils.DEBUG_LOG.throwing("PagedResultsControl.Decoder",
"decode", e);
- Message message = ERR_LDAP_PAGED_RESULTS_DECODE_SIZE.get(String
+ LocalizableMessage message = ERR_LDAP_PAGED_RESULTS_DECODE_SIZE.get(String
.valueOf(e));
throw DecodeException.error(message, e);
}
@@ -95,7 +95,7 @@
StaticUtils.DEBUG_LOG.throwing("PagedResultsControl.Decoder",
"decode", e);
- Message message = ERR_LDAP_PAGED_RESULTS_DECODE_COOKIE
+ LocalizableMessage message = ERR_LDAP_PAGED_RESULTS_DECODE_COOKIE
.get(String.valueOf(e));
throw DecodeException.error(message, e);
}
@@ -109,7 +109,7 @@
StaticUtils.DEBUG_LOG.throwing("PagedResultsControl.Decoder",
"decode", e);
- Message message = ERR_LDAP_PAGED_RESULTS_DECODE_SEQUENCE
+ LocalizableMessage message = ERR_LDAP_PAGED_RESULTS_DECODE_SEQUENCE
.get(String.valueOf(e));
throw DecodeException.error(message, e);
}
diff --git a/sdk/src/org/opends/sdk/controls/PasswordExpiredControl.java b/sdk/src/org/opends/sdk/controls/PasswordExpiredControl.java
index 4f1ef7b..4d7fc40 100644
--- a/sdk/src/org/opends/sdk/controls/PasswordExpiredControl.java
+++ b/sdk/src/org/opends/sdk/controls/PasswordExpiredControl.java
@@ -6,9 +6,9 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
@@ -48,7 +48,7 @@
}
catch (Exception e)
{
- Message message = ERR_PWEXPIRED_CONTROL_INVALID_VALUE.get();
+ LocalizableMessage message = ERR_PWEXPIRED_CONTROL_INVALID_VALUE.get();
throw DecodeException.error(message);
}
}
diff --git a/sdk/src/org/opends/sdk/controls/PasswordExpiringControl.java b/sdk/src/org/opends/sdk/controls/PasswordExpiringControl.java
index 6d40dbf..1b2c71e 100644
--- a/sdk/src/org/opends/sdk/controls/PasswordExpiringControl.java
+++ b/sdk/src/org/opends/sdk/controls/PasswordExpiringControl.java
@@ -7,9 +7,9 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -44,7 +44,7 @@
{
if (value == null)
{
- Message message = ERR_PWEXPIRING_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_PWEXPIRING_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -58,7 +58,7 @@
StaticUtils.DEBUG_LOG.throwing(
"PasswordExpiringControl.Decoder", "decode", e);
- Message message = ERR_PWEXPIRING_CANNOT_DECODE_SECONDS_UNTIL_EXPIRATION
+ LocalizableMessage message = ERR_PWEXPIRING_CANNOT_DECODE_SECONDS_UNTIL_EXPIRATION
.get(getExceptionMessage(e));
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/controls/PasswordPolicyControl.java b/sdk/src/org/opends/sdk/controls/PasswordPolicyControl.java
index c191e8c..9f24331 100644
--- a/sdk/src/org/opends/sdk/controls/PasswordPolicyControl.java
+++ b/sdk/src/org/opends/sdk/controls/PasswordPolicyControl.java
@@ -10,12 +10,12 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -278,7 +278,7 @@
{
if (value != null)
{
- Message message = ERR_PWPOLICYREQ_CONTROL_HAS_VALUE.get();
+ LocalizableMessage message = ERR_PWPOLICYREQ_CONTROL_HAS_VALUE.get();
throw DecodeException.error(message);
}
@@ -311,7 +311,7 @@
if (value == null)
{
// The response control must always have a value.
- Message message = ERR_PWPOLICYRES_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_PWPOLICYRES_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -335,7 +335,7 @@
warningValue = (int) reader.readInteger();
if (warningType == null)
{
- Message message = ERR_PWPOLICYRES_INVALID_WARNING_TYPE
+ LocalizableMessage message = ERR_PWPOLICYRES_INVALID_WARNING_TYPE
.get(byteToHex(reader.peekType()));
throw DecodeException.error(message);
}
@@ -348,7 +348,7 @@
errorType = PasswordPolicyErrorType.valueOf(errorValue);
if (errorType == null)
{
- Message message = ERR_PWPOLICYRES_INVALID_ERROR_TYPE
+ LocalizableMessage message = ERR_PWPOLICYRES_INVALID_ERROR_TYPE
.get(errorValue);
throw DecodeException.error(message);
}
@@ -372,7 +372,7 @@
StaticUtils.DEBUG_LOG.throwing(
"PasswordPolicyControl.ResponseDecoder", "decode", e);
- Message message = ERR_PWPOLICYRES_DECODE_ERROR
+ LocalizableMessage message = ERR_PWPOLICYRES_DECODE_ERROR
.get(getExceptionMessage(e));
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/controls/PasswordPolicyErrorType.java b/sdk/src/org/opends/sdk/controls/PasswordPolicyErrorType.java
index 826c2a5..da0142b 100644
--- a/sdk/src/org/opends/sdk/controls/PasswordPolicyErrorType.java
+++ b/sdk/src/org/opends/sdk/controls/PasswordPolicyErrorType.java
@@ -7,7 +7,8 @@
import java.util.Arrays;
import java.util.List;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
@@ -55,7 +56,7 @@
PasswordPolicyErrorType e = ELEMENTS[intValue];
if (e == null)
{
- e = new PasswordPolicyErrorType(intValue, Message
+ e = new PasswordPolicyErrorType(intValue, LocalizableMessage
.raw("undefined(" + intValue + ")"));
}
return e;
@@ -71,7 +72,7 @@
private static PasswordPolicyErrorType register(int intValue,
- Message name)
+ LocalizableMessage name)
{
PasswordPolicyErrorType t = new PasswordPolicyErrorType(intValue,
name);
@@ -83,11 +84,11 @@
private final int intValue;
- private final Message name;
+ private final LocalizableMessage name;
- private PasswordPolicyErrorType(int intValue, Message name)
+ private PasswordPolicyErrorType(int intValue, LocalizableMessage name)
{
this.intValue = intValue;
this.name = name;
diff --git a/sdk/src/org/opends/sdk/controls/PasswordPolicyWarningType.java b/sdk/src/org/opends/sdk/controls/PasswordPolicyWarningType.java
index 46c322b..702378e 100644
--- a/sdk/src/org/opends/sdk/controls/PasswordPolicyWarningType.java
+++ b/sdk/src/org/opends/sdk/controls/PasswordPolicyWarningType.java
@@ -7,7 +7,8 @@
import java.util.Arrays;
import java.util.List;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
@@ -33,7 +34,7 @@
PasswordPolicyWarningType e = ELEMENTS[intValue];
if (e == null)
{
- e = new PasswordPolicyWarningType(intValue, Message
+ e = new PasswordPolicyWarningType(intValue, LocalizableMessage
.raw("undefined(" + intValue + ")"));
}
return e;
@@ -49,7 +50,7 @@
private static PasswordPolicyWarningType register(int intValue,
- Message name)
+ LocalizableMessage name)
{
PasswordPolicyWarningType t = new PasswordPolicyWarningType(
intValue, name);
@@ -61,11 +62,11 @@
private final int intValue;
- private final Message name;
+ private final LocalizableMessage name;
- private PasswordPolicyWarningType(int intValue, Message name)
+ private PasswordPolicyWarningType(int intValue, LocalizableMessage name)
{
this.intValue = intValue;
this.name = name;
diff --git a/sdk/src/org/opends/sdk/controls/PersistentSearchControl.java b/sdk/src/org/opends/sdk/controls/PersistentSearchControl.java
index cbcae72..1ad08ec 100644
--- a/sdk/src/org/opends/sdk/controls/PersistentSearchControl.java
+++ b/sdk/src/org/opends/sdk/controls/PersistentSearchControl.java
@@ -10,12 +10,12 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -50,7 +50,7 @@
{
if (value == null)
{
- Message message = ERR_PSEARCH_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_PSEARCH_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -73,7 +73,7 @@
StaticUtils.DEBUG_LOG.throwing(
"PersistentSearchControl.Decoder", "decode", e);
- Message message = ERR_PSEARCH_CANNOT_DECODE_VALUE
+ LocalizableMessage message = ERR_PSEARCH_CANNOT_DECODE_VALUE
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
diff --git a/sdk/src/org/opends/sdk/controls/PostReadControl.java b/sdk/src/org/opends/sdk/controls/PostReadControl.java
index 5596d02..d15ed28 100644
--- a/sdk/src/org/opends/sdk/controls/PostReadControl.java
+++ b/sdk/src/org/opends/sdk/controls/PostReadControl.java
@@ -39,6 +39,7 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
@@ -46,7 +47,6 @@
import org.opends.sdk.responses.SearchResultEntry;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -339,7 +339,7 @@
{
if (value == null)
{
- Message message = ERR_POSTREADREQ_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_POSTREADREQ_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -359,7 +359,7 @@
StaticUtils.DEBUG_LOG.throwing(
"PersistentSearchControl.RequestDecoder", "decode", ae);
- Message message = ERR_POSTREADREQ_CANNOT_DECODE_VALUE.get(ae
+ LocalizableMessage message = ERR_POSTREADREQ_CANNOT_DECODE_VALUE.get(ae
.getMessage());
throw DecodeException.error(message, ae);
}
@@ -394,7 +394,7 @@
{
if (value == null)
{
- Message message = ERR_POSTREADRESP_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_POSTREADRESP_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -409,7 +409,7 @@
StaticUtils.DEBUG_LOG.throwing(
"PersistentSearchControl.ResponseDecoder", "decode", le);
- Message message = ERR_POSTREADRESP_CANNOT_DECODE_VALUE.get(le
+ LocalizableMessage message = ERR_POSTREADRESP_CANNOT_DECODE_VALUE.get(le
.getMessage());
throw DecodeException.error(message, le);
}
diff --git a/sdk/src/org/opends/sdk/controls/PreReadControl.java b/sdk/src/org/opends/sdk/controls/PreReadControl.java
index c7e3661..e99101a 100644
--- a/sdk/src/org/opends/sdk/controls/PreReadControl.java
+++ b/sdk/src/org/opends/sdk/controls/PreReadControl.java
@@ -39,6 +39,7 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
@@ -46,7 +47,6 @@
import org.opends.sdk.responses.SearchResultEntry;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -339,7 +339,7 @@
{
if (value == null)
{
- Message message = ERR_PREREADREQ_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_PREREADREQ_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -359,7 +359,7 @@
StaticUtils.DEBUG_LOG.throwing("PreReadControl.RequestDecoder",
"decode", ae);
- Message message = ERR_PREREADREQ_CANNOT_DECODE_VALUE.get(ae
+ LocalizableMessage message = ERR_PREREADREQ_CANNOT_DECODE_VALUE.get(ae
.getMessage());
throw DecodeException.error(message, ae);
}
@@ -394,7 +394,7 @@
{
if (value == null)
{
- Message message = ERR_PREREADRESP_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_PREREADRESP_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -409,7 +409,7 @@
StaticUtils.DEBUG_LOG.throwing(
"PersistentSearchControl.ResponseDecoder", "decode", le);
- Message message = ERR_PREREADRESP_CANNOT_DECODE_VALUE.get(le
+ LocalizableMessage message = ERR_PREREADRESP_CANNOT_DECODE_VALUE.get(le
.getMessage());
throw DecodeException.error(message, le);
}
diff --git a/sdk/src/org/opends/sdk/controls/ProxiedAuthV1Control.java b/sdk/src/org/opends/sdk/controls/ProxiedAuthV1Control.java
index f680699..e1ecf82 100644
--- a/sdk/src/org/opends/sdk/controls/ProxiedAuthV1Control.java
+++ b/sdk/src/org/opends/sdk/controls/ProxiedAuthV1Control.java
@@ -10,11 +10,11 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -54,13 +54,13 @@
{
if (!isCritical)
{
- Message message = ERR_PROXYAUTH1_CONTROL_NOT_CRITICAL.get();
+ LocalizableMessage message = ERR_PROXYAUTH1_CONTROL_NOT_CRITICAL.get();
throw DecodeException.error(message);
}
if (value == null)
{
- Message message = ERR_PROXYAUTH1_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_PROXYAUTH1_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -77,7 +77,7 @@
StaticUtils.DEBUG_LOG.throwing("ProxiedAuthV1Control.Decoder",
"decode", e);
- Message message = ERR_PROXYAUTH1_CANNOT_DECODE_VALUE
+ LocalizableMessage message = ERR_PROXYAUTH1_CANNOT_DECODE_VALUE
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
diff --git a/sdk/src/org/opends/sdk/controls/ProxiedAuthV2Control.java b/sdk/src/org/opends/sdk/controls/ProxiedAuthV2Control.java
index a3c5b98..b1f2eb5 100644
--- a/sdk/src/org/opends/sdk/controls/ProxiedAuthV2Control.java
+++ b/sdk/src/org/opends/sdk/controls/ProxiedAuthV2Control.java
@@ -10,11 +10,11 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -52,13 +52,13 @@
{
if (!isCritical)
{
- Message message = ERR_PROXYAUTH2_CONTROL_NOT_CRITICAL.get();
+ LocalizableMessage message = ERR_PROXYAUTH2_CONTROL_NOT_CRITICAL.get();
throw DecodeException.error(message);
}
if (value == null)
{
- Message message = ERR_PROXYAUTH2_NO_CONTROL_VALUE.get();
+ LocalizableMessage message = ERR_PROXYAUTH2_NO_CONTROL_VALUE.get();
throw DecodeException.error(message);
}
@@ -83,7 +83,7 @@
StaticUtils.DEBUG_LOG.throwing("ProxiedAuthV2Control.Decoder",
"decode", e);
- Message message = ERR_PROXYAUTH2_CANNOT_DECODE_VALUE
+ LocalizableMessage message = ERR_PROXYAUTH2_CANNOT_DECODE_VALUE
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
diff --git a/sdk/src/org/opends/sdk/controls/ServerSideSortControl.java b/sdk/src/org/opends/sdk/controls/ServerSideSortControl.java
index 3ab3dc1..ddb314e 100644
--- a/sdk/src/org/opends/sdk/controls/ServerSideSortControl.java
+++ b/sdk/src/org/opends/sdk/controls/ServerSideSortControl.java
@@ -13,12 +13,12 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -353,7 +353,7 @@
{
if (value == null)
{
- Message message = INFO_SORTREQ_CONTROL_NO_VALUE.get();
+ LocalizableMessage message = INFO_SORTREQ_CONTROL_NO_VALUE.get();
throw DecodeException.error(message);
}
@@ -363,7 +363,7 @@
reader.readStartSequence();
if (!reader.hasNextElement())
{
- Message message = INFO_SORTREQ_CONTROL_NO_SORT_KEYS.get();
+ LocalizableMessage message = INFO_SORTREQ_CONTROL_NO_SORT_KEYS.get();
throw DecodeException.error(message);
}
@@ -396,7 +396,7 @@
}
catch (IOException e)
{
- Message message = INFO_SORTREQ_CONTROL_CANNOT_DECODE_VALUE
+ LocalizableMessage message = INFO_SORTREQ_CONTROL_CANNOT_DECODE_VALUE
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
@@ -428,7 +428,7 @@
{
if (value == null)
{
- Message message = INFO_SORTRES_CONTROL_NO_VALUE.get();
+ LocalizableMessage message = INFO_SORTRES_CONTROL_NO_VALUE.get();
throw DecodeException.error(message);
}
@@ -449,7 +449,7 @@
}
catch (IOException e)
{
- Message message = INFO_SORTRES_CONTROL_CANNOT_DECODE_VALUE
+ LocalizableMessage message = INFO_SORTRES_CONTROL_CANNOT_DECODE_VALUE
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
@@ -519,7 +519,7 @@
{
if (token.length() == 0)
{
- Message message = INFO_SORTREQ_CONTROL_NO_ATTR_NAME
+ LocalizableMessage message = INFO_SORTREQ_CONTROL_NO_ATTR_NAME
.get(sortOrderString);
throw DecodeException.error(message);
}
@@ -528,13 +528,13 @@
}
else if (colonPos == 0)
{
- Message message = INFO_SORTREQ_CONTROL_NO_ATTR_NAME
+ LocalizableMessage message = INFO_SORTREQ_CONTROL_NO_ATTR_NAME
.get(sortOrderString);
throw DecodeException.error(message);
}
else if (colonPos == (token.length() - 1))
{
- Message message = INFO_SORTREQ_CONTROL_NO_MATCHING_RULE
+ LocalizableMessage message = INFO_SORTREQ_CONTROL_NO_MATCHING_RULE
.get(sortOrderString);
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/controls/SubtreeDeleteControl.java b/sdk/src/org/opends/sdk/controls/SubtreeDeleteControl.java
index bbdd5ef..5dc906f 100644
--- a/sdk/src/org/opends/sdk/controls/SubtreeDeleteControl.java
+++ b/sdk/src/org/opends/sdk/controls/SubtreeDeleteControl.java
@@ -6,9 +6,9 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
@@ -41,7 +41,7 @@
{
if (value != null)
{
- Message message = ERR_SUBTREE_DELETE_INVALID_CONTROL_VALUE
+ LocalizableMessage message = ERR_SUBTREE_DELETE_INVALID_CONTROL_VALUE
.get();
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/controls/VLVControl.java b/sdk/src/org/opends/sdk/controls/VLVControl.java
index 963827b..708cbae 100644
--- a/sdk/src/org/opends/sdk/controls/VLVControl.java
+++ b/sdk/src/org/opends/sdk/controls/VLVControl.java
@@ -10,12 +10,12 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -542,7 +542,7 @@
{
if (value == null)
{
- Message message = INFO_VLVREQ_CONTROL_NO_VALUE.get();
+ LocalizableMessage message = INFO_VLVREQ_CONTROL_NO_VALUE.get();
throw DecodeException.error(message);
}
@@ -565,7 +565,7 @@
}
catch (IOException e)
{
- Message message = INFO_VLVREQ_CONTROL_CANNOT_DECODE_VALUE
+ LocalizableMessage message = INFO_VLVREQ_CONTROL_CANNOT_DECODE_VALUE
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
@@ -596,7 +596,7 @@
{
if (value == null)
{
- Message message = INFO_VLVRES_CONTROL_NO_VALUE.get();
+ LocalizableMessage message = INFO_VLVRES_CONTROL_NO_VALUE.get();
throw DecodeException.error(message);
}
@@ -620,7 +620,7 @@
}
catch (IOException e)
{
- Message message = INFO_VLVRES_CONTROL_CANNOT_DECODE_VALUE
+ LocalizableMessage message = INFO_VLVRES_CONTROL_CANNOT_DECODE_VALUE
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
diff --git a/sdk/src/org/opends/sdk/controls/VLVTarget.java b/sdk/src/org/opends/sdk/controls/VLVTarget.java
index 0e8f398..19230fd 100644
--- a/sdk/src/org/opends/sdk/controls/VLVTarget.java
+++ b/sdk/src/org/opends/sdk/controls/VLVTarget.java
@@ -9,10 +9,10 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -155,7 +155,7 @@
return new GreaterThanOrEqual(assertionValue);
default:
- Message message = INFO_VLVREQ_CONTROL_INVALID_TARGET_TYPE
+ LocalizableMessage message = INFO_VLVREQ_CONTROL_INVALID_TARGET_TYPE
.get(byteToHex(targetType));
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/extensions/CancelRequest.java b/sdk/src/org/opends/sdk/extensions/CancelRequest.java
index d18f7cf..b9308a4 100644
--- a/sdk/src/org/opends/sdk/extensions/CancelRequest.java
+++ b/sdk/src/org/opends/sdk/extensions/CancelRequest.java
@@ -7,10 +7,7 @@
import java.io.IOException;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.ByteStringBuilder;
-import org.opends.sdk.DecodeException;
-import org.opends.sdk.ResultCode;
+import org.opends.sdk.*;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
@@ -18,7 +15,6 @@
import org.opends.sdk.responses.Responses;
import org.opends.sdk.responses.Result;
-import com.sun.opends.sdk.util.Message;
@@ -126,7 +122,7 @@
}
catch (IOException e)
{
- Message message = ERR_EXTOP_CANCEL_CANNOT_DECODE_REQUEST_VALUE
+ LocalizableMessage message = ERR_EXTOP_CANCEL_CANNOT_DECODE_REQUEST_VALUE
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
diff --git a/sdk/src/org/opends/sdk/extensions/GetConnectionIDRequest.java b/sdk/src/org/opends/sdk/extensions/GetConnectionIDRequest.java
index 65de671..4dd4190 100644
--- a/sdk/src/org/opends/sdk/extensions/GetConnectionIDRequest.java
+++ b/sdk/src/org/opends/sdk/extensions/GetConnectionIDRequest.java
@@ -6,12 +6,12 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.ResultCode;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.requests.AbstractExtendedRequest;
-import com.sun.opends.sdk.util.Message;
@@ -84,7 +84,7 @@
if (!resultCode.isExceptional()
&& ((responseValue == null) || (responseValue.length() <= 0)))
{
- throw DecodeException.error(Message
+ throw DecodeException.error(LocalizableMessage
.raw("Empty response value"));
}
@@ -98,7 +98,7 @@
}
catch (IOException e)
{
- throw DecodeException.error(Message
+ throw DecodeException.error(LocalizableMessage
.raw("Error decoding response value"), e);
}
}
diff --git a/sdk/src/org/opends/sdk/extensions/GetSymmetricKeyRequest.java b/sdk/src/org/opends/sdk/extensions/GetSymmetricKeyRequest.java
index 33e76c0..a2767cc 100644
--- a/sdk/src/org/opends/sdk/extensions/GetSymmetricKeyRequest.java
+++ b/sdk/src/org/opends/sdk/extensions/GetSymmetricKeyRequest.java
@@ -6,10 +6,7 @@
import java.io.IOException;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.ByteStringBuilder;
-import org.opends.sdk.DecodeException;
-import org.opends.sdk.ResultCode;
+import org.opends.sdk.*;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
@@ -17,7 +14,6 @@
import org.opends.sdk.responses.Responses;
import org.opends.sdk.responses.Result;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -166,7 +162,7 @@
if (requestValue == null)
{
// The request must always have a value.
- Message message = ERR_GET_SYMMETRIC_KEY_NO_VALUE.get();
+ LocalizableMessage message = ERR_GET_SYMMETRIC_KEY_NO_VALUE.get();
throw DecodeException.error(message);
}
@@ -196,7 +192,7 @@
StaticUtils.DEBUG_LOG.throwing(
"GetSymmetricKeyRequest.Operation", "decodeRequest", ae);
- Message message = ERR_GET_SYMMETRIC_KEY_ASN1_DECODE_EXCEPTION
+ LocalizableMessage message = ERR_GET_SYMMETRIC_KEY_ASN1_DECODE_EXCEPTION
.get(ae.getMessage());
throw DecodeException.error(message, ae);
}
diff --git a/sdk/src/org/opends/sdk/extensions/PasswordModifyRequest.java b/sdk/src/org/opends/sdk/extensions/PasswordModifyRequest.java
index 84f61d9..c9b6d66 100644
--- a/sdk/src/org/opends/sdk/extensions/PasswordModifyRequest.java
+++ b/sdk/src/org/opends/sdk/extensions/PasswordModifyRequest.java
@@ -7,16 +7,12 @@
import java.io.IOException;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.ByteStringBuilder;
-import org.opends.sdk.DecodeException;
-import org.opends.sdk.ResultCode;
+import org.opends.sdk.*;
import org.opends.sdk.asn1.ASN1;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.requests.AbstractExtendedRequest;
-import com.sun.opends.sdk.util.Message;
@@ -220,7 +216,7 @@
}
catch (IOException e)
{
- Message message = ERR_EXTOP_PASSMOD_CANNOT_DECODE_REQUEST
+ LocalizableMessage message = ERR_EXTOP_PASSMOD_CANNOT_DECODE_REQUEST
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
@@ -253,7 +249,7 @@
}
catch (IOException e)
{
- Message message = ERR_EXTOP_PASSMOD_CANNOT_DECODE_REQUEST
+ LocalizableMessage message = ERR_EXTOP_PASSMOD_CANNOT_DECODE_REQUEST
.get(getExceptionMessage(e));
throw DecodeException.error(message, e);
}
diff --git a/sdk/src/org/opends/sdk/extensions/PasswordPolicyStateExtendedOperation.java b/sdk/src/org/opends/sdk/extensions/PasswordPolicyStateExtendedOperation.java
index 910979c..4668d61 100644
--- a/sdk/src/org/opends/sdk/extensions/PasswordPolicyStateExtendedOperation.java
+++ b/sdk/src/org/opends/sdk/extensions/PasswordPolicyStateExtendedOperation.java
@@ -18,7 +18,6 @@
import org.opends.sdk.requests.AbstractExtendedRequest;
import org.opends.sdk.responses.AbstractExtendedResult;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -1000,7 +999,7 @@
}
catch (IOException ioe)
{
- Message message = ERR_PWPSTATE_EXTOP_DECODE_FAILURE
+ LocalizableMessage message = ERR_PWPSTATE_EXTOP_DECODE_FAILURE
.get(getExceptionMessage(ioe));
throw DecodeException.error(message, ioe);
}
@@ -1036,7 +1035,7 @@
}
catch (IOException ioe)
{
- Message message = ERR_PWPSTATE_EXTOP_DECODE_FAILURE
+ LocalizableMessage message = ERR_PWPSTATE_EXTOP_DECODE_FAILURE
.get(getExceptionMessage(ioe));
throw DecodeException.error(message, ioe);
}
diff --git a/sdk/src/org/opends/sdk/ldap/ASN1StreamReader.java b/sdk/src/org/opends/sdk/ldap/ASN1StreamReader.java
index 633d5df..77ea4fa 100644
--- a/sdk/src/org/opends/sdk/ldap/ASN1StreamReader.java
+++ b/sdk/src/org/opends/sdk/ldap/ASN1StreamReader.java
@@ -38,12 +38,12 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.ByteStringBuilder;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1Reader;
import org.opends.sdk.asn1.AbstractASN1Reader;
import com.sun.grizzly.streams.StreamReader;
import com.sun.grizzly.utils.PoolableObject;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -141,7 +141,7 @@
public ChildSequenceLimiter endSequence() throws DecodeException
{
- Message message = ERR_ASN1_SEQUENCE_READ_NOT_STARTED.get();
+ LocalizableMessage message = ERR_ASN1_SEQUENCE_READ_NOT_STARTED.get();
throw new IllegalStateException(message.toString());
}
@@ -348,7 +348,7 @@
if (peekLength != 1)
{
- Message message = ERR_ASN1_BOOLEAN_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_BOOLEAN_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -410,7 +410,7 @@
if ((peekLength < 1) || (peekLength > 4))
{
- Message message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -431,7 +431,7 @@
if ((peekLength < 1) || (peekLength > 8))
{
- Message message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_INTEGER_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -490,7 +490,7 @@
// Make sure that the decoded length is exactly zero byte.
if (peekLength != 0)
{
- Message message = ERR_ASN1_NULL_INVALID_LENGTH.get(peekLength);
+ LocalizableMessage message = ERR_ASN1_NULL_INVALID_LENGTH.get(peekLength);
throw DecodeException.fatalError(message);
}
@@ -736,7 +736,7 @@
// message size.
if ((maxElementSize > 0) && (peekLength > maxElementSize))
{
- Message m = ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED.get(
+ LocalizableMessage m = ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED.get(
peekLength, maxElementSize);
throw DecodeException.fatalError(m);
}
@@ -773,7 +773,7 @@
lengthBytesNeeded = peekLength;
if (lengthBytesNeeded > 4)
{
- Message message = ERR_ASN1_INVALID_NUM_LENGTH_BYTES
+ LocalizableMessage message = ERR_ASN1_INVALID_NUM_LENGTH_BYTES
.get(lengthBytesNeeded);
throw DecodeException.fatalError(message);
}
@@ -798,7 +798,7 @@
// message size.
if ((maxElementSize > 0) && (peekLength > maxElementSize))
{
- Message m = ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED.get(
+ LocalizableMessage m = ERR_LDAP_CLIENT_DECODE_MAX_REQUEST_SIZE_EXCEEDED.get(
peekLength, maxElementSize);
throw DecodeException.fatalError(m);
}
diff --git a/sdk/src/org/opends/sdk/ldap/ASN1StreamWriter.java b/sdk/src/org/opends/sdk/ldap/ASN1StreamWriter.java
index 94c9e34..bc9b613c 100644
--- a/sdk/src/org/opends/sdk/ldap/ASN1StreamWriter.java
+++ b/sdk/src/org/opends/sdk/ldap/ASN1StreamWriter.java
@@ -36,12 +36,12 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteStringBuilder;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.asn1.ASN1Writer;
import org.opends.sdk.asn1.AbstractASN1Writer;
import com.sun.grizzly.streams.StreamWriter;
import com.sun.grizzly.utils.PoolableObject;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -120,7 +120,7 @@
public SequenceBuffer endSequence() throws IOException
{
- Message message = ERR_ASN1_SEQUENCE_WRITE_NOT_STARTED.get();
+ LocalizableMessage message = ERR_ASN1_SEQUENCE_WRITE_NOT_STARTED.get();
throw new IllegalStateException(message.toString());
}
diff --git a/sdk/src/org/opends/sdk/ldap/LDAPConnection.java b/sdk/src/org/opends/sdk/ldap/LDAPConnection.java
index d2776f8..0ff3ef2 100644
--- a/sdk/src/org/opends/sdk/ldap/LDAPConnection.java
+++ b/sdk/src/org/opends/sdk/ldap/LDAPConnection.java
@@ -58,7 +58,6 @@
import com.sun.grizzly.filterchain.StreamTransformerFilter;
import com.sun.grizzly.ssl.*;
import com.sun.grizzly.streams.StreamWriter;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/ldap/LDAPDecoder.java b/sdk/src/org/opends/sdk/ldap/LDAPDecoder.java
index 353877f..4c93998 100644
--- a/sdk/src/org/opends/sdk/ldap/LDAPDecoder.java
+++ b/sdk/src/org/opends/sdk/ldap/LDAPDecoder.java
@@ -44,7 +44,6 @@
import org.opends.sdk.sasl.GenericSASLBindRequest;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.StaticUtils;
diff --git a/sdk/src/org/opends/sdk/ldap/UnexpectedRequestException.java b/sdk/src/org/opends/sdk/ldap/UnexpectedRequestException.java
index d0fb634..78bd0de 100644
--- a/sdk/src/org/opends/sdk/ldap/UnexpectedRequestException.java
+++ b/sdk/src/org/opends/sdk/ldap/UnexpectedRequestException.java
@@ -31,9 +31,9 @@
import java.io.IOException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.requests.Request;
-import com.sun.opends.sdk.util.Message;
@@ -50,7 +50,7 @@
public UnexpectedRequestException(int messageID, Request request)
{
- super(Message.raw("Unexpected LDAP request: id=%d, message=%s",
+ super(LocalizableMessage.raw("Unexpected LDAP request: id=%d, message=%s",
messageID, request).toString());
this.messageID = messageID;
this.request = request;
diff --git a/sdk/src/org/opends/sdk/ldap/UnexpectedResponseException.java b/sdk/src/org/opends/sdk/ldap/UnexpectedResponseException.java
index 582412b..ddd3d0d 100644
--- a/sdk/src/org/opends/sdk/ldap/UnexpectedResponseException.java
+++ b/sdk/src/org/opends/sdk/ldap/UnexpectedResponseException.java
@@ -31,9 +31,9 @@
import java.io.IOException;
+import org.opends.sdk.LocalizableMessage;
import org.opends.sdk.responses.Response;
-import com.sun.opends.sdk.util.Message;
@@ -50,7 +50,7 @@
public UnexpectedResponseException(int messageID, Response response)
{
- super(Message.raw("Unexpected LDAP response: id=%d, message=%s",
+ super(LocalizableMessage.raw("Unexpected LDAP response: id=%d, message=%s",
messageID, response).toString());
this.messageID = messageID;
this.response = response;
diff --git a/sdk/src/org/opends/sdk/ldap/UnsupportedMessageException.java b/sdk/src/org/opends/sdk/ldap/UnsupportedMessageException.java
index adf4683..9c3a330 100644
--- a/sdk/src/org/opends/sdk/ldap/UnsupportedMessageException.java
+++ b/sdk/src/org/opends/sdk/ldap/UnsupportedMessageException.java
@@ -50,7 +50,7 @@
public UnsupportedMessageException(int id, byte tag,
ByteString content)
{
- super(com.sun.opends.sdk.util.Message.raw(
+ super(org.opends.sdk.LocalizableMessage.raw(
"Unsupported LDAP message: id=%d, tag=%d, content=%s", id, tag,
content).toString());
this.id = id;
diff --git a/sdk/src/org/opends/sdk/ldif/AbstractLDIFReader.java b/sdk/src/org/opends/sdk/ldif/AbstractLDIFReader.java
index 6d119e2..4038f82 100644
--- a/sdk/src/org/opends/sdk/ldif/AbstractLDIFReader.java
+++ b/sdk/src/org/opends/sdk/ldif/AbstractLDIFReader.java
@@ -270,7 +270,7 @@
final int colonPos = ldifLine.indexOf(":");
if (colonPos <= 0)
{
- final Message message = ERR_LDIF_NO_ATTR_NAME.get(
+ final LocalizableMessage message = ERR_LDIF_NO_ATTR_NAME.get(
record.lineNumber, ldifLine);
throw DecodeException.error(message);
}
@@ -314,7 +314,7 @@
catch (final LocalizedIllegalArgumentException e)
{
// The value did not have a valid base64-encoding.
- final Message message = ERR_LDIF_COULD_NOT_BASE64_DECODE_ATTR
+ final LocalizableMessage message = ERR_LDIF_COULD_NOT_BASE64_DECODE_ATTR
.get(entryDN.toString(), record.lineNumber, ldifLine, e
.getMessageObject());
throw DecodeException.error(message);
@@ -338,7 +338,7 @@
catch (final Exception e)
{
// The URL was malformed or had an invalid protocol.
- final Message message = ERR_LDIF_INVALID_URL.get(entryDN
+ final LocalizableMessage message = ERR_LDIF_INVALID_URL.get(entryDN
.toString(), record.lineNumber, attrName, String
.valueOf(e));
throw DecodeException.error(message);
@@ -364,7 +364,7 @@
{
// We were unable to read the contents of that URL for some
// reason.
- final Message message = ERR_LDIF_URL_IO_ERROR.get(entryDN
+ final LocalizableMessage message = ERR_LDIF_URL_IO_ERROR.get(entryDN
.toString(), record.lineNumber, attrName, String
.valueOf(contentURL), String.valueOf(e));
throw DecodeException.error(message);
@@ -441,7 +441,7 @@
else if (isContinuationLine(line))
{
// Fatal: got a continuation line at the start of the record.
- final Message message = ERR_LDIF_INVALID_LEADING_SPACE.get(
+ final LocalizableMessage message = ERR_LDIF_INVALID_LEADING_SPACE.get(
lineNumber, line);
throw DecodeException.fatalError(message);
}
@@ -613,7 +613,7 @@
if (validateSchema
&& attributeDescription.containsOption("binary"))
{
- final Message message = ERR_LDIF_INVALID_ATTR_OPTION.get(entry
+ final LocalizableMessage message = ERR_LDIF_INVALID_ATTR_OPTION.get(entry
.getName().toString(), record.lineNumber, attrDescr);
throw DecodeException.error(message);
}
@@ -629,11 +629,11 @@
{
if (validateSchema)
{
- final MessageBuilder invalidReason = new MessageBuilder();
+ final LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
if (!attributeDescription.getAttributeType().getSyntax()
.valueIsAcceptable(value, invalidReason))
{
- final Message message = WARN_LDIF_VALUE_VIOLATES_SYNTAX.get(
+ final LocalizableMessage message = WARN_LDIF_VALUE_VIOLATES_SYNTAX.get(
entry.getName().toString(), record.lineNumber, value
.toString(), attrDescr, invalidReason);
throw DecodeException.error(message);
@@ -647,11 +647,11 @@
{
if (validateSchema)
{
- final MessageBuilder invalidReason = new MessageBuilder();
+ final LocalizableMessageBuilder invalidReason = new LocalizableMessageBuilder();
if (!attributeDescription.getAttributeType().getSyntax()
.valueIsAcceptable(value, invalidReason))
{
- final Message message = WARN_LDIF_VALUE_VIOLATES_SYNTAX.get(
+ final LocalizableMessage message = WARN_LDIF_VALUE_VIOLATES_SYNTAX.get(
entry.getName().toString(), record.lineNumber, value
.toString(), attrDescr, invalidReason);
throw DecodeException.error(message);
@@ -659,7 +659,7 @@
if (!attribute.add(value))
{
- final Message message = WARN_LDIF_DUPLICATE_ATTR.get(entry
+ final LocalizableMessage message = WARN_LDIF_DUPLICATE_ATTR.get(entry
.getName().toString(), record.lineNumber, attrDescr,
value.toString());
throw DecodeException.error(message);
@@ -667,7 +667,7 @@
if (attributeDescription.getAttributeType().isSingleValue())
{
- final Message message = ERR_LDIF_MULTIPLE_VALUES_FOR_SINGLE_VALUED_ATTR
+ final LocalizableMessage message = ERR_LDIF_MULTIPLE_VALUES_FOR_SINGLE_VALUED_ATTR
.get(entry.getName().toString(), record.lineNumber,
attrDescr);
throw DecodeException.error(message);
@@ -688,7 +688,7 @@
int colonPos = ldifLine.indexOf(":");
if (colonPos <= 0)
{
- final Message message = ERR_LDIF_NO_ATTR_NAME.get(
+ final LocalizableMessage message = ERR_LDIF_NO_ATTR_NAME.get(
record.lineNumber, ldifLine.toString());
throw DecodeException.error(message);
}
@@ -706,7 +706,7 @@
colonPos = ldifLine.indexOf(":");
if (colonPos <= 0)
{
- final Message message = ERR_LDIF_NO_ATTR_NAME.get(
+ final LocalizableMessage message = ERR_LDIF_NO_ATTR_NAME.get(
record.lineNumber, ldifLine.toString());
throw DecodeException.error(message);
}
@@ -716,7 +716,7 @@
if (!attrName.equals("dn"))
{
- final Message message = ERR_LDIF_NO_DN.get(record.lineNumber,
+ final LocalizableMessage message = ERR_LDIF_NO_DN.get(record.lineNumber,
ldifLine.toString());
throw DecodeException.error(message);
}
@@ -751,7 +751,7 @@
catch (final LocalizedIllegalArgumentException e)
{
// The value did not have a valid base64-encoding.
- final Message message = ERR_LDIF_COULD_NOT_BASE64_DECODE_DN
+ final LocalizableMessage message = ERR_LDIF_COULD_NOT_BASE64_DECODE_DN
.get(record.lineNumber, ldifLine, e.getMessageObject());
throw DecodeException.error(message);
}
@@ -775,7 +775,7 @@
}
catch (final LocalizedIllegalArgumentException e)
{
- final Message message = ERR_LDIF_INVALID_DN.get(
+ final LocalizableMessage message = ERR_LDIF_INVALID_DN.get(
record.lineNumber, ldifLine, e.getMessageObject());
throw DecodeException.error(message);
}
@@ -790,7 +790,7 @@
final int colonPos = ldifLine.indexOf(":");
if (colonPos <= 0)
{
- final Message message = ERR_LDIF_NO_ATTR_NAME.get(
+ final LocalizableMessage message = ERR_LDIF_NO_ATTR_NAME.get(
record.lineNumber, ldifLine);
throw DecodeException.error(message);
}
@@ -802,7 +802,7 @@
if (colonPos == length - 1)
{
// FIXME: improve error.
- final Message message = Message
+ final LocalizableMessage message = LocalizableMessage
.raw("Malformed changetype attribute");
throw DecodeException.error(message);
}
@@ -825,7 +825,7 @@
{
// The value did not have a valid base64-encoding.
// FIXME: improve error.
- final Message message = Message
+ final LocalizableMessage message = LocalizableMessage
.raw("Malformed base64 changetype attribute");
throw DecodeException.error(message);
}
@@ -849,7 +849,7 @@
- final void rejectLDIFRecord(LDIFRecord record, Message message)
+ final void rejectLDIFRecord(LDIFRecord record, LocalizableMessage message)
throws DecodeException
{
// FIXME: not yet implemented.
@@ -858,7 +858,7 @@
- final void skipLDIFRecord(LDIFRecord record, Message message)
+ final void skipLDIFRecord(LDIFRecord record, LocalizableMessage message)
{
// FIXME: not yet implemented.
}
diff --git a/sdk/src/org/opends/sdk/ldif/LDIFChangeRecordReader.java b/sdk/src/org/opends/sdk/ldif/LDIFChangeRecordReader.java
index 8b59d0e..f9dbffb 100644
--- a/sdk/src/org/opends/sdk/ldif/LDIFChangeRecordReader.java
+++ b/sdk/src/org/opends/sdk/ldif/LDIFChangeRecordReader.java
@@ -44,8 +44,6 @@
import org.opends.sdk.requests.Requests;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -89,7 +87,7 @@
if (record == null)
{
// No change record found.
- Message message = WARN_READ_LDIF_RECORD_NO_CHANGE_RECORD_FOUND
+ LocalizableMessage message = WARN_READ_LDIF_RECORD_NO_CHANGE_RECORD_FOUND
.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -97,7 +95,7 @@
if (reader.readChangeRecord() != null)
{
// Multiple change records found.
- Message message = WARN_READ_LDIF_RECORD_MULTIPLE_CHANGE_RECORDS_FOUND
+ LocalizableMessage message = WARN_READ_LDIF_RECORD_MULTIPLE_CHANGE_RECORDS_FOUND
.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -112,7 +110,7 @@
catch (IOException e)
{
// This should never happen for a String based reader.
- Message message = WARN_READ_LDIF_RECORD_UNEXPECTED_IO_ERROR.get(e
+ LocalizableMessage message = WARN_READ_LDIF_RECORD_UNEXPECTED_IO_ERROR.get(e
.getMessage());
throw new LocalizedIllegalArgumentException(message);
}
@@ -220,7 +218,7 @@
// Skip if branch containing the entry DN is excluded.
if (isBranchExcluded(entryDN))
{
- final Message message = Message
+ final LocalizableMessage message = LocalizableMessage
.raw("Skipping entry because it is in excluded branch");
skipLDIFRecord(record, message);
continue;
@@ -232,7 +230,7 @@
if (!record.iterator.hasNext())
{
// FIXME: improve error.
- final Message message = Message.raw("Missing changetype");
+ final LocalizableMessage message = LocalizableMessage.raw("Missing changetype");
throw DecodeException.error(message);
}
@@ -275,7 +273,7 @@
else
{
// FIXME: improve error.
- final Message message = ERR_LDIF_INVALID_CHANGETYPE_ATTRIBUTE
+ final LocalizableMessage message = ERR_LDIF_INVALID_CHANGETYPE_ATTRIBUTE
.get(pair.value, "add, delete, modify, moddn, modrdn");
throw DecodeException.error(message);
}
@@ -474,7 +472,7 @@
if (record.iterator.hasNext())
{
// FIXME: include line number in error.
- final Message message = ERR_LDIF_INVALID_DELETE_ATTRIBUTES.get();
+ final LocalizableMessage message = ERR_LDIF_INVALID_DELETE_ATTRIBUTES.get();
throw DecodeException.error(message);
}
@@ -517,7 +515,7 @@
else
{
// FIXME: improve error.
- final Message message = ERR_LDIF_INVALID_MODIFY_ATTRIBUTE.get(
+ final LocalizableMessage message = ERR_LDIF_INVALID_MODIFY_ATTRIBUTE.get(
pair.key, "add, delete, replace, increment");
throw DecodeException.error(message);
}
@@ -548,7 +546,7 @@
if (validateSchema
&& attributeDescription.containsOption("binary"))
{
- final Message message = ERR_LDIF_INVALID_ATTR_OPTION.get(
+ final LocalizableMessage message = ERR_LDIF_INVALID_ATTR_OPTION.get(
entryDN.toString(), record.lineNumber, pair.value);
throw DecodeException.error(message);
}
@@ -596,7 +594,7 @@
if (!attributeDescription2.equals(attributeDescription))
{
// TODO: include line number.
- final Message message = ERR_LDIF_INVALID_CHANGERECORD_ATTRIBUTE
+ final LocalizableMessage message = ERR_LDIF_INVALID_CHANGERECORD_ATTRIBUTE
.get(attributeDescription2.toString(),
attributeDescription.toString());
throw DecodeException.error(message);
@@ -626,7 +624,7 @@
if (!record.iterator.hasNext())
{
// TODO: include line number.
- final Message message = ERR_LDIF_NO_MOD_DN_ATTRIBUTES.get();
+ final LocalizableMessage message = ERR_LDIF_NO_MOD_DN_ATTRIBUTES.get();
throw DecodeException.error(message);
}
@@ -636,7 +634,7 @@
if (!toLowerCase(pair.key).equals("newrdn"))
{
// FIXME: improve error.
- final Message message = Message.raw("Missing newrdn");
+ final LocalizableMessage message = LocalizableMessage.raw("Missing newrdn");
throw DecodeException.error(message);
}
@@ -647,7 +645,7 @@
}
catch (final LocalizedIllegalArgumentException e)
{
- final Message message = ERR_LDIF_INVALID_DN.get(
+ final LocalizableMessage message = ERR_LDIF_INVALID_DN.get(
record.lineNumber, ldifLine, e.getMessageObject());
throw DecodeException.error(message);
}
@@ -656,7 +654,7 @@
if (!record.iterator.hasNext())
{
// TODO: include line number.
- final Message message = ERR_LDIF_NO_DELETE_OLDRDN_ATTRIBUTE.get();
+ final LocalizableMessage message = ERR_LDIF_NO_DELETE_OLDRDN_ATTRIBUTE.get();
throw DecodeException.error(message);
}
@@ -665,7 +663,7 @@
if (!toLowerCase(pair.key).equals("deleteoldrdn"))
{
// FIXME: improve error.
- final Message message = Message.raw("Missing deleteoldrdn");
+ final LocalizableMessage message = LocalizableMessage.raw("Missing deleteoldrdn");
throw DecodeException.error(message);
}
@@ -683,7 +681,7 @@
else
{
// FIXME: improve error.
- final Message message = ERR_LDIF_INVALID_DELETE_OLDRDN_ATTRIBUTE
+ final LocalizableMessage message = ERR_LDIF_INVALID_DELETE_OLDRDN_ATTRIBUTE
.get(pair.value);
throw DecodeException.error(message);
}
@@ -696,7 +694,7 @@
if (!toLowerCase(pair.key).equals("newsuperior"))
{
// FIXME: improve error.
- final Message message = Message.raw("Missing newsuperior");
+ final LocalizableMessage message = LocalizableMessage.raw("Missing newsuperior");
throw DecodeException.error(message);
}
@@ -707,7 +705,7 @@
}
catch (final LocalizedIllegalArgumentException e)
{
- final Message message = ERR_LDIF_INVALID_DN.get(
+ final LocalizableMessage message = ERR_LDIF_INVALID_DN.get(
record.lineNumber, ldifLine, e.getMessageObject());
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/ldif/LDIFEntryReader.java b/sdk/src/org/opends/sdk/ldif/LDIFEntryReader.java
index d78a35f..a0a886d 100644
--- a/sdk/src/org/opends/sdk/ldif/LDIFEntryReader.java
+++ b/sdk/src/org/opends/sdk/ldif/LDIFEntryReader.java
@@ -39,8 +39,6 @@
import org.opends.sdk.*;
import org.opends.sdk.schema.Schema;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -80,7 +78,7 @@
if (entry == null)
{
// No change record found.
- Message message = WARN_READ_LDIF_RECORD_NO_CHANGE_RECORD_FOUND
+ LocalizableMessage message = WARN_READ_LDIF_RECORD_NO_CHANGE_RECORD_FOUND
.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -88,7 +86,7 @@
if (reader.readEntry() != null)
{
// Multiple change records found.
- Message message = WARN_READ_LDIF_RECORD_MULTIPLE_CHANGE_RECORDS_FOUND
+ LocalizableMessage message = WARN_READ_LDIF_RECORD_MULTIPLE_CHANGE_RECORDS_FOUND
.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -103,7 +101,7 @@
catch (IOException e)
{
// This should never happen for a String based reader.
- Message message = WARN_READ_LDIF_RECORD_UNEXPECTED_IO_ERROR.get(e
+ LocalizableMessage message = WARN_READ_LDIF_RECORD_UNEXPECTED_IO_ERROR.get(e
.getMessage());
throw new LocalizedIllegalArgumentException(message);
}
@@ -209,7 +207,7 @@
// Skip if branch containing the entry DN is excluded.
if (isBranchExcluded(entryDN))
{
- final Message message = Message
+ final LocalizableMessage message = LocalizableMessage
.raw("Skipping entry because it is in excluded branch");
skipLDIFRecord(record, message);
continue;
@@ -234,7 +232,7 @@
// Skip if the entry is excluded by any filters.
if (isEntryExcluded(entry))
{
- final Message message = Message
+ final LocalizableMessage message = LocalizableMessage
.raw("Skipping entry due to exclusing filters");
skipLDIFRecord(record, message);
continue;
diff --git a/sdk/src/org/opends/sdk/requests/AddRequest.java b/sdk/src/org/opends/sdk/requests/AddRequest.java
index 5d50d3d..14a2542 100644
--- a/sdk/src/org/opends/sdk/requests/AddRequest.java
+++ b/sdk/src/org/opends/sdk/requests/AddRequest.java
@@ -37,7 +37,6 @@
import org.opends.sdk.ldif.ChangeRecordVisitor;
import org.opends.sdk.schema.ObjectClass;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/requests/AddRequestImpl.java b/sdk/src/org/opends/sdk/requests/AddRequestImpl.java
index ad7d00d..f0367f6 100644
--- a/sdk/src/org/opends/sdk/requests/AddRequestImpl.java
+++ b/sdk/src/org/opends/sdk/requests/AddRequestImpl.java
@@ -35,7 +35,6 @@
import org.opends.sdk.ldif.ChangeRecordVisitor;
import org.opends.sdk.schema.ObjectClass;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/requests/CompareRequest.java b/sdk/src/org/opends/sdk/requests/CompareRequest.java
index 96d6b57..0fa70a1 100644
--- a/sdk/src/org/opends/sdk/requests/CompareRequest.java
+++ b/sdk/src/org/opends/sdk/requests/CompareRequest.java
@@ -32,9 +32,9 @@
import org.opends.sdk.AttributeDescription;
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
import org.opends.sdk.controls.Control;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/requests/CompareRequestImpl.java b/sdk/src/org/opends/sdk/requests/CompareRequestImpl.java
index 6fa8610..d922e8a 100644
--- a/sdk/src/org/opends/sdk/requests/CompareRequestImpl.java
+++ b/sdk/src/org/opends/sdk/requests/CompareRequestImpl.java
@@ -32,8 +32,8 @@
import org.opends.sdk.AttributeDescription;
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/requests/DeleteRequest.java b/sdk/src/org/opends/sdk/requests/DeleteRequest.java
index eeed2cb..e6821ac 100644
--- a/sdk/src/org/opends/sdk/requests/DeleteRequest.java
+++ b/sdk/src/org/opends/sdk/requests/DeleteRequest.java
@@ -30,11 +30,11 @@
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
import org.opends.sdk.controls.Control;
import org.opends.sdk.ldif.ChangeRecord;
import org.opends.sdk.ldif.ChangeRecordVisitor;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/requests/DeleteRequestImpl.java b/sdk/src/org/opends/sdk/requests/DeleteRequestImpl.java
index 7d01a74..c1d3bec 100644
--- a/sdk/src/org/opends/sdk/requests/DeleteRequestImpl.java
+++ b/sdk/src/org/opends/sdk/requests/DeleteRequestImpl.java
@@ -30,9 +30,9 @@
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
import org.opends.sdk.ldif.ChangeRecordVisitor;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/requests/GenericBindRequest.java b/sdk/src/org/opends/sdk/requests/GenericBindRequest.java
index f5f8a56..a10905e 100644
--- a/sdk/src/org/opends/sdk/requests/GenericBindRequest.java
+++ b/sdk/src/org/opends/sdk/requests/GenericBindRequest.java
@@ -31,10 +31,10 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
import org.opends.sdk.ResultCode;
import org.opends.sdk.controls.Control;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/requests/GenericBindRequestImpl.java b/sdk/src/org/opends/sdk/requests/GenericBindRequestImpl.java
index fe1b677..bbbb6ff 100644
--- a/sdk/src/org/opends/sdk/requests/GenericBindRequestImpl.java
+++ b/sdk/src/org/opends/sdk/requests/GenericBindRequestImpl.java
@@ -31,8 +31,8 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/requests/ModifyDNRequest.java b/sdk/src/org/opends/sdk/requests/ModifyDNRequest.java
index 9dbf6f1..9cc3dc0 100644
--- a/sdk/src/org/opends/sdk/requests/ModifyDNRequest.java
+++ b/sdk/src/org/opends/sdk/requests/ModifyDNRequest.java
@@ -30,12 +30,12 @@
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
import org.opends.sdk.RDN;
import org.opends.sdk.controls.Control;
import org.opends.sdk.ldif.ChangeRecord;
import org.opends.sdk.ldif.ChangeRecordVisitor;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/requests/ModifyDNRequestImpl.java b/sdk/src/org/opends/sdk/requests/ModifyDNRequestImpl.java
index 0e70e22..92d42a6 100644
--- a/sdk/src/org/opends/sdk/requests/ModifyDNRequestImpl.java
+++ b/sdk/src/org/opends/sdk/requests/ModifyDNRequestImpl.java
@@ -30,10 +30,10 @@
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
import org.opends.sdk.RDN;
import org.opends.sdk.ldif.ChangeRecordVisitor;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/requests/ModifyRequest.java b/sdk/src/org/opends/sdk/requests/ModifyRequest.java
index a7b1467..8c7fd04 100644
--- a/sdk/src/org/opends/sdk/requests/ModifyRequest.java
+++ b/sdk/src/org/opends/sdk/requests/ModifyRequest.java
@@ -29,15 +29,11 @@
-import org.opends.sdk.ByteString;
-import org.opends.sdk.Change;
-import org.opends.sdk.DN;
-import org.opends.sdk.ModificationType;
+import org.opends.sdk.*;
import org.opends.sdk.controls.Control;
import org.opends.sdk.ldif.ChangeRecord;
import org.opends.sdk.ldif.ChangeRecordVisitor;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/requests/ModifyRequestImpl.java b/sdk/src/org/opends/sdk/requests/ModifyRequestImpl.java
index 3757be5..0c9d68a 100644
--- a/sdk/src/org/opends/sdk/requests/ModifyRequestImpl.java
+++ b/sdk/src/org/opends/sdk/requests/ModifyRequestImpl.java
@@ -32,13 +32,9 @@
import java.util.LinkedList;
import java.util.List;
-import org.opends.sdk.Change;
-import org.opends.sdk.DN;
-import org.opends.sdk.LinkedAttribute;
-import org.opends.sdk.ModificationType;
+import org.opends.sdk.*;
import org.opends.sdk.ldif.ChangeRecordVisitor;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/requests/Requests.java b/sdk/src/org/opends/sdk/requests/Requests.java
index c39a863..66f9705 100644
--- a/sdk/src/org/opends/sdk/requests/Requests.java
+++ b/sdk/src/org/opends/sdk/requests/Requests.java
@@ -35,8 +35,6 @@
import org.opends.sdk.ldif.ChangeRecord;
import org.opends.sdk.ldif.LDIFChangeRecordReader;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -160,7 +158,7 @@
else
{
// Wrong change type.
- Message message = WARN_READ_LDIF_RECORD_CHANGE_RECORD_WRONG_TYPE
+ LocalizableMessage message = WARN_READ_LDIF_RECORD_CHANGE_RECORD_WRONG_TYPE
.get("add");
throw new LocalizedIllegalArgumentException(message);
}
@@ -539,7 +537,7 @@
else
{
// Wrong change type.
- Message message = WARN_READ_LDIF_RECORD_CHANGE_RECORD_WRONG_TYPE
+ LocalizableMessage message = WARN_READ_LDIF_RECORD_CHANGE_RECORD_WRONG_TYPE
.get("modify");
throw new LocalizedIllegalArgumentException(message);
}
diff --git a/sdk/src/org/opends/sdk/requests/SearchRequest.java b/sdk/src/org/opends/sdk/requests/SearchRequest.java
index ad82c99..d46618a 100644
--- a/sdk/src/org/opends/sdk/requests/SearchRequest.java
+++ b/sdk/src/org/opends/sdk/requests/SearchRequest.java
@@ -31,13 +31,9 @@
import java.util.Collection;
-import org.opends.sdk.DN;
-import org.opends.sdk.DereferenceAliasesPolicy;
-import org.opends.sdk.Filter;
-import org.opends.sdk.SearchScope;
+import org.opends.sdk.*;
import org.opends.sdk.controls.Control;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java b/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java
index 14ce602..1199fd5 100644
--- a/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java
+++ b/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java
@@ -33,12 +33,8 @@
import java.util.LinkedList;
import java.util.List;
-import org.opends.sdk.DN;
-import org.opends.sdk.DereferenceAliasesPolicy;
-import org.opends.sdk.Filter;
-import org.opends.sdk.SearchScope;
+import org.opends.sdk.*;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/requests/SimpleBindRequest.java b/sdk/src/org/opends/sdk/requests/SimpleBindRequest.java
index 48b6779..47b4072 100644
--- a/sdk/src/org/opends/sdk/requests/SimpleBindRequest.java
+++ b/sdk/src/org/opends/sdk/requests/SimpleBindRequest.java
@@ -31,9 +31,9 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
import org.opends.sdk.controls.Control;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/requests/SimpleBindRequestImpl.java b/sdk/src/org/opends/sdk/requests/SimpleBindRequestImpl.java
index a8a6f51..6b5aa32 100644
--- a/sdk/src/org/opends/sdk/requests/SimpleBindRequestImpl.java
+++ b/sdk/src/org/opends/sdk/requests/SimpleBindRequestImpl.java
@@ -31,8 +31,8 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/responses/Responses.java b/sdk/src/org/opends/sdk/responses/Responses.java
index beb6175..7d1c577 100644
--- a/sdk/src/org/opends/sdk/responses/Responses.java
+++ b/sdk/src/org/opends/sdk/responses/Responses.java
@@ -31,7 +31,6 @@
import org.opends.sdk.*;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
import com.sun.opends.sdk.util.Validator;
diff --git a/sdk/src/org/opends/sdk/responses/SearchResultEntry.java b/sdk/src/org/opends/sdk/responses/SearchResultEntry.java
index f5b5320..456ab36 100644
--- a/sdk/src/org/opends/sdk/responses/SearchResultEntry.java
+++ b/sdk/src/org/opends/sdk/responses/SearchResultEntry.java
@@ -35,7 +35,6 @@
import org.opends.sdk.controls.Control;
import org.opends.sdk.schema.ObjectClass;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/responses/SearchResultEntryImpl.java b/sdk/src/org/opends/sdk/responses/SearchResultEntryImpl.java
index 987d1b4..a10ea46 100644
--- a/sdk/src/org/opends/sdk/responses/SearchResultEntryImpl.java
+++ b/sdk/src/org/opends/sdk/responses/SearchResultEntryImpl.java
@@ -34,7 +34,6 @@
import org.opends.sdk.*;
import org.opends.sdk.schema.ObjectClass;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/sasl/AbstractSASLContext.java b/sdk/src/org/opends/sdk/sasl/AbstractSASLContext.java
index e4582bf..4f6ff7d 100644
--- a/sdk/src/org/opends/sdk/sasl/AbstractSASLContext.java
+++ b/sdk/src/org/opends/sdk/sasl/AbstractSASLContext.java
@@ -101,7 +101,7 @@
}
else
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message
@@ -141,7 +141,7 @@
void handle(AuthorizeCallback callback)
throws UnsupportedCallbackException
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message.toString());
@@ -152,7 +152,7 @@
void handle(ChoiceCallback callback)
throws UnsupportedCallbackException
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message.toString());
@@ -163,7 +163,7 @@
void handle(ConfirmationCallback callback)
throws UnsupportedCallbackException
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message.toString());
@@ -174,7 +174,7 @@
void handle(LanguageCallback callback)
throws UnsupportedCallbackException
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message.toString());
@@ -185,7 +185,7 @@
void handle(NameCallback callback)
throws UnsupportedCallbackException
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message.toString());
@@ -196,7 +196,7 @@
void handle(PasswordCallback callback)
throws UnsupportedCallbackException
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message.toString());
@@ -207,7 +207,7 @@
void handle(RealmCallback callback)
throws UnsupportedCallbackException
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message.toString());
@@ -218,7 +218,7 @@
void handle(RealmChoiceCallback callback)
throws UnsupportedCallbackException
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message.toString());
@@ -229,7 +229,7 @@
void handle(TextInputCallback callback)
throws UnsupportedCallbackException
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message.toString());
@@ -240,7 +240,7 @@
void handle(TextOutputCallback callback)
throws UnsupportedCallbackException
{
- com.sun.opends.sdk.util.Message message =
+ org.opends.sdk.LocalizableMessage message =
INFO_SASL_UNSUPPORTED_CALLBACK.get(getSASLBindRequest()
.getSASLMechanism(), String.valueOf(callback));
throw new UnsupportedCallbackException(callback, message.toString());
diff --git a/sdk/src/org/opends/sdk/sasl/GSSAPISASLBindRequest.java b/sdk/src/org/opends/sdk/sasl/GSSAPISASLBindRequest.java
index a716cc5..54184f5 100644
--- a/sdk/src/org/opends/sdk/sasl/GSSAPISASLBindRequest.java
+++ b/sdk/src/org/opends/sdk/sasl/GSSAPISASLBindRequest.java
@@ -45,8 +45,8 @@
import org.opends.sdk.ByteString;
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
import com.sun.security.auth.callback.TextCallbackHandler;
import com.sun.security.auth.module.Krb5LoginModule;
@@ -135,7 +135,7 @@
}
// This should not happen. Must be a bug.
- Message msg =
+ LocalizableMessage msg =
ERR_SASL_CONTEXT_CREATE_ERROR.get(SASL_MECHANISM_GSSAPI,
getExceptionMessage(e));
throw new SaslException(msg.toString(), e.getCause());
@@ -165,7 +165,7 @@
}
// This should not happen. Must be a bug.
- Message msg =
+ LocalizableMessage msg =
ERR_SASL_PROTOCOL_ERROR.get(SASL_MECHANISM_GSSAPI,
getExceptionMessage(e));
throw new SaslException(msg.toString(), e.getCause());
diff --git a/sdk/src/org/opends/sdk/schema/AttributeType.java b/sdk/src/org/opends/sdk/schema/AttributeType.java
index 2a78c2b..0746859 100644
--- a/sdk/src/org/opends/sdk/schema/AttributeType.java
+++ b/sdk/src/org/opends/sdk/schema/AttributeType.java
@@ -37,7 +37,8 @@
import java.util.List;
import java.util.Map;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -700,7 +701,7 @@
* {@inheritDoc}
*/
@Override
- void validate(List<Message> warnings, Schema schema)
+ void validate(List<LocalizableMessage> warnings, Schema schema)
throws SchemaException
{
if (superiorTypeOID != null)
@@ -711,7 +712,7 @@
}
catch (UnknownSchemaElementException e)
{
- final Message message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_SUPERIOR_TYPE
+ final LocalizableMessage message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_SUPERIOR_TYPE
.get(getNameOrOID(), superiorTypeOID);
throw new SchemaException(message);
}
@@ -721,7 +722,7 @@
// collective, then so must the subordinate type be collective.
if (superiorType.getUsage() != getUsage())
{
- final Message message = WARN_ATTR_SYNTAX_ATTRTYPE_INVALID_SUPERIOR_USAGE
+ final LocalizableMessage message = WARN_ATTR_SYNTAX_ATTRTYPE_INVALID_SUPERIOR_USAGE
.get(getNameOrOID(), getUsage().toString(), superiorType
.getNameOrOID());
throw new SchemaException(message);
@@ -729,7 +730,7 @@
if (superiorType.isCollective() != isCollective())
{
- Message message;
+ LocalizableMessage message;
if (isCollective())
{
message = WARN_ATTR_SYNTAX_ATTRTYPE_COLLECTIVE_FROM_NONCOLLECTIVE
@@ -752,7 +753,7 @@
// never fail since the core schema is non-strict and will
// substitute the syntax if required.
syntax = Schema.getCoreSchema().getSyntax(syntaxOID);
- final Message message = WARN_ATTR_TYPE_NOT_DEFINED.get(
+ final LocalizableMessage message = WARN_ATTR_TYPE_NOT_DEFINED.get(
getNameOrOID(), syntaxOID, syntax.toString());
warnings.add(message);
}
@@ -778,7 +779,7 @@
}
catch (UnknownSchemaElementException e)
{
- final Message message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_EQUALITY_MR
+ final LocalizableMessage message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_EQUALITY_MR
.get(getNameOrOID(), equalityMatchingRuleOID);
throw new SchemaException(message);
}
@@ -807,7 +808,7 @@
}
catch (UnknownSchemaElementException e)
{
- final Message message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_ORDERING_MR
+ final LocalizableMessage message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_ORDERING_MR
.get(getNameOrOID(), orderingMatchingRuleOID);
throw new SchemaException(message);
}
@@ -836,7 +837,7 @@
}
catch (UnknownSchemaElementException e)
{
- final Message message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_SUBSTRING_MR
+ final LocalizableMessage message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_SUBSTRING_MR
.get(getNameOrOID(), substringMatchingRuleOID);
throw new SchemaException(message);
}
@@ -865,7 +866,7 @@
}
catch (UnknownSchemaElementException e)
{
- final Message message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_APPROXIMATE_MR
+ final LocalizableMessage message = WARN_ATTR_SYNTAX_ATTRTYPE_UNKNOWN_APPROXIMATE_MR
.get(getNameOrOID(), approximateMatchingRuleOID);
throw new SchemaException(message);
}
@@ -890,7 +891,7 @@
if (isCollective()
&& getUsage() != AttributeUsage.USER_APPLICATIONS)
{
- final Message message = WARN_ATTR_SYNTAX_ATTRTYPE_COLLECTIVE_IS_OPERATIONAL
+ final LocalizableMessage message = WARN_ATTR_SYNTAX_ATTRTYPE_COLLECTIVE_IS_OPERATIONAL
.get(getNameOrOID());
warnings.add(message);
}
@@ -900,7 +901,7 @@
if (isNoUserModification()
&& getUsage() == AttributeUsage.USER_APPLICATIONS)
{
- final Message message = WARN_ATTR_SYNTAX_ATTRTYPE_NO_USER_MOD_NOT_OPERATIONAL
+ final LocalizableMessage message = WARN_ATTR_SYNTAX_ATTRTYPE_NO_USER_MOD_NOT_OPERATIONAL
.get(getNameOrOID());
warnings.add(message);
}
diff --git a/sdk/src/org/opends/sdk/schema/AttributeTypeSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/AttributeTypeSyntaxImpl.java
index 52753fd..c2e4d68 100644
--- a/sdk/src/org/opends/sdk/schema/AttributeTypeSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/AttributeTypeSyntaxImpl.java
@@ -34,9 +34,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.SubstringReader;
@@ -73,7 +73,7 @@
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
try
{
@@ -88,7 +88,7 @@
{
// This means that the definition was empty or contained only
// whitespace. That is illegal.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ATTRTYPE_EMPTY_VALUE.get();
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("AttributeTypeSyntax",
@@ -101,7 +101,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ATTRTYPE_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
final DecodeException e = DecodeException.error(message);
@@ -235,7 +235,7 @@
&& !usageStr.equalsIgnoreCase("distributedoperation")
&& !usageStr.equalsIgnoreCase("dsaoperation"))
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_ATTRTYPE_INVALID_ATTRIBUTE_USAGE.get(
String.valueOf(oid), usageStr);
final DecodeException e = DecodeException.error(message);
@@ -255,7 +255,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("AttributeTypeSyntax",
diff --git a/sdk/src/org/opends/sdk/schema/AuthPasswordSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/AuthPasswordSyntaxImpl.java
index 02b73db..17585dc 100644
--- a/sdk/src/org/opends/sdk/schema/AuthPasswordSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/AuthPasswordSyntaxImpl.java
@@ -34,9 +34,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -132,7 +132,7 @@
case '$':
break readScheme;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_AUTHPW_INVALID_SCHEME_CHAR.get(pos);
throw DecodeException.error(message);
}
@@ -141,7 +141,7 @@
// The scheme must consist of at least one character.
if (scheme.length() == 0)
{
- final Message message = ERR_ATTR_SYNTAX_AUTHPW_NO_SCHEME.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_AUTHPW_NO_SCHEME.get();
throw DecodeException.error(message);
}
@@ -158,7 +158,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_AUTHPW_NO_SCHEME_SEPARATOR.get();
throw DecodeException.error(message);
}
@@ -185,7 +185,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_AUTHPW_INVALID_AUTH_INFO_CHAR.get(pos);
throw DecodeException.error(message);
}
@@ -194,7 +194,7 @@
// The authInfo element must consist of at least one character.
if (scheme.length() == 0)
{
- final Message message = ERR_ATTR_SYNTAX_AUTHPW_NO_AUTH_INFO.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_AUTHPW_NO_AUTH_INFO.get();
throw DecodeException.error(message);
}
@@ -211,7 +211,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_AUTHPW_NO_AUTH_INFO_SEPARATOR.get();
throw DecodeException.error(message);
}
@@ -238,7 +238,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_AUTHPW_INVALID_AUTH_VALUE_CHAR.get(pos);
throw DecodeException.error(message);
}
@@ -247,7 +247,7 @@
// The authValue element must consist of at least one character.
if (scheme.length() == 0)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_AUTHPW_NO_AUTH_VALUE.get();
throw DecodeException.error(message);
}
@@ -262,7 +262,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_AUTHPW_INVALID_TRAILING_CHAR.get(pos);
throw DecodeException.error(message);
}
@@ -324,7 +324,7 @@
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
try
{
diff --git a/sdk/src/org/opends/sdk/schema/BinarySyntaxImpl.java b/sdk/src/org/opends/sdk/schema/BinarySyntaxImpl.java
index 746528a..e8a0c18 100644
--- a/sdk/src/org/opends/sdk/schema/BinarySyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/BinarySyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -89,7 +89,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// All values will be acceptable for the binary syntax.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/BitStringEqualityMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/BitStringEqualityMatchingRuleImpl.java
index 8d4149e..23293b1 100644
--- a/sdk/src/org/opends/sdk/schema/BitStringEqualityMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/BitStringEqualityMatchingRuleImpl.java
@@ -33,8 +33,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
@@ -53,7 +53,7 @@
final int length = valueString.length();
if (length < 3)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_BIT_STRING_TOO_SHORT.get(value.toString());
throw DecodeException.error(message);
}
@@ -62,7 +62,7 @@
|| valueString.charAt(length - 2) != '\''
|| valueString.charAt(length - 1) != 'B')
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_BIT_STRING_NOT_QUOTED.get(value.toString());
throw DecodeException.error(message);
}
@@ -76,7 +76,7 @@
// These characters are fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_BIT_STRING_INVALID_BIT.get(value
.toString(), String.valueOf(valueString.charAt(i)));
throw DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/BitStringSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/BitStringSyntaxImpl.java
index 7bd0639..c090990 100644
--- a/sdk/src/org/opends/sdk/schema/BitStringSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/BitStringSyntaxImpl.java
@@ -33,8 +33,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -82,7 +82,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
final String valueString = value.toString().toUpperCase();
diff --git a/sdk/src/org/opends/sdk/schema/BooleanSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/BooleanSyntaxImpl.java
index b5f5575..ed402c0 100644
--- a/sdk/src/org/opends/sdk/schema/BooleanSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/BooleanSyntaxImpl.java
@@ -33,8 +33,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -84,7 +84,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
final String valueString = value.toString().toUpperCase();
diff --git a/sdk/src/org/opends/sdk/schema/CaseExactIA5EqualityMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/CaseExactIA5EqualityMatchingRuleImpl.java
index 15a9923..a24d556 100644
--- a/sdk/src/org/opends/sdk/schema/CaseExactIA5EqualityMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/CaseExactIA5EqualityMatchingRuleImpl.java
@@ -34,8 +34,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
@@ -85,7 +85,7 @@
// 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.
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_IA5_ILLEGAL_CHARACTER.get(
value.toString(), String.valueOf(c));
throw DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/CaseExactIA5SubstringMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/CaseExactIA5SubstringMatchingRuleImpl.java
index 0dd36c4..04308b1 100644
--- a/sdk/src/org/opends/sdk/schema/CaseExactIA5SubstringMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/CaseExactIA5SubstringMatchingRuleImpl.java
@@ -34,8 +34,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
@@ -104,7 +104,7 @@
// 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.
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_IA5_ILLEGAL_CHARACTER.get(
value.toString(), String.valueOf(c));
throw DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/CaseIgnoreIA5EqualityMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/CaseIgnoreIA5EqualityMatchingRuleImpl.java
index bd0ac38..47b3c66 100644
--- a/sdk/src/org/opends/sdk/schema/CaseIgnoreIA5EqualityMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/CaseIgnoreIA5EqualityMatchingRuleImpl.java
@@ -34,8 +34,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
@@ -85,7 +85,7 @@
// 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.
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_IA5_ILLEGAL_CHARACTER.get(
value.toString(), String.valueOf(c));
throw DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/CaseIgnoreIA5SubstringMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/CaseIgnoreIA5SubstringMatchingRuleImpl.java
index 67337cc..ae52491 100644
--- a/sdk/src/org/opends/sdk/schema/CaseIgnoreIA5SubstringMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/CaseIgnoreIA5SubstringMatchingRuleImpl.java
@@ -34,8 +34,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
@@ -102,7 +102,7 @@
// 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.
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_IA5_ILLEGAL_CHARACTER.get(
value.toString(), String.valueOf(c));
throw DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/CertificateListSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/CertificateListSyntaxImpl.java
index a98212d..48734cb 100644
--- a/sdk/src/org/opends/sdk/schema/CertificateListSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/CertificateListSyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -99,7 +99,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// All values will be acceptable for the certificate list syntax.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/CertificatePairSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/CertificatePairSyntaxImpl.java
index 1eaf6da..72bb68b 100644
--- a/sdk/src/org/opends/sdk/schema/CertificatePairSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/CertificatePairSyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -98,7 +98,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// All values will be acceptable for the certificate pair syntax.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/CertificateSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/CertificateSyntaxImpl.java
index 0ec6f61..d12b271 100644
--- a/sdk/src/org/opends/sdk/schema/CertificateSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/CertificateSyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -98,7 +98,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// All values will be acceptable for the certificate syntax.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/ConflictingSchemaElementException.java b/sdk/src/org/opends/sdk/schema/ConflictingSchemaElementException.java
index 8b6acb6..c814f89 100644
--- a/sdk/src/org/opends/sdk/schema/ConflictingSchemaElementException.java
+++ b/sdk/src/org/opends/sdk/schema/ConflictingSchemaElementException.java
@@ -29,8 +29,9 @@
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizedIllegalArgumentException;
+import org.opends.sdk.LocalizableMessage;
+
@@ -51,7 +52,7 @@
* @param message
* The message that explains the problem that occurred.
*/
- public ConflictingSchemaElementException(Message message)
+ public ConflictingSchemaElementException(LocalizableMessage message)
{
super(message);
}
diff --git a/sdk/src/org/opends/sdk/schema/CoreSchemaImpl.java b/sdk/src/org/opends/sdk/schema/CoreSchemaImpl.java
index 5b19141..44aee3f 100644
--- a/sdk/src/org/opends/sdk/schema/CoreSchemaImpl.java
+++ b/sdk/src/org/opends/sdk/schema/CoreSchemaImpl.java
@@ -32,7 +32,8 @@
import java.util.*;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
@@ -73,8 +74,8 @@
// Package private so that we can check for warnings in the unit
// tests.
- static final List<Message> CORE_SCHEMA_WARNINGS =
- new LinkedList<Message>();
+ static final List<LocalizableMessage> CORE_SCHEMA_WARNINGS =
+ new LinkedList<LocalizableMessage>();
static
{
diff --git a/sdk/src/org/opends/sdk/schema/CountryStringSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/CountryStringSyntaxImpl.java
index 8c20e5b..f43840d 100644
--- a/sdk/src/org/opends/sdk/schema/CountryStringSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/CountryStringSyntaxImpl.java
@@ -34,8 +34,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -110,7 +110,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
final String stringValue = toLowerCase(value.toString());
if (stringValue.length() != 2)
diff --git a/sdk/src/org/opends/sdk/schema/DITContentRule.java b/sdk/src/org/opends/sdk/schema/DITContentRule.java
index 4c6a38d..ff44a5b 100644
--- a/sdk/src/org/opends/sdk/schema/DITContentRule.java
+++ b/sdk/src/org/opends/sdk/schema/DITContentRule.java
@@ -33,7 +33,8 @@
import java.util.*;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
import com.sun.opends.sdk.util.Validator;
@@ -459,7 +460,7 @@
@Override
- void validate(List<Message> warnings, Schema schema)
+ void validate(List<LocalizableMessage> warnings, Schema schema)
throws SchemaException
{
// Get the objectclass with the specified OID. If it does not exist
@@ -472,14 +473,14 @@
}
catch (final UnknownSchemaElementException e)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_UNKNOWN_STRUCTURAL_CLASS.get(
definition, structuralClassOID);
throw new SchemaException(message, e);
}
if (structuralClass.getObjectClassType() != ObjectClassType.STRUCTURAL)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_STRUCTURAL_CLASS_NOT_STRUCTURAL.get(
definition, structuralClass.getOID(), structuralClass
.getNameOrOID(), structuralClass
@@ -502,7 +503,7 @@
catch (final UnknownSchemaElementException e)
{
// This isn't good because it is an unknown auxiliary class.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_UNKNOWN_AUXILIARY_CLASS.get(
definition, oid);
throw new SchemaException(message, e);
@@ -510,7 +511,7 @@
if (objectClass.getObjectClassType() != ObjectClassType.AUXILIARY)
{
// This isn't good because it isn't an auxiliary class.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_AUXILIARY_CLASS_NOT_AUXILIARY.get(
definition, structuralClass.getOID(), structuralClass
.getObjectClassType().toString());
@@ -536,7 +537,7 @@
// This isn't good because it means that the DIT content rule
// requires an attribute type that we don't know anything
// about.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_UNKNOWN_REQUIRED_ATTR.get(definition,
oid);
throw new SchemaException(message, e);
@@ -561,7 +562,7 @@
// This isn't good because it means that the DIT content rule
// requires an attribute type that we don't know anything
// about.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_UNKNOWN_OPTIONAL_ATTR.get(definition,
oid);
throw new SchemaException(message, e);
@@ -586,7 +587,7 @@
// This isn't good because it means that the DIT content rule
// requires an attribute type that we don't know anything
// about.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_UNKNOWN_PROHIBITED_ATTR.get(
definition, oid);
throw new SchemaException(message, e);
@@ -601,7 +602,7 @@
{
if (structuralClass.isRequired(t))
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_PROHIBITED_REQUIRED_BY_STRUCTURAL.get(
definition, t.getNameOrOID(), structuralClass
.getNameOrOID());
@@ -612,7 +613,7 @@
{
if (oc.isRequired(t))
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_PROHIBITED_REQUIRED_BY_AUXILIARY.get(
definition, t.getNameOrOID(), oc.getNameOrOID());
throw new SchemaException(message);
diff --git a/sdk/src/org/opends/sdk/schema/DITContentRuleSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/DITContentRuleSyntaxImpl.java
index 48b38c0..2c77929 100644
--- a/sdk/src/org/opends/sdk/schema/DITContentRuleSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/DITContentRuleSyntaxImpl.java
@@ -34,9 +34,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.SubstringReader;
@@ -76,7 +76,7 @@
* {@inheritDoc}
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We'll use the decodeDITContentRule method to determine if the
// value is acceptable.
@@ -93,7 +93,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message = ERR_ATTR_SYNTAX_DCR_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_EMPTY_VALUE.get();
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("DITConentRuleSyntax",
"valueIsAcceptable", e);
@@ -105,7 +105,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
final DecodeException e = DecodeException.error(message);
@@ -182,7 +182,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("DITContentRuleSyntax",
diff --git a/sdk/src/org/opends/sdk/schema/DITStructureRule.java b/sdk/src/org/opends/sdk/schema/DITStructureRule.java
index 8788f06..5761a50 100644
--- a/sdk/src/org/opends/sdk/schema/DITStructureRule.java
+++ b/sdk/src/org/opends/sdk/schema/DITStructureRule.java
@@ -33,7 +33,8 @@
import java.util.*;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
import com.sun.opends.sdk.util.Validator;
@@ -302,7 +303,7 @@
@Override
- void validate(List<Message> warnings, Schema schema)
+ void validate(List<LocalizableMessage> warnings, Schema schema)
throws SchemaException
{
try
@@ -311,7 +312,7 @@
}
catch (final UnknownSchemaElementException e)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DSR_UNKNOWN_NAME_FORM.get(definition,
nameFormOID);
throw new SchemaException(message, e);
@@ -330,7 +331,7 @@
}
catch (final UnknownSchemaElementException e)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DSR_UNKNOWN_RULE_ID.get(definition, id);
throw new SchemaException(message, e);
}
diff --git a/sdk/src/org/opends/sdk/schema/DITStructureRuleSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/DITStructureRuleSyntaxImpl.java
index 05edf2c..5246ce6 100644
--- a/sdk/src/org/opends/sdk/schema/DITStructureRuleSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/DITStructureRuleSyntaxImpl.java
@@ -34,9 +34,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.SubstringReader;
@@ -73,7 +73,7 @@
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We'll use the decodeDITStructureRule method to determine if the
// value is acceptable.
@@ -90,7 +90,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message = ERR_ATTR_SYNTAX_DSR_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_EMPTY_VALUE.get();
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("DITStructureRuleSyntax",
"valueIsAcceptable", e);
@@ -102,7 +102,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DSR_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
final DecodeException e = DecodeException.error(message);
@@ -173,7 +173,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("DITStructureRuleSyntax",
@@ -184,7 +184,7 @@
if (nameForm == null)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DSR_NO_NAME_FORM.get(definition);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("DITStructureRuleSyntax",
diff --git a/sdk/src/org/opends/sdk/schema/DeliveryMethodSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/DeliveryMethodSyntaxImpl.java
index 1392f1b..0eb0e27 100644
--- a/sdk/src/org/opends/sdk/schema/DeliveryMethodSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/DeliveryMethodSyntaxImpl.java
@@ -37,8 +37,8 @@
import java.util.StringTokenizer;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -143,7 +143,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
final String stringValue = toLowerCase(value.toString());
final StringTokenizer tokenizer =
diff --git a/sdk/src/org/opends/sdk/schema/DirectoryStringFirstComponentEqualityMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/DirectoryStringFirstComponentEqualityMatchingRuleImpl.java
index 58005cc..1972726 100644
--- a/sdk/src/org/opends/sdk/schema/DirectoryStringFirstComponentEqualityMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/DirectoryStringFirstComponentEqualityMatchingRuleImpl.java
@@ -31,12 +31,8 @@
import static com.sun.opends.sdk.messages.Messages.*;
import static com.sun.opends.sdk.util.StringPrepProfile.*;
-import org.opends.sdk.Assertion;
-import org.opends.sdk.ByteSequence;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.DecodeException;
+import org.opends.sdk.*;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.SubstringReader;
@@ -109,7 +105,7 @@
// This means that the value was empty or contained only
// whitespace.
// That is illegal.
- final Message message = ERR_ATTR_SYNTAX_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_EMPTY_VALUE.get();
throw DecodeException.error(message);
}
@@ -119,7 +115,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_EXPECTED_OPEN_PARENTHESIS.get(definition,
(reader.pos() - 1), String.valueOf(c));
throw DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/DirectoryStringSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/DirectoryStringSyntaxImpl.java
index fbd60f0..20e67d9 100644
--- a/sdk/src/org/opends/sdk/schema/DirectoryStringSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/DirectoryStringSyntaxImpl.java
@@ -33,8 +33,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -107,7 +107,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
if (value.length() > 0
|| schema.getSchemaCompatOptions()
diff --git a/sdk/src/org/opends/sdk/schema/DistinguishedNameEqualityMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/DistinguishedNameEqualityMatchingRuleImpl.java
index ac8667d..fe252e4 100644
--- a/sdk/src/org/opends/sdk/schema/DistinguishedNameEqualityMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/DistinguishedNameEqualityMatchingRuleImpl.java
@@ -34,7 +34,6 @@
import org.opends.sdk.*;
import org.opends.sdk.RDN.AVA;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
diff --git a/sdk/src/org/opends/sdk/schema/DistinguishedNameSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/DistinguishedNameSyntaxImpl.java
index 8177bc8..d3eb04d 100644
--- a/sdk/src/org/opends/sdk/schema/DistinguishedNameSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/DistinguishedNameSyntaxImpl.java
@@ -33,9 +33,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -77,7 +77,7 @@
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
try
{
diff --git a/sdk/src/org/opends/sdk/schema/EnhancedGuideSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/EnhancedGuideSyntaxImpl.java
index 89fbe2c..9f9cd06 100644
--- a/sdk/src/org/opends/sdk/schema/EnhancedGuideSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/EnhancedGuideSyntaxImpl.java
@@ -35,8 +35,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.SubstringReader;
@@ -93,7 +93,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// Get a lowercase string version of the provided value.
final String valueStr = toLowerCase(value.toString());
diff --git a/sdk/src/org/opends/sdk/schema/EnumSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/EnumSyntaxImpl.java
index 2d7bb76..693a4cc 100644
--- a/sdk/src/org/opends/sdk/schema/EnumSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/EnumSyntaxImpl.java
@@ -39,9 +39,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.Validator;
@@ -140,14 +140,14 @@
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// The value is acceptable if it belongs to the set.
final boolean isAllowed = entries.contains(normalize(value));
if (!isAllowed)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_LDAPSYNTAX_ENUM_INVALID_VALUE.get(value
.toString(), oid);
invalidReason.append(message);
diff --git a/sdk/src/org/opends/sdk/schema/FacsimileNumberSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/FacsimileNumberSyntaxImpl.java
index d2f81ba..bda558e 100644
--- a/sdk/src/org/opends/sdk/schema/FacsimileNumberSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/FacsimileNumberSyntaxImpl.java
@@ -36,8 +36,8 @@
import java.util.HashSet;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -131,7 +131,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// Get a lowercase string representation of the value and find its
// length.
diff --git a/sdk/src/org/opends/sdk/schema/FaxSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/FaxSyntaxImpl.java
index 5fd190e..f39b962 100644
--- a/sdk/src/org/opends/sdk/schema/FaxSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/FaxSyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -91,7 +91,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// All values will be acceptable for the fax syntax.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/GeneralizedTimeSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/GeneralizedTimeSyntaxImpl.java
index c239c24..643d365 100644
--- a/sdk/src/org/opends/sdk/schema/GeneralizedTimeSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/GeneralizedTimeSyntaxImpl.java
@@ -38,9 +38,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.StaticUtils;
@@ -89,7 +89,7 @@
final int length = valueString.length();
if (length < 11)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_TOO_SHORT.get(valueString);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("GeneralizedTimeSyntax",
@@ -144,7 +144,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_YEAR.get(
valueString, String.valueOf(valueString.charAt(i)));
final DecodeException e = DecodeException.error(message);
@@ -201,7 +201,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_MONTH.get(
valueString, valueString.substring(4, 6));
final DecodeException e = DecodeException.error(message);
@@ -227,7 +227,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_MONTH.get(
valueString, valueString.substring(4, 6));
final DecodeException e = DecodeException.error(message);
@@ -237,7 +237,7 @@
}
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_MONTH.get(
valueString, valueString.substring(4, 6));
final DecodeException e = DecodeException.error(message);
@@ -296,7 +296,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_DAY.get(
valueString, valueString.substring(6, 8));
final DecodeException e = DecodeException.error(message);
@@ -351,7 +351,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_DAY.get(
valueString, valueString.substring(6, 8));
final DecodeException e = DecodeException.error(message);
@@ -406,7 +406,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_DAY.get(
valueString, valueString.substring(6, 8));
final DecodeException e = DecodeException.error(message);
@@ -429,7 +429,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_DAY.get(
valueString, valueString.substring(6, 8));
final DecodeException e = DecodeException.error(message);
@@ -440,7 +440,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_DAY.get(
valueString, valueString.substring(6, 8));
final DecodeException e = DecodeException.error(message);
@@ -499,7 +499,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_HOUR.get(
valueString, valueString.substring(8, 10));
final DecodeException e = DecodeException.error(message);
@@ -553,7 +553,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_HOUR.get(
valueString, valueString.substring(8, 10));
final DecodeException e = DecodeException.error(message);
@@ -583,7 +583,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_HOUR.get(
valueString, valueString.substring(8, 10));
final DecodeException e = DecodeException.error(message);
@@ -594,7 +594,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_HOUR.get(
valueString, valueString.substring(8, 10));
final DecodeException e = DecodeException.error(message);
@@ -621,7 +621,7 @@
// must be a digit between 0 and 9.
if (length < 13)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR.get(
valueString, String.valueOf(m1), 10);
final DecodeException e = DecodeException.error(message);
@@ -674,7 +674,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_MINUTE.get(
valueString, valueString.substring(10, 12));
final DecodeException e = DecodeException.error(message);
@@ -702,7 +702,7 @@
{
// This should only happen if the provided date wasn't legal
// (e.g., September 31).
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_ILLEGAL_TIME.get(
valueString, String.valueOf(e));
final DecodeException de = DecodeException.error(message, e);
@@ -713,7 +713,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR.get(
valueString, String.valueOf(m1), 10);
final DecodeException e = DecodeException.error(message);
@@ -742,7 +742,7 @@
// This should only happen if the provided date wasn't legal
// (e.g., September 31).
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_ILLEGAL_TIME.get(
valueString, String.valueOf(e));
final DecodeException de = DecodeException.error(message, e);
@@ -753,7 +753,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR.get(
valueString, String.valueOf(m1), 10);
final DecodeException e = DecodeException.error(message);
@@ -768,7 +768,7 @@
hour, minute, second, 3600000);
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR.get(
valueString, String.valueOf(m1), 10);
final DecodeException e = DecodeException.error(message);
@@ -795,7 +795,7 @@
// must be a digit between 0 and 9.
if (length < 15)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR.get(
valueString, String.valueOf(s1), 12);
final DecodeException e = DecodeException.error(message);
@@ -848,7 +848,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_MINUTE.get(
valueString, valueString.substring(12, 14));
final DecodeException e = DecodeException.error(message);
@@ -864,7 +864,7 @@
// must be a 0.
if (length < 15)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR.get(
valueString, String.valueOf(s1), 12);
final DecodeException e = DecodeException.error(message);
@@ -875,7 +875,7 @@
if (valueString.charAt(13) != '0')
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_SECOND.get(
valueString, valueString.substring(12, 14));
final DecodeException e = DecodeException.error(message);
@@ -905,7 +905,7 @@
// This should only happen if the provided date wasn't legal
// (e.g., September 31).
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_ILLEGAL_TIME.get(
valueString, String.valueOf(e));
final DecodeException de = DecodeException.error(message, e);
@@ -916,7 +916,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR.get(
valueString, String.valueOf(s1), 12);
final DecodeException e = DecodeException.error(message);
@@ -945,7 +945,7 @@
// This should only happen if the provided date wasn't legal
// (e.g., September 31).
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_ILLEGAL_TIME.get(
valueString, String.valueOf(e));
final DecodeException de = DecodeException.error(message, e);
@@ -956,7 +956,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR.get(
valueString, String.valueOf(s1), 12);
final DecodeException e = DecodeException.error(message);
@@ -971,7 +971,7 @@
hour, minute, second, 60000);
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR.get(
valueString, String.valueOf(s1), 12);
final DecodeException e = DecodeException.error(message);
@@ -1008,7 +1008,7 @@
{
// This should only happen if the provided date wasn't legal
// (e.g., September 31).
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_ILLEGAL_TIME.get(
valueString, String.valueOf(e));
final DecodeException de = DecodeException.error(message, e);
@@ -1019,7 +1019,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR
.get(valueString, String
.valueOf(valueString.charAt(14)), 14);
@@ -1048,7 +1048,7 @@
{
// This should only happen if the provided date wasn't legal
// (e.g., September 31).
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_ILLEGAL_TIME.get(
valueString, String.valueOf(e));
final DecodeException de = DecodeException.error(message, e);
@@ -1059,7 +1059,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR
.get(valueString, String
.valueOf(valueString.charAt(14)), 14);
@@ -1070,7 +1070,7 @@
}
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_CHAR.get(
valueString, String.valueOf(valueString.charAt(14)), 14);
final DecodeException e = DecodeException.error(message);
@@ -1150,7 +1150,7 @@
// This is only acceptable if we're at the end of the value.
if (i != value.length() - 1)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_ILLEGAL_FRACTION_CHAR
.get(value, String.valueOf(c));
final DecodeException e = DecodeException.error(message);
@@ -1168,7 +1168,7 @@
break outerLoop;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_ILLEGAL_FRACTION_CHAR
.get(value, String.valueOf(c));
final DecodeException e = DecodeException.error(message);
@@ -1180,7 +1180,7 @@
if (fractionBuffer.length() == 2)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_EMPTY_FRACTION.get(value);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("GeneralizedTimeSyntax",
@@ -1190,7 +1190,7 @@
if (timeZone == null)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_NO_TIME_ZONE_INFO
.get(value);
final DecodeException e = DecodeException.error(message);
@@ -1218,7 +1218,7 @@
// This should only happen if the provided date wasn't legal
// (e.g., September 31).
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_ILLEGAL_TIME.get(value,
String.valueOf(e));
final DecodeException de = DecodeException.error(message, e);
@@ -1250,7 +1250,7 @@
final String offSetStr = value.substring(startPos);
if (offSetStr.length() != 3 && offSetStr.length() != 5)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_OFFSET.get(value,
offSetStr);
final DecodeException e = DecodeException.error(message);
@@ -1268,7 +1268,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_OFFSET.get(value,
offSetStr);
final DecodeException e = DecodeException.error(message);
@@ -1298,7 +1298,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_OFFSET.get(value,
offSetStr);
final DecodeException e = DecodeException.error(message);
@@ -1319,7 +1319,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_OFFSET.get(value,
offSetStr);
final DecodeException e = DecodeException.error(message);
@@ -1330,7 +1330,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_OFFSET.get(value,
offSetStr);
final DecodeException e = DecodeException.error(message);
@@ -1367,7 +1367,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_OFFSET.get(
value, offSetStr);
final DecodeException e = DecodeException.error(message);
@@ -1378,7 +1378,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_GENERALIZED_TIME_INVALID_OFFSET.get(value,
offSetStr);
final DecodeException e = DecodeException.error(message);
@@ -1448,7 +1448,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
try
{
diff --git a/sdk/src/org/opends/sdk/schema/GuideSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/GuideSyntaxImpl.java
index 2fd5085..ec30ea0 100644
--- a/sdk/src/org/opends/sdk/schema/GuideSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/GuideSyntaxImpl.java
@@ -35,8 +35,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.SubstringReader;
@@ -64,7 +64,7 @@
* valid criteria, or <CODE>false</CODE> if not.
*/
static boolean criteriaIsValid(String criteria, String valueStr,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// See if the criteria starts with a '!'. If so, then just evaluate
// everything after that as a criteria.
@@ -388,7 +388,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// Get a lowercase string version of the provided value.
final String valueStr = toLowerCase(value.toString());
diff --git a/sdk/src/org/opends/sdk/schema/IA5StringSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/IA5StringSyntaxImpl.java
index 87e29bc..aba5901 100644
--- a/sdk/src/org/opends/sdk/schema/IA5StringSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/IA5StringSyntaxImpl.java
@@ -33,9 +33,9 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -108,7 +108,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We will allow any value that does not contain any non-ASCII
// characters. Empty values are acceptable as well.
@@ -119,7 +119,7 @@
if ((b & 0x7F) != b)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_IA5_ILLEGAL_CHARACTER.get(
value.toString(), String.valueOf(b));
invalidReason.append(message);
diff --git a/sdk/src/org/opends/sdk/schema/IntegerEqualityMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/IntegerEqualityMatchingRuleImpl.java
index c176c21..a44868b 100644
--- a/sdk/src/org/opends/sdk/schema/IntegerEqualityMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/IntegerEqualityMatchingRuleImpl.java
@@ -33,8 +33,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -59,7 +59,7 @@
StaticUtils.DEBUG_LOG.throwing("IntegerEqualityMatchingRule",
"normalizeAttributeValue", e);
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_ILLEGAL_INTEGER.get(value.toString());
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/schema/IntegerFirstComponentEqualityMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/IntegerFirstComponentEqualityMatchingRuleImpl.java
index 0f6dd25..413e361 100644
--- a/sdk/src/org/opends/sdk/schema/IntegerFirstComponentEqualityMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/IntegerFirstComponentEqualityMatchingRuleImpl.java
@@ -32,7 +32,6 @@
import org.opends.sdk.*;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.SubstringReader;
@@ -77,7 +76,7 @@
"IntegerFirstComponentEqualityMatchingRule", "getAssertion",
e);
- final Message message =
+ final LocalizableMessage message =
ERR_EMR_INTFIRSTCOMP_FIRST_COMPONENT_NOT_INT.get(value
.toString());
throw DecodeException.error(message);
@@ -101,7 +100,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message = ERR_ATTR_SYNTAX_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_EMPTY_VALUE.get();
throw DecodeException.error(message);
}
@@ -110,7 +109,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_EXPECTED_OPEN_PARENTHESIS.get(definition,
(reader.pos() - 1), String.valueOf(c));
throw DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/IntegerOrderingMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/IntegerOrderingMatchingRuleImpl.java
index 1f56b1a..0b5c441 100644
--- a/sdk/src/org/opends/sdk/schema/IntegerOrderingMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/IntegerOrderingMatchingRuleImpl.java
@@ -33,8 +33,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
@@ -59,7 +59,7 @@
StaticUtils.DEBUG_LOG.throwing("IntegerOrderingMatchingRule",
"normalizeAttributeValue", e);
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_ILLEGAL_INTEGER.get(value.toString());
throw DecodeException.error(message);
}
diff --git a/sdk/src/org/opends/sdk/schema/IntegerSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/IntegerSyntaxImpl.java
index 6dd658b..8fab889 100644
--- a/sdk/src/org/opends/sdk/schema/IntegerSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/IntegerSyntaxImpl.java
@@ -33,8 +33,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -98,7 +98,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
final String valueString = value.toString();
final int length = valueString.length();
diff --git a/sdk/src/org/opends/sdk/schema/JPEGSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/JPEGSyntaxImpl.java
index a532f69..c7afd9a 100644
--- a/sdk/src/org/opends/sdk/schema/JPEGSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/JPEGSyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -90,7 +90,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// All values will be acceptable for the fax syntax.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/LDAPSyntaxDescriptionSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/LDAPSyntaxDescriptionSyntaxImpl.java
index 62f7948..1fb555a 100644
--- a/sdk/src/org/opends/sdk/schema/LDAPSyntaxDescriptionSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/LDAPSyntaxDescriptionSyntaxImpl.java
@@ -37,9 +37,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.SubstringReader;
@@ -76,7 +76,7 @@
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We'll use the decodeNameForm method to determine if the value is
// acceptable.
@@ -93,7 +93,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ATTRSYNTAX_EMPTY_VALUE.get();
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("LDAPSyntaxDescriptionSyntax",
@@ -106,7 +106,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ATTRSYNTAX_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
final DecodeException e = DecodeException.error(message);
@@ -163,7 +163,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("LDAPSyntaxDescriptionSyntax",
@@ -188,7 +188,7 @@
}
catch (final Exception e)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_LDAPSYNTAX_REGEX_INVALID_PATTERN
.get(oid, pattern);
final DecodeException de =
@@ -211,7 +211,7 @@
{
if (entry.equals(values.get(j)))
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_LDAPSYNTAX_ENUM_DUPLICATE_VALUE
.get(oid, entry, j);
final DecodeException e = DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/MatchingRule.java b/sdk/src/org/opends/sdk/schema/MatchingRule.java
index e351fdf..301fc52 100644
--- a/sdk/src/org/opends/sdk/schema/MatchingRule.java
+++ b/sdk/src/org/opends/sdk/schema/MatchingRule.java
@@ -36,12 +36,8 @@
import java.util.List;
import java.util.Map;
-import org.opends.sdk.Assertion;
-import org.opends.sdk.ByteSequence;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.DecodeException;
+import org.opends.sdk.*;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.Validator;
@@ -417,7 +413,7 @@
@Override
- void validate(List<Message> warnings, Schema schema)
+ void validate(List<LocalizableMessage> warnings, Schema schema)
throws SchemaException
{
// Try finding an implementation in the core schema
@@ -433,7 +429,7 @@
if (impl == null)
{
impl = Schema.getDefaultMatchingRule().impl;
- final Message message =
+ final LocalizableMessage message =
WARN_MATCHING_RULE_NOT_IMPLEMENTED.get(oid, Schema
.getDefaultMatchingRule().getOID());
warnings.add(message);
@@ -446,7 +442,7 @@
}
catch (final UnknownSchemaElementException e)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MR_UNKNOWN_SYNTAX.get(getNameOrOID(),
syntaxOID);
throw new SchemaException(message, e);
diff --git a/sdk/src/org/opends/sdk/schema/MatchingRuleSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/MatchingRuleSyntaxImpl.java
index 7abc2f4..7bdb643 100644
--- a/sdk/src/org/opends/sdk/schema/MatchingRuleSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/MatchingRuleSyntaxImpl.java
@@ -34,9 +34,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.SubstringReader;
@@ -87,7 +87,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We'll use the decodeMatchingRule method to determine if the value
// is acceptable.
@@ -104,7 +104,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message = ERR_ATTR_SYNTAX_MR_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_MR_EMPTY_VALUE.get();
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("MatchingRuleSyntax",
"valueIsAcceptable", e);
@@ -116,7 +116,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MR_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
final DecodeException e = DecodeException.error(message);
@@ -182,7 +182,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("MatchingRuleSyntax",
@@ -194,7 +194,7 @@
// Make sure that a syntax was specified.
if (syntax == null)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MR_NO_SYNTAX.get(definition);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("MatchingRuleSyntax",
diff --git a/sdk/src/org/opends/sdk/schema/MatchingRuleUse.java b/sdk/src/org/opends/sdk/schema/MatchingRuleUse.java
index 7592a4f..7d59b2c 100644
--- a/sdk/src/org/opends/sdk/schema/MatchingRuleUse.java
+++ b/sdk/src/org/opends/sdk/schema/MatchingRuleUse.java
@@ -33,7 +33,8 @@
import java.util.*;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
import com.sun.opends.sdk.util.Validator;
@@ -333,7 +334,7 @@
@Override
- void validate(List<Message> warnings, Schema schema)
+ void validate(List<LocalizableMessage> warnings, Schema schema)
throws SchemaException
{
try
@@ -344,7 +345,7 @@
{
// This is bad because the matching rule use is associated with a
// matching rule that we don't know anything about.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MRUSE_UNKNOWN_MATCHING_RULE.get(definition,
oid);
throw new SchemaException(message, e);
@@ -360,7 +361,7 @@
}
catch (final UnknownSchemaElementException e)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MRUSE_UNKNOWN_ATTR.get(oid, attribute);
throw new SchemaException(message, e);
}
diff --git a/sdk/src/org/opends/sdk/schema/MatchingRuleUseSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/MatchingRuleUseSyntaxImpl.java
index df74407..4440012 100644
--- a/sdk/src/org/opends/sdk/schema/MatchingRuleUseSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/MatchingRuleUseSyntaxImpl.java
@@ -36,9 +36,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.SubstringReader;
@@ -89,7 +89,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We'll use the decodeAttributeType method to determine if the
// value is acceptable.
@@ -106,7 +106,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message = ERR_ATTR_SYNTAX_MRUSE_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_EMPTY_VALUE.get();
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("MatchingRuleUseSyntax",
"valueIsAcceptable", e);
@@ -118,7 +118,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MRUSE_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
final DecodeException e = DecodeException.error(message);
@@ -184,7 +184,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("MatchingRuleUseSyntax",
@@ -196,7 +196,7 @@
// Make sure that the set of attributes was defined.
if (attributes == null || attributes.size() == 0)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MRUSE_NO_ATTR.get(definition);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("MatchingRuleUseSyntax",
diff --git a/sdk/src/org/opends/sdk/schema/NameAndOptionalUIDSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/NameAndOptionalUIDSyntaxImpl.java
index 907b047..bcc80a5 100644
--- a/sdk/src/org/opends/sdk/schema/NameAndOptionalUIDSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/NameAndOptionalUIDSyntaxImpl.java
@@ -34,9 +34,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DN;
+import org.opends.sdk.LocalizedIllegalArgumentException;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -93,7 +93,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
final String valueString = value.toString().trim();
final int valueLength = valueString.length();
diff --git a/sdk/src/org/opends/sdk/schema/NameForm.java b/sdk/src/org/opends/sdk/schema/NameForm.java
index 4e55133..30d73ef 100644
--- a/sdk/src/org/opends/sdk/schema/NameForm.java
+++ b/sdk/src/org/opends/sdk/schema/NameForm.java
@@ -33,7 +33,8 @@
import java.util.*;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
import com.sun.opends.sdk.util.Validator;
@@ -375,7 +376,7 @@
@Override
- void validate(List<Message> warnings, Schema schema)
+ void validate(List<LocalizableMessage> warnings, Schema schema)
throws SchemaException
{
try
@@ -384,7 +385,7 @@
}
catch (final UnknownSchemaElementException e)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_UNKNOWN_STRUCTURAL_CLASS.get(oid,
structuralClassOID);
throw new SchemaException(message, e);
@@ -393,7 +394,7 @@
{
// This is bad because the associated structural class type is not
// structural.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_STRUCTURAL_CLASS_NOT_STRUCTURAL
.get(oid, structuralClass.getOID(), structuralClass
.getNameOrOID(), String.valueOf(structuralClass
@@ -414,7 +415,7 @@
{
// This isn't good because it means that the name form requires
// an attribute type that we don't know anything about.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_UNKNOWN_REQUIRED_ATTR.get(
this.oid, oid);
throw new SchemaException(message, e);
@@ -437,7 +438,7 @@
// This isn't good because it means that the name form
// requires an attribute type that we don't know anything
// about.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_UNKNOWN_OPTIONAL_ATTR.get(
this.oid, oid);
throw new SchemaException(message, e);
diff --git a/sdk/src/org/opends/sdk/schema/NameFormSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/NameFormSyntaxImpl.java
index e483aa3..e57f3dd 100644
--- a/sdk/src/org/opends/sdk/schema/NameFormSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/NameFormSyntaxImpl.java
@@ -36,9 +36,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.SubstringReader;
@@ -75,7 +75,7 @@
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We'll use the decodeNameForm method to determine if the value is
// acceptable.
@@ -92,7 +92,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_EMPTY_VALUE.get();
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("NameFormSyntax",
@@ -105,7 +105,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), c);
final DecodeException e = DecodeException.error(message);
@@ -181,7 +181,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("NameFormSyntax",
@@ -194,7 +194,7 @@
// it cannot be valid.
if (structuralClass == null)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_NO_STRUCTURAL_CLASS
.get(definition);
final DecodeException e = DecodeException.error(message);
@@ -205,7 +205,7 @@
if (requiredAttributes == null || requiredAttributes.size() == 0)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_NO_REQUIRED_ATTR.get(definition);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("NameFormSyntax",
diff --git a/sdk/src/org/opends/sdk/schema/NumericStringSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/NumericStringSyntaxImpl.java
index a10bc17..b1ace1c 100644
--- a/sdk/src/org/opends/sdk/schema/NumericStringSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/NumericStringSyntaxImpl.java
@@ -34,8 +34,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -100,7 +100,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
final String valueString = value.toString();
final int length = valueString.length();
diff --git a/sdk/src/org/opends/sdk/schema/OIDSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/OIDSyntaxImpl.java
index 9e29530..8a8265b 100644
--- a/sdk/src/org/opends/sdk/schema/OIDSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/OIDSyntaxImpl.java
@@ -33,8 +33,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.SubstringReader;
@@ -91,7 +91,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
try
{
diff --git a/sdk/src/org/opends/sdk/schema/ObjectClass.java b/sdk/src/org/opends/sdk/schema/ObjectClass.java
index bc8f031..15b3940 100644
--- a/sdk/src/org/opends/sdk/schema/ObjectClass.java
+++ b/sdk/src/org/opends/sdk/schema/ObjectClass.java
@@ -34,7 +34,8 @@
import java.util.*;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
import com.sun.opends.sdk.util.Validator;
@@ -591,7 +592,7 @@
@Override
- void validate(List<Message> warnings, Schema schema)
+ void validate(List<LocalizableMessage> warnings, Schema schema)
throws SchemaException
{
if (validated)
@@ -617,7 +618,7 @@
}
catch (final UnknownSchemaElementException e)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_OBJECTCLASS_UNKNOWN_SUPERIOR_CLASS.get(
oid, superClassOid);
throw new SchemaException(message, e);
@@ -633,7 +634,7 @@
// classes.
if (superiorType != ObjectClassType.ABSTRACT)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_OBJECTCLASS_INVALID_SUPERIOR_TYPE.get(
oid, objectClassType.toString(), superiorType
.toString(), superiorClass.getNameOrOID());
@@ -647,7 +648,7 @@
if (superiorType != ObjectClassType.ABSTRACT
&& superiorType != ObjectClassType.AUXILIARY)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_OBJECTCLASS_INVALID_SUPERIOR_TYPE.get(
oid, objectClassType.toString(), superiorType
.toString(), superiorClass.getNameOrOID());
@@ -661,7 +662,7 @@
if (superiorType != ObjectClassType.ABSTRACT
&& superiorType != ObjectClassType.STRUCTURAL)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_OBJECTCLASS_INVALID_SUPERIOR_TYPE.get(
oid, objectClassType.toString(), superiorType
.toString(), superiorClass.getNameOrOID());
@@ -717,7 +718,7 @@
// in the superior chain.
if (!derivesTop)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_OBJECTCLASS_STRUCTURAL_SUPERIOR_NOT_TOP
.get(oid);
throw new SchemaException(message);
@@ -755,7 +756,7 @@
// This isn't good because it means that the objectclass
// requires an attribute type that we don't know anything
// about.
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_OBJECTCLASS_UNKNOWN_REQUIRED_ATTR.get(
oid, requiredAttribute);
throw new SchemaException(message, e);
@@ -788,7 +789,7 @@
// This isn't good because it means that the objectclass
// requires an attribute type that we don't know anything
// about.
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_OBJECTCLASS_UNKNOWN_OPTIONAL_ATTR.get(
oid, optionalAttribute);
throw new SchemaException(message, e);
diff --git a/sdk/src/org/opends/sdk/schema/ObjectClassSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/ObjectClassSyntaxImpl.java
index 646eec1..6da52d3 100644
--- a/sdk/src/org/opends/sdk/schema/ObjectClassSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/ObjectClassSyntaxImpl.java
@@ -34,9 +34,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.SubstringReader;
@@ -73,7 +73,7 @@
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We'll use the decodeObjectClass method to determine if the value
// is acceptable.
@@ -90,7 +90,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_OBJECTCLASS_EMPTY_VALUE.get();
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("ObjectClassSyntax",
@@ -103,7 +103,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_OBJECTCLASS_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
final DecodeException e = DecodeException.error(message);
@@ -193,7 +193,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
final DecodeException e = DecodeException.error(message);
StaticUtils.DEBUG_LOG.throwing("ObjectClassSyntax",
diff --git a/sdk/src/org/opends/sdk/schema/ObjectIdentifierFirstComponentEqualityMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/ObjectIdentifierFirstComponentEqualityMatchingRuleImpl.java
index c03e3bf..1e25da2 100644
--- a/sdk/src/org/opends/sdk/schema/ObjectIdentifierFirstComponentEqualityMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/ObjectIdentifierFirstComponentEqualityMatchingRuleImpl.java
@@ -30,12 +30,8 @@
import static com.sun.opends.sdk.messages.Messages.*;
-import org.opends.sdk.Assertion;
-import org.opends.sdk.ByteSequence;
-import org.opends.sdk.ByteString;
-import org.opends.sdk.DecodeException;
+import org.opends.sdk.*;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.SubstringReader;
@@ -82,7 +78,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message = ERR_ATTR_SYNTAX_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_EMPTY_VALUE.get();
throw DecodeException.error(message);
}
@@ -91,7 +87,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_EXPECTED_OPEN_PARENTHESIS.get(definition,
(reader.pos() - 1), String.valueOf(c));
throw DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/OctetStringSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/OctetStringSyntaxImpl.java
index 08af743..7f22abf 100644
--- a/sdk/src/org/opends/sdk/schema/OctetStringSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/OctetStringSyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -90,7 +90,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// All values will be acceptable for the octet string syntax.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/OtherMailboxSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/OtherMailboxSyntaxImpl.java
index 6b818ff..d20f867 100644
--- a/sdk/src/org/opends/sdk/schema/OtherMailboxSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/OtherMailboxSyntaxImpl.java
@@ -33,8 +33,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -92,7 +92,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// Check to see if the provided value was null. If so, then that's
// not acceptable.
diff --git a/sdk/src/org/opends/sdk/schema/PostalAddressSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/PostalAddressSyntaxImpl.java
index b2ac842..6f215ad 100644
--- a/sdk/src/org/opends/sdk/schema/PostalAddressSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/PostalAddressSyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -92,7 +92,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We'll allow any value.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/PresentationAddressSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/PresentationAddressSyntaxImpl.java
index 0025b47..20831ed 100644
--- a/sdk/src/org/opends/sdk/schema/PresentationAddressSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/PresentationAddressSyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -106,7 +106,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We will accept any value for this syntax.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/PrintableStringSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/PrintableStringSyntaxImpl.java
index 56ec225..307e7fc 100644
--- a/sdk/src/org/opends/sdk/schema/PrintableStringSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/PrintableStringSyntaxImpl.java
@@ -33,8 +33,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -205,7 +205,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// Check to see if the provided value was null. If so, then that's
// not acceptable.
diff --git a/sdk/src/org/opends/sdk/schema/ProtocolInformationSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/ProtocolInformationSyntaxImpl.java
index 08733f1..46a2722 100644
--- a/sdk/src/org/opends/sdk/schema/ProtocolInformationSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/ProtocolInformationSyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -106,7 +106,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We will accept any value for this syntax.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/RegexSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/RegexSyntaxImpl.java
index 3b23c33..2a5007b 100644
--- a/sdk/src/org/opends/sdk/schema/RegexSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/RegexSyntaxImpl.java
@@ -35,9 +35,9 @@
import java.util.regex.Pattern;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.Validator;
@@ -109,13 +109,13 @@
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
final String strValue = value.toString();
final boolean matches = pattern.matcher(strValue).matches();
if (!matches)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_LDAPSYNTAX_REGEX_INVALID_VALUE.get(strValue,
pattern.pattern());
invalidReason.append(message);
diff --git a/sdk/src/org/opends/sdk/schema/Schema.java b/sdk/src/org/opends/sdk/schema/Schema.java
index bca449f..d045f88 100644
--- a/sdk/src/org/opends/sdk/schema/Schema.java
+++ b/sdk/src/org/opends/sdk/schema/Schema.java
@@ -38,8 +38,6 @@
import org.opends.sdk.*;
import org.opends.sdk.responses.SearchResultEntry;
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.StaticUtils;
import com.sun.opends.sdk.util.Validator;
@@ -1545,7 +1543,7 @@
* Server.
*/
public static Schema getSchema(Connection connection, String dn,
- List<Message> warnings) throws ErrorResultException,
+ List<LocalizableMessage> warnings) throws ErrorResultException,
InterruptedException, LocalizedIllegalArgumentException,
SchemaNotFoundException
{
diff --git a/sdk/src/org/opends/sdk/schema/SchemaBuilder.java b/sdk/src/org/opends/sdk/schema/SchemaBuilder.java
index 434954e..1496309 100644
--- a/sdk/src/org/opends/sdk/schema/SchemaBuilder.java
+++ b/sdk/src/org/opends/sdk/schema/SchemaBuilder.java
@@ -36,6 +36,8 @@
import java.util.regex.Pattern;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizedIllegalArgumentException;
+import org.opends.sdk.LocalizableMessage;
import com.sun.opends.sdk.util.*;
@@ -135,7 +137,7 @@
{
// This means that the definition was empty or contained only
// whitespace. That is illegal.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ATTRTYPE_EMPTY_VALUE.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -145,7 +147,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ATTRTYPE_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
throw new LocalizedIllegalArgumentException(message);
@@ -310,7 +312,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_ATTRTYPE_INVALID_ATTRIBUTE_USAGE.get(
String.valueOf(oid), usageStr);
throw new LocalizedIllegalArgumentException(message);
@@ -332,7 +334,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
throw new LocalizedIllegalArgumentException(message);
}
@@ -479,7 +481,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message = ERR_ATTR_SYNTAX_DCR_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DCR_EMPTY_VALUE.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -488,7 +490,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DCR_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
throw new LocalizedIllegalArgumentException(message);
@@ -578,7 +580,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
throw new LocalizedIllegalArgumentException(message);
}
@@ -737,7 +739,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message = ERR_ATTR_SYNTAX_DSR_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_DSR_EMPTY_VALUE.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -746,7 +748,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DSR_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
throw new LocalizedIllegalArgumentException(message);
@@ -826,7 +828,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
throw new LocalizedIllegalArgumentException(message);
}
@@ -834,7 +836,7 @@
if (nameForm == null)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_DSR_NO_NAME_FORM.get(definition);
throw new LocalizedIllegalArgumentException(message);
}
@@ -939,7 +941,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message = ERR_ATTR_SYNTAX_MR_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_MR_EMPTY_VALUE.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -948,7 +950,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MR_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
throw new LocalizedIllegalArgumentException(message);
@@ -1023,7 +1025,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1032,7 +1034,7 @@
// Make sure that a syntax was specified.
if (syntax == null)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MR_NO_SYNTAX.get(definition);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1130,7 +1132,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message = ERR_ATTR_SYNTAX_MRUSE_EMPTY_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_MRUSE_EMPTY_VALUE.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -1139,7 +1141,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MRUSE_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
throw new LocalizedIllegalArgumentException(message);
@@ -1214,7 +1216,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1223,7 +1225,7 @@
// Make sure that the set of attributes was defined.
if (attributes == null || attributes.size() == 0)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_MRUSE_NO_ATTR.get(definition);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1319,7 +1321,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_EMPTY_VALUE.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -1329,7 +1331,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), c);
throw new LocalizedIllegalArgumentException(message);
@@ -1414,7 +1416,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1424,7 +1426,7 @@
// it cannot be valid.
if (structuralClass == null)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_NO_STRUCTURAL_CLASS
.get(definition);
throw new LocalizedIllegalArgumentException(message);
@@ -1432,7 +1434,7 @@
if (requiredAttributes == null || requiredAttributes.size() == 0)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_NAME_FORM_NO_REQUIRED_ATTR.get(definition);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1535,7 +1537,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_OBJECTCLASS_EMPTY_VALUE.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -1545,7 +1547,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_OBJECTCLASS_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
throw new LocalizedIllegalArgumentException(message);
@@ -1651,7 +1653,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
throw new LocalizedIllegalArgumentException(message);
}
@@ -1915,7 +1917,7 @@
{
// This means that the value was empty or contained only
// whitespace. That is illegal.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ATTRSYNTAX_EMPTY_VALUE.get();
throw new LocalizedIllegalArgumentException(message);
}
@@ -1925,7 +1927,7 @@
final char c = reader.read();
if (c != '(')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ATTRSYNTAX_EXPECTED_OPEN_PARENTHESIS.get(
definition, (reader.pos() - 1), String.valueOf(c));
throw new LocalizedIllegalArgumentException(message);
@@ -1981,7 +1983,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_TOKEN.get(tokenName);
throw new LocalizedIllegalArgumentException(message);
}
@@ -2271,11 +2273,11 @@
* contained in this schema builder as well as the same set of
* schema compatibility options
*/
- public Schema toSchema(List<Message> errorMessages)
+ public Schema toSchema(List<LocalizableMessage> errorMessages)
{
if (errorMessages == null)
{
- errorMessages = new LinkedList<Message>();
+ errorMessages = new LinkedList<LocalizableMessage>();
}
validate(errorMessages);
@@ -2296,7 +2298,7 @@
numericOID2AttributeTypes.get(attribute.getOID());
if (!overwrite)
{
- final Message message =
+ final LocalizableMessage message =
ERR_SCHEMA_CONFLICTING_ATTRIBUTE_OID.get(attribute
.getNameOrOID(), attribute.getOID(),
conflictingAttribute.getNameOrOID());
@@ -2341,7 +2343,7 @@
numericOID2ContentRules.get(rule.getStructuralClassOID());
if (!overwrite)
{
- final Message message =
+ final LocalizableMessage message =
ERR_SCHEMA_CONFLICTING_DIT_CONTENT_RULE.get(rule
.getNameOrOID(), rule.getStructuralClassOID(),
conflictingRule.getNameOrOID());
@@ -2384,7 +2386,7 @@
conflictingRule = id2StructureRules.get(rule.getRuleID());
if (!overwrite)
{
- final Message message =
+ final LocalizableMessage message =
ERR_SCHEMA_CONFLICTING_DIT_STRUCTURE_RULE_ID.get(rule
.getNameOrRuleID(), rule.getRuleID(), conflictingRule
.getNameOrRuleID());
@@ -2427,7 +2429,7 @@
conflictingRule = numericOID2MatchingRules.get(rule.getOID());
if (!overwrite)
{
- final Message message =
+ final LocalizableMessage message =
ERR_SCHEMA_CONFLICTING_MR_OID.get(rule.getNameOrOID(), rule
.getOID(), conflictingRule.getNameOrOID());
throw new ConflictingSchemaElementException(message);
@@ -2471,7 +2473,7 @@
numericOID2MatchingRuleUses.get(use.getMatchingRuleOID());
if (!overwrite)
{
- final Message message =
+ final LocalizableMessage message =
ERR_SCHEMA_CONFLICTING_MATCHING_RULE_USE.get(use
.getNameOrOID(), use.getMatchingRuleOID(),
conflictingUse.getNameOrOID());
@@ -2514,7 +2516,7 @@
conflictingForm = numericOID2NameForms.get(form.getOID());
if (!overwrite)
{
- final Message message =
+ final LocalizableMessage message =
ERR_SCHEMA_CONFLICTING_NAME_FORM_OID.get(form
.getNameOrOID(), form.getOID(), conflictingForm
.getNameOrOID());
@@ -2556,7 +2558,7 @@
conflictingOC = numericOID2ObjectClasses.get(oc.getOID());
if (!overwrite)
{
- final Message message =
+ final LocalizableMessage message =
ERR_SCHEMA_CONFLICTING_OBJECTCLASS_OID.get(oc
.getNameOrOID(), oc.getOID(), conflictingOC
.getNameOrOID());
@@ -2599,7 +2601,7 @@
conflictingSyntax = numericOID2Syntaxes.get(syntax.getOID());
if (!overwrite)
{
- final Message message =
+ final LocalizableMessage message =
ERR_SCHEMA_CONFLICTING_SYNTAX_OID.get(syntax.toString(),
syntax.getOID(), conflictingSyntax.getOID());
throw new ConflictingSchemaElementException(message);
@@ -2826,7 +2828,7 @@
- private synchronized void validate(List<Message> warnings)
+ private synchronized void validate(List<LocalizableMessage> warnings)
{
// Verify all references in all elements
for (final Syntax syntax : numericOID2Syntaxes.values().toArray(
diff --git a/sdk/src/org/opends/sdk/schema/SchemaElement.java b/sdk/src/org/opends/sdk/schema/SchemaElement.java
index 1e3e135..a33727d 100644
--- a/sdk/src/org/opends/sdk/schema/SchemaElement.java
+++ b/sdk/src/org/opends/sdk/schema/SchemaElement.java
@@ -32,7 +32,8 @@
import java.util.List;
import java.util.Map;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableMessage;
+
import com.sun.opends.sdk.util.Validator;
@@ -180,6 +181,6 @@
- abstract void validate(List<Message> warnings, Schema schema)
+ abstract void validate(List<LocalizableMessage> warnings, Schema schema)
throws SchemaException;
}
diff --git a/sdk/src/org/opends/sdk/schema/SchemaException.java b/sdk/src/org/opends/sdk/schema/SchemaException.java
index f7fd18a..3accb1c 100644
--- a/sdk/src/org/opends/sdk/schema/SchemaException.java
+++ b/sdk/src/org/opends/sdk/schema/SchemaException.java
@@ -29,8 +29,9 @@
-import com.sun.opends.sdk.util.LocalizableException;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableException;
+import org.opends.sdk.LocalizableMessage;
+
@@ -42,7 +43,7 @@
LocalizableException
{
// The I18N message associated with this exception.
- private final Message message;
+ private final LocalizableMessage message;
@@ -52,7 +53,7 @@
* @param message
* The message that explains the problem that occurred.
*/
- public SchemaException(Message message)
+ public SchemaException(LocalizableMessage message)
{
super(String.valueOf(message));
this.message = message;
@@ -71,7 +72,7 @@
* permitted, and indicates that the cause is nonexistent or
* unknown.
*/
- public SchemaException(Message message, Throwable cause)
+ public SchemaException(LocalizableMessage message, Throwable cause)
{
super(String.valueOf(message), cause);
this.message = message;
@@ -82,7 +83,7 @@
/**
* {@inheritDoc}
*/
- public Message getMessageObject()
+ public LocalizableMessage getMessageObject()
{
return this.message;
}
diff --git a/sdk/src/org/opends/sdk/schema/SchemaNotFoundException.java b/sdk/src/org/opends/sdk/schema/SchemaNotFoundException.java
index 1adc140..44137b7 100644
--- a/sdk/src/org/opends/sdk/schema/SchemaNotFoundException.java
+++ b/sdk/src/org/opends/sdk/schema/SchemaNotFoundException.java
@@ -29,8 +29,9 @@
-import com.sun.opends.sdk.util.LocalizableException;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizableException;
+import org.opends.sdk.LocalizableMessage;
+
@@ -45,7 +46,7 @@
LocalizableException
{
// The I18N message associated with this exception.
- private final Message message;
+ private final LocalizableMessage message;
@@ -55,7 +56,7 @@
* @param message
* The message that explains the problem that occurred.
*/
- public SchemaNotFoundException(Message message)
+ public SchemaNotFoundException(LocalizableMessage message)
{
super(String.valueOf(message));
this.message = message;
@@ -75,7 +76,7 @@
* permitted, and indicates that the cause is nonexistent or
* unknown.
*/
- public SchemaNotFoundException(Message message, Throwable cause)
+ public SchemaNotFoundException(LocalizableMessage message, Throwable cause)
{
super(String.valueOf(message), cause);
this.message = message;
@@ -86,7 +87,7 @@
/**
* {@inheritDoc}
*/
- public Message getMessageObject()
+ public LocalizableMessage getMessageObject()
{
return this.message;
}
diff --git a/sdk/src/org/opends/sdk/schema/SchemaUtils.java b/sdk/src/org/opends/sdk/schema/SchemaUtils.java
index 52664ee..dc1b056 100644
--- a/sdk/src/org/opends/sdk/schema/SchemaUtils.java
+++ b/sdk/src/org/opends/sdk/schema/SchemaUtils.java
@@ -34,8 +34,8 @@
import java.util.*;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
import com.sun.opends.sdk.util.SubstringReader;
@@ -129,7 +129,7 @@
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -187,7 +187,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_CHAR_IN_STRING_OID.get(String
.valueOf(c), reader.pos() - 1);
throw DecodeException.error(message);
@@ -197,7 +197,7 @@
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -235,7 +235,7 @@
{
if (lastWasPeriod)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_OID_CONSECUTIVE_PERIODS.get(reader
.getString(), reader.pos() - 1);
throw DecodeException.error(message);
@@ -258,7 +258,7 @@
}
// This must have been an illegal character.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_OID_ILLEGAL_CHARACTER.get(reader
.getString(), reader.pos() - 1);
throw DecodeException.error(message);
@@ -272,7 +272,7 @@
if (length == 0)
{
- final Message message = ERR_ATTR_SYNTAX_OID_NO_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_OID_NO_VALUE.get();
throw DecodeException.error(message);
}
@@ -282,7 +282,7 @@
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -339,7 +339,7 @@
if (length == 0 && !isAlpha(c))
{
// This is an illegal character.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_CHAR_IN_STRING_OID.get(String
.valueOf(c), reader.pos() - 1);
throw DecodeException.error(message);
@@ -349,7 +349,7 @@
&& c != '_')
{
// This is an illegal character.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_CHAR_IN_STRING_OID.get(String
.valueOf(c), reader.pos() - 1);
throw DecodeException.error(message);
@@ -366,7 +366,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_CHAR_IN_STRING_OID.get(String
.valueOf(c), reader.pos() - 1);
throw DecodeException.error(message);
@@ -380,7 +380,7 @@
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -428,7 +428,7 @@
{
if (lastWasPeriod)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_OID_CONSECUTIVE_PERIODS.get(reader
.getString(), reader.pos() - 1);
throw DecodeException.error(message);
@@ -451,7 +451,7 @@
}
// This must have been an illegal character.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_OID_ILLEGAL_CHARACTER.get(reader
.getString(), reader.pos() - 1);
throw DecodeException.error(message);
@@ -465,7 +465,7 @@
if (length == 0)
{
- final Message message = ERR_ATTR_SYNTAX_OID_NO_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_OID_NO_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -481,7 +481,7 @@
if (length == 0 && !isAlpha(c))
{
// This is an illegal character.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_CHAR_IN_STRING_OID.get(String
.valueOf(c), reader.pos() - 1);
throw DecodeException.error(message);
@@ -491,7 +491,7 @@
&& c != '_')
{
// This is an illegal character.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_CHAR_IN_STRING_OID.get(String
.valueOf(c), reader.pos() - 1);
throw DecodeException.error(message);
@@ -502,7 +502,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_CHAR_IN_STRING_OID.get(String
.valueOf(c), reader.pos() - 1);
throw DecodeException.error(message);
@@ -524,7 +524,7 @@
{
if (!isDigit(c))
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_OID_ILLEGAL_CHARACTER.get(reader
.getString(), reader.pos() - 1);
throw DecodeException.error(message);
@@ -544,7 +544,7 @@
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -586,7 +586,7 @@
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -618,7 +618,7 @@
char c = reader.read();
if (c != '\'')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_EXPECTED_QUOTE_AT_POS.get(reader.pos() - 1,
String.valueOf(c));
throw DecodeException.error(message);
@@ -631,7 +631,7 @@
if (length == 0 && !isAlpha(c))
{
// This is an illegal character.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_CHAR_IN_STRING_OID.get(String
.valueOf(c), reader.pos() - 1);
throw DecodeException.error(message);
@@ -641,7 +641,7 @@
&& c != '.')
{
// This is an illegal character.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_ILLEGAL_CHAR_IN_STRING_OID.get(String
.valueOf(c), reader.pos() - 1);
throw DecodeException.error(message);
@@ -658,7 +658,7 @@
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -690,7 +690,7 @@
final char c = reader.read();
if (c != '\'')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_EXPECTED_QUOTE_AT_POS.get(reader.pos() - 1,
String.valueOf(c));
throw DecodeException.error(message);
@@ -711,7 +711,7 @@
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -748,7 +748,7 @@
if (length == 0)
{
- final Message message = ERR_ATTR_SYNTAX_RULE_ID_NO_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_RULE_ID_NO_VALUE.get();
throw DecodeException.error(message);
}
@@ -761,14 +761,14 @@
}
catch (final NumberFormatException e)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_RULE_ID_INVALID.get(ruleID);
throw DecodeException.error(message);
}
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -810,7 +810,7 @@
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
@@ -859,7 +859,7 @@
if (token == null && reader.remaining() > 0)
{
reader.reset();
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UNEXPECTED_CLOSE_PARENTHESIS.get(length);
throw DecodeException.error(message);
}
@@ -868,7 +868,7 @@
}
catch (final StringIndexOutOfBoundsException e)
{
- final Message message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_TRUNCATED_VALUE.get();
throw DecodeException.error(message);
}
}
diff --git a/sdk/src/org/opends/sdk/schema/SubstringAssertionSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/SubstringAssertionSyntaxImpl.java
index ad8e52c..99c8e01 100644
--- a/sdk/src/org/opends/sdk/schema/SubstringAssertionSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/SubstringAssertionSyntaxImpl.java
@@ -32,9 +32,9 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
import com.sun.opends.sdk.messages.Messages;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -101,7 +101,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// Get the string representation of the value and check its length.
// A zero-length value is acceptable. A one-length value is
diff --git a/sdk/src/org/opends/sdk/schema/SupportedAlgorithmSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/SupportedAlgorithmSyntaxImpl.java
index a42d8d0..2519568 100644
--- a/sdk/src/org/opends/sdk/schema/SupportedAlgorithmSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/SupportedAlgorithmSyntaxImpl.java
@@ -32,8 +32,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -99,7 +99,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// All values will be acceptable for the supported algorithm syntax.
return true;
diff --git a/sdk/src/org/opends/sdk/schema/Syntax.java b/sdk/src/org/opends/sdk/schema/Syntax.java
index b8e02ee..b96df7b 100644
--- a/sdk/src/org/opends/sdk/schema/Syntax.java
+++ b/sdk/src/org/opends/sdk/schema/Syntax.java
@@ -38,9 +38,9 @@
import java.util.regex.Pattern;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.Validator;
@@ -253,7 +253,7 @@
* with this syntax, or {@code false} if not.
*/
public boolean valueIsAcceptable(ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
return impl.valueIsAcceptable(schema, value, invalidReason);
}
@@ -284,7 +284,7 @@
@Override
- void validate(List<Message> warnings, Schema schema)
+ void validate(List<LocalizableMessage> warnings, Schema schema)
throws SchemaException
{
this.schema = schema;
@@ -309,13 +309,13 @@
final String value = values.next();
if (value.equals(oid))
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_CYCLIC_SUB_SYNTAX.get(oid);
throw new SchemaException(message);
}
if (!schema.hasSyntax(value))
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UNKNOWN_SUB_SYNTAX.get(oid, value);
throw new SchemaException(message);
}
@@ -342,7 +342,7 @@
}
catch (final Exception e)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_LDAPSYNTAX_REGEX_INVALID_PATTERN
.get(oid, value);
throw new SchemaException(message);
@@ -364,7 +364,7 @@
if (impl == null)
{
impl = Schema.getDefaultSyntax().impl;
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_NOT_IMPLEMENTED.get(oid, Schema
.getDefaultSyntax().getOID());
warnings.add(message);
@@ -382,7 +382,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UNKNOWN_EQUALITY_MATCHING_RULE.get(impl
.getEqualityMatchingRule(), impl.getName());
warnings.add(message);
@@ -398,7 +398,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UNKNOWN_ORDERING_MATCHING_RULE.get(impl
.getOrderingMatchingRule(), impl.getName());
warnings.add(message);
@@ -414,7 +414,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UNKNOWN_SUBSTRING_MATCHING_RULE.get(impl
.getSubstringMatchingRule(), impl.getName());
warnings.add(message);
@@ -430,7 +430,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UNKNOWN_APPROXIMATE_MATCHING_RULE.get(impl
.getApproximateMatchingRule(), impl.getName());
warnings.add(message);
diff --git a/sdk/src/org/opends/sdk/schema/SyntaxImpl.java b/sdk/src/org/opends/sdk/schema/SyntaxImpl.java
index 8b906be..65667f6 100644
--- a/sdk/src/org/opends/sdk/schema/SyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/SyntaxImpl.java
@@ -30,8 +30,8 @@
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -141,5 +141,5 @@
* with this syntax, or {@code false} if not.
*/
boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason);
+ LocalizableMessageBuilder invalidReason);
}
diff --git a/sdk/src/org/opends/sdk/schema/TelephoneNumberSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/TelephoneNumberSyntaxImpl.java
index b3ec50f..57e13ac 100644
--- a/sdk/src/org/opends/sdk/schema/TelephoneNumberSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/TelephoneNumberSyntaxImpl.java
@@ -34,9 +34,9 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -97,7 +97,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// No matter what, the value can't be empty or null.
String valueStr;
@@ -116,7 +116,7 @@
// acceptable.
if (valueStr.charAt(0) != '+')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_TELEPHONE_NO_PLUS.get(valueStr);
invalidReason.append(message);
return false;
@@ -135,7 +135,7 @@
}
else if (!isSeparator(c))
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_TELEPHONE_ILLEGAL_CHAR.get(valueStr,
String.valueOf(c), i);
invalidReason.append(message);
@@ -145,7 +145,7 @@
if (!digitSeen)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_TELEPHONE_NO_DIGITS.get(valueStr);
invalidReason.append(message);
return false;
@@ -167,7 +167,7 @@
}
// If we made it here, then we didn't find any digits.
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_TELEPHONE_NO_DIGITS.get(valueStr);
invalidReason.append(message);
return false;
diff --git a/sdk/src/org/opends/sdk/schema/TeletexTerminalIdentifierSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/TeletexTerminalIdentifierSyntaxImpl.java
index 36cf3ba..77e32fd 100644
--- a/sdk/src/org/opends/sdk/schema/TeletexTerminalIdentifierSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/TeletexTerminalIdentifierSyntaxImpl.java
@@ -35,8 +35,8 @@
import java.util.HashSet;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -130,7 +130,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// Get a lowercase string representation of the value and find its
// length.
diff --git a/sdk/src/org/opends/sdk/schema/TelexNumberSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/TelexNumberSyntaxImpl.java
index 0074134..83c1971 100644
--- a/sdk/src/org/opends/sdk/schema/TelexNumberSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/TelexNumberSyntaxImpl.java
@@ -33,8 +33,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -100,7 +100,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// Get a string representation of the value and find its length.
final String valueString = value.toString();
diff --git a/sdk/src/org/opends/sdk/schema/UTCTimeSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/UTCTimeSyntaxImpl.java
index 384a208..a95a3cc 100644
--- a/sdk/src/org/opends/sdk/schema/UTCTimeSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/UTCTimeSyntaxImpl.java
@@ -38,9 +38,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
import com.sun.opends.sdk.util.StaticUtils;
@@ -127,7 +127,7 @@
}
catch (final Exception e)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_CANNOT_PARSE.get(valueString, String
.valueOf(e));
final DecodeException de = DecodeException.error(message, e);
@@ -192,7 +192,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// Get the value as a string and verify that it is at least long
// enough for "YYYYMMDDhhmmZ", which is the shortest allowed value.
@@ -200,7 +200,7 @@
final int length = valueString.length();
if (length < 11)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_TOO_SHORT.get(valueString);
invalidReason.append(message);
return false;
@@ -225,7 +225,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_YEAR.get(valueString,
String.valueOf(valueString.charAt(i)));
invalidReason.append(message);
@@ -255,7 +255,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_MONTH.get(valueString,
valueString.substring(2, 4));
invalidReason.append(message);
@@ -272,7 +272,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_MONTH.get(valueString,
valueString.substring(2, 4));
invalidReason.append(message);
@@ -280,7 +280,7 @@
}
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_MONTH.get(valueString,
valueString.substring(2, 4));
invalidReason.append(message);
@@ -312,7 +312,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_DAY.get(valueString,
valueString.substring(4, 6));
invalidReason.append(message);
@@ -338,7 +338,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_DAY.get(valueString,
valueString.substring(4, 6));
invalidReason.append(message);
@@ -354,7 +354,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_DAY.get(valueString,
valueString.substring(4, 6));
invalidReason.append(message);
@@ -362,7 +362,7 @@
}
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_DAY.get(valueString,
valueString.substring(4, 6));
invalidReason.append(message);
@@ -393,7 +393,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_HOUR.get(valueString,
valueString.substring(6, 8));
invalidReason.append(message);
@@ -411,7 +411,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_HOUR.get(valueString,
valueString.substring(6, 8));
invalidReason.append(message);
@@ -419,7 +419,7 @@
}
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_HOUR.get(valueString,
valueString.substring(6, 8));
invalidReason.append(message);
@@ -441,7 +441,7 @@
// must be a digit between 0 and 9.
if (length < 11)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_CHAR.get(valueString,
String.valueOf(m1), 8);
invalidReason.append(message);
@@ -463,7 +463,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_MINUTE.get(valueString,
valueString.substring(8, 10));
invalidReason.append(message);
@@ -473,7 +473,7 @@
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_CHAR.get(valueString, String
.valueOf(m1), 8);
invalidReason.append(message);
@@ -497,7 +497,7 @@
// must be a digit between 0 and 9.
if (length < 13)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_CHAR.get(valueString,
String.valueOf(s1), 10);
invalidReason.append(message);
@@ -519,7 +519,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_SECOND.get(valueString,
valueString.substring(10, 12));
invalidReason.append(message);
@@ -533,7 +533,7 @@
if (length < 13)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_CHAR.get(valueString,
String.valueOf(s1), 10);
invalidReason.append(message);
@@ -542,7 +542,7 @@
if (valueString.charAt(11) != '0')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_SECOND.get(valueString,
valueString.substring(10, 12));
invalidReason.append(message);
@@ -558,7 +558,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_CHAR.get(valueString,
String.valueOf(s1), 10);
invalidReason.append(message);
@@ -575,7 +575,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_CHAR.get(valueString,
String.valueOf(s1), 10);
invalidReason.append(message);
@@ -583,7 +583,7 @@
}
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_CHAR.get(valueString, String
.valueOf(s1), 10);
invalidReason.append(message);
@@ -603,7 +603,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_CHAR.get(valueString,
String.valueOf(valueString.charAt(12)), 12);
invalidReason.append(message);
@@ -620,7 +620,7 @@
}
else
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_CHAR.get(valueString,
String.valueOf(valueString.charAt(12)), 12);
invalidReason.append(message);
@@ -628,7 +628,7 @@
}
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_CHAR.get(valueString, String
.valueOf(valueString.charAt(12)), 12);
invalidReason.append(message);
@@ -657,12 +657,12 @@
* or <CODE>false</CODE> if it is not.
*/
private boolean hasValidOffset(String value, int startPos,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
final int offsetLength = value.length() - startPos;
if (offsetLength < 2)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_TOO_SHORT.get(value);
invalidReason.append(message);
return false;
@@ -688,7 +688,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_OFFSET.get(value, value
.substring(startPos, startPos + offsetLength));
invalidReason.append(message);
@@ -705,7 +705,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_OFFSET.get(value, value
.substring(startPos, startPos + offsetLength));
invalidReason.append(message);
@@ -713,7 +713,7 @@
}
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_OFFSET.get(value, value
.substring(startPos, startPos + offsetLength));
invalidReason.append(message);
@@ -747,7 +747,7 @@
// These are all fine.
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_OFFSET.get(value, value
.substring(startPos, startPos + offsetLength));
invalidReason.append(message);
@@ -755,7 +755,7 @@
}
break;
default:
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_UTC_TIME_INVALID_OFFSET.get(value, value
.substring(startPos, startPos + offsetLength));
invalidReason.append(message);
diff --git a/sdk/src/org/opends/sdk/schema/UUIDEqualityMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/UUIDEqualityMatchingRuleImpl.java
index 842842b..028c615 100644
--- a/sdk/src/org/opends/sdk/schema/UUIDEqualityMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/UUIDEqualityMatchingRuleImpl.java
@@ -33,8 +33,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
@@ -51,7 +51,7 @@
{
if (value.length() != 36)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_UUID_INVALID_LENGTH.get(value.toString(),
value.length());
throw DecodeException.error(message);
@@ -73,7 +73,7 @@
case 23:
if (c != '-')
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_UUID_EXPECTED_DASH.get(value.toString(),
i, String.valueOf(c));
throw DecodeException.error(message);
@@ -121,7 +121,7 @@
builder.append('f');
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_UUID_EXPECTED_HEX.get(value.toString(),
i, String.valueOf(value.byteAt(i)));
throw DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/UUIDOrderingMatchingRuleImpl.java b/sdk/src/org/opends/sdk/schema/UUIDOrderingMatchingRuleImpl.java
index 0297abe..8f88590 100644
--- a/sdk/src/org/opends/sdk/schema/UUIDOrderingMatchingRuleImpl.java
+++ b/sdk/src/org/opends/sdk/schema/UUIDOrderingMatchingRuleImpl.java
@@ -33,8 +33,8 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.ByteString;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
-import com.sun.opends.sdk.util.Message;
@@ -51,7 +51,7 @@
{
if (value.length() != 36)
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_UUID_INVALID_LENGTH.get(value.toString(),
value.length());
throw DecodeException.error(message);
@@ -73,7 +73,7 @@
case 23:
if (c != '-')
{
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_UUID_EXPECTED_DASH.get(value.toString(),
i, String.valueOf(c));
throw DecodeException.error(message);
@@ -121,7 +121,7 @@
builder.append('f');
break;
default:
- final Message message =
+ final LocalizableMessage message =
WARN_ATTR_SYNTAX_UUID_EXPECTED_HEX.get(value.toString(),
i, String.valueOf(value.byteAt(i)));
throw DecodeException.error(message);
diff --git a/sdk/src/org/opends/sdk/schema/UUIDSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/UUIDSyntaxImpl.java
index 37d3dcc..bd131e0 100644
--- a/sdk/src/org/opends/sdk/schema/UUIDSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/UUIDSyntaxImpl.java
@@ -33,8 +33,8 @@
import static org.opends.sdk.schema.SchemaConstants.*;
import org.opends.sdk.ByteSequence;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -73,7 +73,7 @@
* use with this syntax, or <CODE>false</CODE> if not.
*/
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder invalidReason)
{
// We will only accept values that look like valid UUIDs. This means
// that all values must be in the form
diff --git a/sdk/src/org/opends/sdk/schema/UnknownSchemaElementException.java b/sdk/src/org/opends/sdk/schema/UnknownSchemaElementException.java
index 7b4243a..3e2db2a 100644
--- a/sdk/src/org/opends/sdk/schema/UnknownSchemaElementException.java
+++ b/sdk/src/org/opends/sdk/schema/UnknownSchemaElementException.java
@@ -29,8 +29,9 @@
-import com.sun.opends.sdk.util.LocalizedIllegalArgumentException;
-import com.sun.opends.sdk.util.Message;
+import org.opends.sdk.LocalizedIllegalArgumentException;
+import org.opends.sdk.LocalizableMessage;
+
@@ -49,7 +50,7 @@
* @param message
* The message that explains the problem that occurred.
*/
- public UnknownSchemaElementException(Message message)
+ public UnknownSchemaElementException(LocalizableMessage message)
{
super(message);
}
diff --git a/sdk/src/org/opends/sdk/schema/UserPasswordSyntaxImpl.java b/sdk/src/org/opends/sdk/schema/UserPasswordSyntaxImpl.java
index 3dfa84e2..fe470a2 100644
--- a/sdk/src/org/opends/sdk/schema/UserPasswordSyntaxImpl.java
+++ b/sdk/src/org/opends/sdk/schema/UserPasswordSyntaxImpl.java
@@ -35,9 +35,9 @@
import org.opends.sdk.ByteSequence;
import org.opends.sdk.DecodeException;
+import org.opends.sdk.LocalizableMessage;
+import org.opends.sdk.LocalizableMessageBuilder;
-import com.sun.opends.sdk.util.Message;
-import com.sun.opends.sdk.util.MessageBuilder;
@@ -73,7 +73,7 @@
// Make sure that there actually is a value to decode.
if (userPasswordValue == null || userPasswordValue.length() == 0)
{
- final Message message = ERR_ATTR_SYNTAX_USERPW_NO_VALUE.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_USERPW_NO_VALUE.get();
throw DecodeException.error(message);
}
@@ -81,7 +81,7 @@
// brace.
if (userPasswordValue.charAt(0) != '{')
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_USERPW_NO_OPENING_BRACE.get();
throw DecodeException.error(message);
}
@@ -90,7 +90,7 @@
final int closePos = userPasswordValue.indexOf('}');
if (closePos < 0)
{
- final Message message =
+ final LocalizableMessage message =
ERR_ATTR_SYNTAX_USERPW_NO_CLOSING_BRACE.get();
throw DecodeException.error(message);
}
@@ -102,7 +102,7 @@
if (schemeName.length() == 0)
{
- final Message message = ERR_ATTR_SYNTAX_USERPW_NO_SCHEME.get();
+ final LocalizableMessage message = ERR_ATTR_SYNTAX_USERPW_NO_SCHEME.get();
throw DecodeException.error(message);
}
@@ -188,7 +188,7 @@
public boolean valueIsAcceptable(Schema schema, ByteSequence value,
- MessageBuilder invalidReason)
+ LocalizableMessageBuilder 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.
--
Gitblit v1.10.0