cf318da46ef082557ca9fb3fd19268c80e8dfc2csin/*
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * CDDL HEADER START
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin *
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * The contents of this file are subject to the terms of the
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * Common Development and Distribution License, Version 1.0 only
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * (the "License"). You may not use this file except in compliance
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * with the License.
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin *
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * or http://forgerock.org/license/CDDLv1.0.html.
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * See the License for the specific language governing permissions
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * and limitations under the License.
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin *
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * When distributing Covered Code, include this CDDL HEADER in each
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * file and include the License file at legal-notices/CDDLv1_0.txt.
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * If applicable, add the following below this CDDL HEADER, with the
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * fields enclosed by brackets "[]" replaced with your own identifying
8cf870d281dc8c242f083d14dfef05f24aa5fceeJnRouvignac * information:
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * Portions Copyright [yyyy] [name of copyright owner]
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin *
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * CDDL HEADER END
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin *
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin *
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * Copyright 2009 Sun Microsystems, Inc.
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin */
cf318da46ef082557ca9fb3fd19268c80e8dfc2csinpackage org.opends.server.api;
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
cf318da46ef082557ca9fb3fd19268c80e8dfc2csinimport java.util.Map;
cf318da46ef082557ca9fb3fd19268c80e8dfc2csinimport java.util.Set;
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
cf318da46ef082557ca9fb3fd19268c80e8dfc2csinimport org.opends.server.types.AttributeValue;
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin/**
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * This class is registered with a Backend and it provides call- backs
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * for indexing attribute values. An index implementation will use
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * this interface to create the keys for an attribute value.
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin */
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin@org.opends.server.types.PublicAPI(
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift stability = org.opends.server.types.StabilityLevel.VOLATILE,
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift mayInstantiate = false,
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift mayExtend = true,
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift mayInvoke = false)
cf318da46ef082557ca9fb3fd19268c80e8dfc2csinpublic abstract class ExtensibleIndexer
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin{
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin /**
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * Returns the index name preferred by this indexer. This name
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * appended with the identifier returned from
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * {@link #getExtensibleIndexID()} will be used as the index
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * database name.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift *
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * @return The name of the index for this indexer.
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin */
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin public abstract String getPreferredIndexName();
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin /**
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * Returns an index identifier associated with this indexer. An
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * identifier should be selected based on the matching rule type. A
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * unique identifier will map to a unique index database in the
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * backend implementation. If multiple matching rules need to share
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * the index database, the corresponding indexers should always use
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * the same identifier.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift *
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * @return index ID A String containing the ID associated with this
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * indexer.
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin */
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin public abstract String getExtensibleIndexID();
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin /**
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * Generates the set of index keys for an attribute.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift *
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * @param value
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * The attribute value for which keys are required.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * @param keys
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * The set into which the generated keys will be inserted.
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin */
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin public abstract void getKeys(AttributeValue value,
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift Set<byte[]> keys);
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin /**
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * Generates a map of index keys and a boolean flag indicating
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin * whether the corresponding key will be inserted or deleted.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift *
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * @param value
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * The attribute for which keys are required.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * @param modifiedKeys
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * A map containing the keys and a boolean. Keys
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * corresponding to the boolean value <code>true
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * </code>
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * should be inserted and <code>false</code> should be
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * deleted.
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * @param insert
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * <code>true</code> if generated keys should be inserted
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift * or <code>false</code> otherwise.
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin */
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin public abstract void getKeys(AttributeValue value,
7185b49f58c4cdb16d035ecc45e38ec9b1cd9bd0matthew_swift Map<byte[], Boolean> modifiedKeys, Boolean insert);
cf318da46ef082557ca9fb3fd19268c80e8dfc2csin}