| | |
| | | */ |
| | | package org.opends.server.backends.jeb; |
| | | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.DecodeException; |
| | | import org.opends.server.api.OrderingMatchingRule; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.Modification; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * An implementation of an Indexer for attribute ordering. |
| | | */ |
| | |
| | | * used to name an index created using this object. |
| | | * @return A string representation of this object. |
| | | */ |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return attributeType.getNameOrOID() + ".ordering"; |
| | |
| | | * |
| | | * @return A byte array comparator. |
| | | */ |
| | | @Override |
| | | public Comparator<byte[]> getComparator() |
| | | { |
| | | return orderingRule; |
| | |
| | | * @param entry The entry. |
| | | * @param keys The set into which the generated keys will be inserted. |
| | | */ |
| | | @Override |
| | | public void indexEntry(Entry entry, Set<byte[]> keys) |
| | | { |
| | | List<Attribute> attrList = |
| | |
| | | * @param newEntry The new entry contents. |
| | | * @param modifiedKeys The map into which the modified keys will be inserted. |
| | | */ |
| | | @Override |
| | | public void replaceEntry(Entry oldEntry, Entry newEntry, |
| | | Map<byte[], Boolean> modifiedKeys) |
| | | { |
| | |
| | | * @param mods The set of modifications that were applied to the entry. |
| | | * @param modifiedKeys The map into which the modified keys will be inserted. |
| | | */ |
| | | @Override |
| | | public void modifyEntry(Entry oldEntry, Entry newEntry, |
| | | List<Modification> mods, |
| | | Map<byte[], Boolean> modifiedKeys) |
| | |
| | | |
| | | keys.add(keyBytes); |
| | | } |
| | | catch (DirectoryException e) |
| | | catch (DecodeException e) |
| | | { |
| | | logger.traceException(e); |
| | | } |
| | |
| | | modifiedKeys.remove(keyBytes); |
| | | } |
| | | } |
| | | catch (DirectoryException e) |
| | | catch (DecodeException e) |
| | | { |
| | | logger.traceException(e); |
| | | } |