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