Package org.forgerock.opendj.ldap.spi
Interface Indexer
public interface Indexer
This class is registered with a Backend and it provides callbacks
for indexing attribute values. An index implementation will use
this interface to create the keys for an attribute value.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcreateKeys(Schema schema, ByteSequence value, Collection<ByteString> keys) Generates the set of index keys for an attribute.Returns an index identifier associated with this indexer.Returns a human readable representation of the key.
-
Method Details
-
getIndexID
Returns an index identifier associated with this indexer. An identifier should be selected based on the matching rule type. A unique identifier will map to a unique index database in the backend implementation. If multiple matching rules need to share the index database, the corresponding indexers should always use the same identifier.- Returns:
- index ID A String containing the ID associated with this indexer.
-
createKeys
void createKeys(Schema schema, ByteSequence value, Collection<ByteString> keys) throws DecodeException Generates the set of index keys for an attribute.- Parameters:
schema- The schema in which the associated matching rule is defined.value- The attribute value for which keys are required.keys- A collection where to add the created keys.- Throws:
DecodeException- if an error occurs while normalizing the value
-
keyToHumanReadableString
Returns a human readable representation of the key. Does a best effort conversion from an index key to a string that can be printed, as used by the diagnostic tools, which are the only users of the method. It is not necessary for the resulting string to exactly match the value it was generated from.- Parameters:
key- the byte string for the index key.- Returns:
- a human readable representation of the key
-