From 333c7b4a76e819dec8d2b46a381e323266a16059 Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Thu, 03 Apr 2014 13:53:49 +0000
Subject: [PATCH] Checkpoint commit for OPENDJ-1308 Migrate schema support
---
opendj3-server-dev/src/server/org/opends/server/api/ApproximateMatchingRule.java | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/opendj3-server-dev/src/server/org/opends/server/api/ApproximateMatchingRule.java b/opendj3-server-dev/src/server/org/opends/server/api/ApproximateMatchingRule.java
index 1c530a3..93e114e 100644
--- a/opendj3-server-dev/src/server/org/opends/server/api/ApproximateMatchingRule.java
+++ b/opendj3-server-dev/src/server/org/opends/server/api/ApproximateMatchingRule.java
@@ -26,8 +26,12 @@
*/
package org.opends.server.api;
+import org.forgerock.opendj.ldap.Assertion;
import org.forgerock.opendj.ldap.ByteSequence;
+import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ConditionResult;
+import org.forgerock.opendj.ldap.DecodeException;
+import org.forgerock.opendj.ldap.spi.IndexQueryFactory;
/**
* This class defines the set of methods and structures that must be
@@ -86,5 +90,29 @@
return ConditionResult.valueOf(
approximatelyMatch(attributeValue, assertionValue));
}
+
+ /** {@inheritDoc} */
+ @Override
+ public Assertion getAssertion(ByteSequence assertionValue) throws DecodeException
+ {
+ final ByteString normAssertionValue = normalizeAttributeValue(assertionValue);
+ final DefaultAssertion approxAssertion = DefaultAssertion.approximate(normAssertionValue);
+ return new Assertion()
+ {
+ @Override
+ public ConditionResult matches(ByteSequence normalizedAttributeValue)
+ {
+ return valuesMatch(normalizedAttributeValue, normAssertionValue);
+ }
+
+ @Override
+ public <T> T createIndexQuery(IndexQueryFactory<T> factory)
+ throws DecodeException
+ {
+ return approxAssertion.createIndexQuery(factory);
+ }
+ };
+ }
+
}
--
Gitblit v1.10.0