| | |
| | | import org.opends.server.types.*; |
| | | |
| | | import java.util.*; |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | |
| | | /** |
| | | * An implementation of an Indexer for attribute substrings. |
| | |
| | | Set<byte[]> keys) |
| | | { |
| | | if (attrList == null) return; |
| | | |
| | | for (Attribute attr : attrList) |
| | | { |
| | | if (attr.isVirtual()) |
| | | { |
| | | continue; |
| | | } |
| | | //Get the substring matching rule. |
| | | SubstringMatchingRule rule = |
| | | attr.getAttributeType().getSubstringMatchingRule(); |
| | | for (AttributeValue value : attr) |
| | | { |
| | | try |
| | | { |
| | | byte[] normalizedBytes = value.getNormalizedValue().toByteArray(); |
| | | byte[] normalizedBytes = rule.normalizeValue(value.getValue()). |
| | | toByteArray(); |
| | | |
| | | substringKeys(normalizedBytes, keys); |
| | | } |
| | |
| | | { |
| | | continue; |
| | | } |
| | | //Get the substring matching rule. |
| | | SubstringMatchingRule rule = |
| | | attr.getAttributeType().getSubstringMatchingRule(); |
| | | |
| | | for (AttributeValue value : attr) |
| | | { |
| | | try |
| | | { |
| | | byte[] normalizedBytes = value.getNormalizedValue().toByteArray(); |
| | | byte[] normalizedBytes = rule.normalizeValue(value.getValue()) |
| | | .toByteArray(); |
| | | |
| | | substringKeys(normalizedBytes, modifiedKeys, insert); |
| | | } |