From 22094368c2865dcfb6daf8366425212b721a4657 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Thu, 05 Feb 2009 17:42:14 +0000
Subject: [PATCH] Merge ASN1 branch to trunk
---
opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java b/opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java
index ec0ef9f..ad27471 100644
--- a/opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java
+++ b/opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java
@@ -45,12 +45,7 @@
import org.opends.server.config.ConfigException;
import org.opends.server.core.DirectoryServer;
import org.opends.server.loggers.debug.DebugTracer;
-import org.opends.server.protocols.asn1.ASN1OctetString;
-import org.opends.server.types.AttributeValue;
-import org.opends.server.types.ByteString;
-import org.opends.server.types.DebugLogLevel;
-import org.opends.server.types.DirectoryException;
-import org.opends.server.types.ResultCode;
+import org.opends.server.types.*;
import static org.opends.messages.SchemaMessages.*;
import static org.opends.server.loggers.ErrorLogger.*;
@@ -272,7 +267,7 @@
* @return <CODE>true</CODE> if the provided value is acceptable for use with
* this syntax, or <CODE>false</CODE> if not.
*/
- public boolean valueIsAcceptable(ByteString value,
+ public boolean valueIsAcceptable(ByteSequence value,
MessageBuilder invalidReason)
{
try
@@ -341,8 +336,8 @@
valueString = dateFormat.format(new Date(time));
}
- return new AttributeValue(new ASN1OctetString(valueString),
- new ASN1OctetString(valueString));
+ return AttributeValues.create(ByteString.valueOf(valueString),
+ ByteString.valueOf(valueString));
}
@@ -359,7 +354,7 @@
* @throws DirectoryException If the provided value cannot be parsed as a
* valid generalized time string.
*/
- public static long decodeGeneralizedTimeValue(ByteString value)
+ public static long decodeGeneralizedTimeValue(ByteSequence value)
throws DirectoryException
{
int year = 0;
@@ -372,7 +367,7 @@
// Get the value as a string and verify that it is at least long enough for
// "YYYYMMDDhhZ", which is the shortest allowed value.
- String valueString = value.stringValue().toUpperCase();
+ String valueString = value.toString().toUpperCase();
int length = valueString.length();
if (length < 11)
{
--
Gitblit v1.10.0