001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *      Copyright 2014-2015 ForgeRock AS
024 */
025package org.opends.server.backends.pluggable;
026
027import java.io.Closeable;
028
029import org.opends.server.types.DN;
030
031/**
032 * Container for a whole suffix environment which stores all entries from the
033 * subtree of the suffix' baseDN. A suffix container has a set of key-value
034 * stores a.k.a indexes. It stores entries in these key-values stores and
035 * maintain the indexes all in sync on updates.
036 */
037public interface SuffixContainer extends Closeable
038{
039
040  /**
041   * The name of the index associating normalized DNs to ids. LDAP DNs uniquely
042   * identify entries.
043   */
044  String DN2ID_INDEX_NAME = "dn2id";
045  /** The name of the index associating normalized DNs to URIs. */
046  String DN2URI_INDEX_NAME = "dn2uri";
047  /**
048   * The name of the index associating entry ids to entries. Entry ids are
049   * monotonically increasing unique longs and entries are serialized versions
050   * of LDAP entries.
051   */
052  String ID2ENTRY_INDEX_NAME = "id2entry";
053  /**
054   * The name of the index associating an entry id to the entry id set of all
055   * its children, i.e. its immediate children.
056   */
057  String ID2CHILDREN_INDEX_NAME = "id2children";
058  /**
059   * The name of the index associating an entry id to the number of immediate
060   * children below it.
061   */
062  String ID2CHILDREN_COUNT_NAME = "id2childrencount";
063  /**
064   * The name of the index associating an entry id to the entry id set of all
065   * its subordinates, i.e. the children, grand-children, grand-grand-children,
066   * ....
067   */
068  String ID2SUBTREE_INDEX_NAME = "id2subtree";
069  /** The name of the index associating normalized DNs to normalized URIs. */
070  String REFERRAL_INDEX_NAME = "referral";
071  /**
072   * The name of the index which associates indexes with their trust state, i.e.
073   * does the index needs to be rebuilt ?
074   */
075  String STATE_INDEX_NAME = "state";
076  /** The attribute used to return a search index debug string to the client. */
077  String ATTR_DEBUG_SEARCH_INDEX = "debugsearchindex";
078
079  /**
080   * Returns the baseDN that this suffix container is responsible for.
081   *
082   * @return the baseDN that this suffix container is responsible for
083   */
084  DN getBaseDN();
085}