From 1f6f4598cae318e881119af7a206c7c5899aff30 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 14 Mar 2014 08:25:59 +0000
Subject: [PATCH] OPENDJ-1368 (CR-3177) Remove AttributeValue
---
opendj3-server-dev/src/server/org/opends/server/schema/DirectoryStringSyntax.java | 54 +++++++++++++++++++++---------------------------------
1 files changed, 21 insertions(+), 33 deletions(-)
diff --git a/opendj3-server-dev/src/server/org/opends/server/schema/DirectoryStringSyntax.java b/opendj3-server-dev/src/server/org/opends/server/schema/DirectoryStringSyntax.java
index 76ea94c..ee53e5c 100644
--- a/opendj3-server-dev/src/server/org/opends/server/schema/DirectoryStringSyntax.java
+++ b/opendj3-server-dev/src/server/org/opends/server/schema/DirectoryStringSyntax.java
@@ -25,31 +25,25 @@
* Portions Copyright 2012-2014 ForgeRock AS
*/
package org.opends.server.schema;
-import org.forgerock.i18n.LocalizableMessage;
-import org.forgerock.i18n.slf4j.LocalizedLogger;
-
-
-
import java.util.List;
+import org.forgerock.i18n.LocalizableMessage;
+import org.forgerock.i18n.LocalizableMessageBuilder;
+import org.forgerock.i18n.slf4j.LocalizedLogger;
+import org.forgerock.opendj.config.server.ConfigException;
+import org.forgerock.opendj.ldap.ByteSequence;
+import org.forgerock.opendj.ldap.ResultCode;
import org.opends.server.admin.server.ConfigurationChangeListener;
import org.opends.server.admin.std.server.DirectoryStringAttributeSyntaxCfg;
import org.opends.server.api.ApproximateMatchingRule;
import org.opends.server.api.AttributeSyntax;
-import org.opends.server.api.AttributeValueDecoder;
import org.opends.server.api.EqualityMatchingRule;
import org.opends.server.api.OrderingMatchingRule;
import org.opends.server.api.SubstringMatchingRule;
-import org.forgerock.opendj.config.server.ConfigException;
import org.opends.server.core.DirectoryServer;
+import org.opends.server.types.ConfigChangeResult;
-
-import org.opends.server.types.*;
-import org.forgerock.opendj.ldap.ResultCode;
-import org.forgerock.opendj.ldap.ByteSequence;
import static org.opends.messages.SchemaMessages.*;
-
-import org.forgerock.i18n.LocalizableMessageBuilder;
import static org.opends.server.schema.SchemaConstants.*;
@@ -85,26 +79,6 @@
private SubstringMatchingRule defaultSubstringMatchingRule;
-
- /**
- * A {@link String} attribute value decoder for this syntax.
- */
- public static final AttributeValueDecoder<String> DECODER =
- new AttributeValueDecoder<String>()
- {
- /**
- * {@inheritDoc}
- */
- public String decode(AttributeValue value) throws DirectoryException
- {
- // Make sure that the value is valid.
- value.getNormalizedValue();
- return value.getValue().toString();
- }
- };
-
-
-
/**
* Creates a new instance of this syntax. Note that the only thing that
* should be done here is to invoke the default constructor for the
@@ -121,6 +95,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public void initializeSyntax(DirectoryStringAttributeSyntaxCfg configuration)
throws ConfigException
{
@@ -176,6 +151,7 @@
/**
* Performs any finalization that may be necessary for this attribute syntax.
*/
+ @Override
public void finalizeSyntax()
{
currentConfig.removeDirectoryStringChangeListener(this);
@@ -188,6 +164,7 @@
*
* @return The common name for this attribute syntax.
*/
+ @Override
public String getName()
{
return SYNTAX_DIRECTORY_STRING_NAME;
@@ -200,6 +177,7 @@
*
* @return The OID for this attribute syntax.
*/
+ @Override
public String getOID()
{
return SYNTAX_DIRECTORY_STRING_OID;
@@ -212,6 +190,7 @@
*
* @return A description for this attribute syntax.
*/
+ @Override
public String getDescription()
{
return SYNTAX_DIRECTORY_STRING_DESCRIPTION;
@@ -227,6 +206,7 @@
* attributes with this syntax, or <CODE>null</CODE> if equality
* matches will not be allowed for this type by default.
*/
+ @Override
public EqualityMatchingRule getEqualityMatchingRule()
{
return defaultEqualityMatchingRule;
@@ -242,6 +222,7 @@
* attributes with this syntax, or <CODE>null</CODE> if ordering
* matches will not be allowed for this type by default.
*/
+ @Override
public OrderingMatchingRule getOrderingMatchingRule()
{
return defaultOrderingMatchingRule;
@@ -257,6 +238,7 @@
* attributes with this syntax, or <CODE>null</CODE> if substring
* matches will not be allowed for this type by default.
*/
+ @Override
public SubstringMatchingRule getSubstringMatchingRule()
{
return defaultSubstringMatchingRule;
@@ -272,6 +254,7 @@
* attributes with this syntax, or <CODE>null</CODE> if approximate
* matches will not be allowed for this type by default.
*/
+ @Override
public ApproximateMatchingRule getApproximateMatchingRule()
{
return defaultApproximateMatchingRule;
@@ -291,6 +274,7 @@
* @return <CODE>true</CODE> if the provided value is acceptable for use with
* this syntax, or <CODE>false</CODE> if not.
*/
+ @Override
public boolean valueIsAcceptable(ByteSequence value,
LocalizableMessageBuilder invalidReason)
{
@@ -328,6 +312,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public boolean isConfigurationChangeAcceptable(
DirectoryStringAttributeSyntaxCfg configuration,
List<LocalizableMessage> unacceptableReasons)
@@ -341,6 +326,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public ConfigChangeResult applyConfigurationChange(
DirectoryStringAttributeSyntaxCfg configuration)
{
@@ -355,6 +341,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public boolean isBEREncodingRequired()
{
return false;
@@ -365,6 +352,7 @@
/**
* {@inheritDoc}
*/
+ @Override
public boolean isHumanReadable()
{
return true;
--
Gitblit v1.10.0