| | |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.api.ApproximateMatchingRule; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.asn1.ASN1OctetString; |
| | | import org.opends.server.util.StaticUtils; |
| | | import org.opends.server.util.ServerConstants; |
| | | |
| | |
| | | Entry entry; |
| | | try |
| | | { |
| | | entry = JebFormat.entryFromDatabase(data.getData(), |
| | | rootContainer.getCompressedSchema()); |
| | | entry = ID2Entry.entryFromDatabase( |
| | | ByteString.wrap(data.getData()), |
| | | rootContainer.getCompressedSchema()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | DN dn; |
| | | try |
| | | { |
| | | dn = DN.decode(new ASN1OctetString(key.getData())); |
| | | dn = DN.decode(ByteString.wrap(key.getData())); |
| | | } |
| | | catch (DirectoryException e) |
| | | { |
| | |
| | | hashMap = new HashMap<ByteString, Long>(); |
| | | entryLimitMap.put(index, hashMap); |
| | | } |
| | | ByteString octetString = new ASN1OctetString(key); |
| | | ByteString octetString = ByteString.wrap(key); |
| | | Long counter = hashMap.get(octetString); |
| | | if (counter == null) |
| | | { |
| | |
| | | attrType.getOrderingMatchingRule(); |
| | | ApproximateMatchingRule approximateMatchingRule = |
| | | attrType.getApproximateMatchingRule(); |
| | | ASN1OctetString previousValue = null; |
| | | ByteString previousValue = null; |
| | | |
| | | OperationStatus status; |
| | | for (status = cursor.getFirst(key, data, LockMode.DEFAULT); |
| | |
| | | case SUBSTRING: |
| | | ArrayList<ByteString> subAnyElements = |
| | | new ArrayList<ByteString>(1); |
| | | subAnyElements.add(new ASN1OctetString(value)); |
| | | subAnyElements.add(ByteString.wrap(value)); |
| | | |
| | | sf = SearchFilter.createSubstringFilter(attrType,null, |
| | | subAnyElements,null); |
| | |
| | | // 2. Make sure the key value is greater then the previous key |
| | | // value. |
| | | assertionValue = |
| | | new AttributeValue(attrType, new ASN1OctetString(value)); |
| | | AttributeValues.create(attrType, |
| | | ByteString.wrap(value)); |
| | | |
| | | sf = SearchFilter.createEqualityFilter(attrType,assertionValue); |
| | | |
| | | if(orderingMatchingRule != null && previousValue != null) |
| | | { |
| | | ASN1OctetString thisValue = new ASN1OctetString(value); |
| | | ByteString thisValue = ByteString.wrap(value); |
| | | int order = orderingMatchingRule.compareValues(thisValue, |
| | | previousValue); |
| | | if(order > 0) |
| | |
| | | TRACER.debugError("Reversed ordering of index keys " + |
| | | "(keys dumped in the order found in database)%n" + |
| | | "Key 1:%n%s%nKey 2:%n%s", |
| | | keyDump(index, thisValue.value()), |
| | | keyDump(index,previousValue.value())); |
| | | keyDump(index, thisValue.toByteArray()), |
| | | keyDump(index,previousValue.toByteArray())); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | if(debugEnabled()) |
| | | { |
| | | TRACER.debugError("Duplicate index keys%nKey 1:%n%s%n" + |
| | | "Key2:%n%s", keyDump(index, thisValue.value()), |
| | | keyDump(index,previousValue.value())); |
| | | "Key2:%n%s", keyDump(index, thisValue.toByteArray()), |
| | | keyDump(index, |
| | | previousValue.toByteArray())); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | break; |
| | | case EQ: |
| | | assertionValue = |
| | | new AttributeValue(attrType, new ASN1OctetString(value)); |
| | | AttributeValues.create(attrType, |
| | | ByteString.wrap(value)); |
| | | |
| | | sf = SearchFilter.createEqualityFilter(attrType,assertionValue); |
| | | break; |
| | |
| | | } |
| | | else |
| | | { |
| | | ByteString normalizedValue = new ASN1OctetString(value); |
| | | ByteString normalizedValue = ByteString.wrap(value); |
| | | List<Attribute> attrs = entry.getAttribute(attrType); |
| | | if ((attrs != null) && (!attrs.isEmpty())) |
| | | { |
| | |
| | | { |
| | | for (AttributeValue value : attr) |
| | | { |
| | | byte[] normalizedBytes = value.getNormalizedValue().value(); |
| | | byte[] normalizedBytes = value.getNormalizedValue().toByteArray(); |
| | | |
| | | // Equality index. |
| | | if (equalityIndex != null) |
| | |
| | | DatabaseEntry key = new DatabaseEntry(); |
| | | for (ByteString keyBytes : keyBytesSet) |
| | | { |
| | | key.setData(keyBytes.value()); |
| | | key.setData(keyBytes.toByteArray()); |
| | | try |
| | | { |
| | | ConditionResult cr; |
| | |
| | | attr.getAttributeType().getOrderingMatchingRule(); |
| | | |
| | | normalizedBytes = |
| | | orderingRule.normalizeValue(value.getValue()).value(); |
| | | orderingRule.normalizeValue(value.getValue()).toByteArray(); |
| | | |
| | | DatabaseEntry key = new DatabaseEntry(normalizedBytes); |
| | | try |
| | |
| | | attr.getAttributeType().getApproximateMatchingRule(); |
| | | |
| | | normalizedBytes = |
| | | approximateRule.normalizeValue(value.getValue()).value(); |
| | | approximateRule.normalizeValue(value.getValue()).toByteArray(); |
| | | |
| | | DatabaseEntry key = new DatabaseEntry(normalizedBytes); |
| | | try |