| | |
| | | import org.opends.server.api.SubstringMatchingRule; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.ApproximateMatchingRule; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | |
| | | { |
| | | int len = Math.min(substrLength, remain); |
| | | keyBytes = makeSubstringKey(value, i, len); |
| | | set.add(new ASN1OctetString(keyBytes)); |
| | | set.add(ByteString.wrap(keyBytes)); |
| | | } |
| | | |
| | | return set; |
| | |
| | | { |
| | | // Make a key from the normalized assertion value. |
| | | byte[] keyBytes = |
| | | equalityFilter.getAssertionValue().getNormalizedValue().value(); |
| | | equalityFilter.getAssertionValue().getNormalizedValue().toByteArray(); |
| | | DatabaseEntry key = new DatabaseEntry(keyBytes); |
| | | |
| | | if(debugBuffer != null) |
| | |
| | | OrderingMatchingRule orderingRule = |
| | | filter.getAttributeType().getOrderingMatchingRule(); |
| | | byte[] lower = orderingRule.normalizeValue( |
| | | filter.getAssertionValue().getValue()).value(); |
| | | filter.getAssertionValue().getValue()).toByteArray(); |
| | | |
| | | // Set the upper bound to 0 to search all keys greater then the lower |
| | | // bound. |
| | |
| | | OrderingMatchingRule orderingRule = |
| | | filter.getAttributeType().getOrderingMatchingRule(); |
| | | byte[] upper = orderingRule.normalizeValue( |
| | | filter.getAssertionValue().getValue()).value(); |
| | | filter.getAssertionValue().getValue()).toByteArray(); |
| | | |
| | | if(debugBuffer != null) |
| | | { |
| | |
| | | { |
| | | ByteString normValue = |
| | | matchRule.normalizeSubstring(filter.getSubInitialElement()); |
| | | byte[] normBytes = normValue.value(); |
| | | byte[] normBytes = normValue.toByteArray(); |
| | | |
| | | EntryIDSet list = matchInitialSubstring(normBytes); |
| | | results.retainAll(list); |
| | |
| | | { |
| | | // Normalize the substring according to the substring matching rule. |
| | | ByteString normValue = matchRule.normalizeSubstring(element); |
| | | byte[] normBytes = normValue.value(); |
| | | byte[] normBytes = normValue.toByteArray(); |
| | | |
| | | // Get the candidate entry IDs from the index. |
| | | EntryIDSet list = matchSubstring(normBytes); |
| | |
| | | getAttributeType().getOrderingMatchingRule(); |
| | | |
| | | // Set the lower bound for a range search. |
| | | byte[] lower = orderingRule.normalizeValue(lowerValue.getValue()).value(); |
| | | byte[] lower = |
| | | orderingRule.normalizeValue(lowerValue.getValue()).toByteArray(); |
| | | |
| | | // Set the upper bound for a range search. |
| | | byte[] upper = orderingRule.normalizeValue(upperValue.getValue()).value(); |
| | | byte[] upper = |
| | | orderingRule.normalizeValue(upperValue.getValue()).toByteArray(); |
| | | |
| | | // Read the range: lower <= keys <= upper. |
| | | return orderingIndex.readRange(lower, upper, true, true); |
| | |
| | | // Make a key from the normalized assertion value. |
| | | byte[] keyBytes = |
| | | approximateMatchingRule.normalizeValue( |
| | | approximateFilter.getAssertionValue().getValue()).value(); |
| | | approximateFilter.getAssertionValue().getValue()).toByteArray(); |
| | | DatabaseEntry key = new DatabaseEntry(keyBytes); |
| | | |
| | | if(debugBuffer != null) |