mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Fabio Pistolesi
06.40.2015 b52956de75caa2be959a4bdc768462070aa6549f
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2URI.java
@@ -62,7 +62,7 @@
import org.opends.server.util.StaticUtils;
/**
 * This class represents the referral database which contains URIs from referral
 * This class represents the referral tree which contains URIs from referral
 * entries.
 * <p>
 * The key is the DN of the referral entry and the value is that of a pair
@@ -70,10 +70,10 @@
 * duplicated in the value because the key is suitable for comparisons but is
 * not reversible to a valid DN. Duplicate keys are permitted since a referral
 * entry can contain multiple values of the ref attribute. Key order is the same
 * as in the DN database so that all referrals in a subtree can be retrieved by
 * cursoring through a range of the records.
 * as in dn2id so that all referrals in a subtree can be retrieved by cursoring
 * through a range of the records.
 */
class DN2URI extends AbstractDatabaseContainer
class DN2URI extends AbstractTree
{
  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
@@ -88,7 +88,7 @@
  /**
   * A flag that indicates whether there are any referrals contained in this
   * database.  It should only be set to {@code false} when it is known that
   * tree.  It should only be set to {@code false} when it is known that
   * there are no referrals.
   */
  private volatile ConditionResult containsReferrals =
@@ -96,15 +96,15 @@
  /**
   * Create a new object representing a referral database in a given
   * Create a new object representing a referral tree in a given
   * entryContainer.
   *
   * @param treeName
   *          The name of the referral database.
   *          The name of the referral tree.
   * @param entryContainer
   *          The entryContainer of the DN database.
   *          The entryContainer of the DN tree.
   * @throws StorageRuntimeException
   *           If an error occurs in the database.
   *           If an error occurs in the storage.
   */
  DN2URI(TreeName treeName, EntryContainer entryContainer) throws StorageRuntimeException
  {
@@ -160,12 +160,12 @@
  }
  /**
   * Puts a URI value in the referral database.
   * Puts a URI value in the referral tree.
   *
   * @param txn a non null database transaction
   * @param txn a non null transaction
   * @param dn The DN of the referral entry.
   * @param labeledURIs The labeled URI value of the ref attribute.
   * @throws StorageRuntimeException If an error occurs in the database.
   * @throws StorageRuntimeException If an error occurs in the storage.
   */
  private void put(final WriteableTransaction txn, final DN dn, final Collection<String> labeledURIs)
      throws StorageRuntimeException
@@ -196,13 +196,13 @@
  }
  /**
   * Delete URI values for a given referral entry from the referral database.
   * Delete URI values for a given referral entry from the referral tree.
   *
   * @param txn a non null database transaction
   * @param txn a non null transaction
   * @param dn The DN of the referral entry for which URI values are to be
   * deleted.
   * @return true if the values were deleted, false if not.
   * @throws StorageRuntimeException If an error occurs in the database.
   * @throws StorageRuntimeException If an error occurs in the storage.
   */
  private boolean delete(WriteableTransaction txn, DN dn) throws StorageRuntimeException
  {
@@ -217,11 +217,11 @@
  }
  /**
   * Delete a single URI value from the referral database.
   * @param txn a non null database transaction
   * Delete a single URI value from the referral tree.
   * @param txn a non null transaction
   * @param dn The DN of the referral entry.
   * @param labeledURIs The URI value to be deleted.
   * @throws StorageRuntimeException If an error occurs in the database.
   * @throws StorageRuntimeException If an error occurs in the storage.
   */
  private void delete(final WriteableTransaction txn, final DN dn, final Collection<String> labeledURIs)
      throws StorageRuntimeException
@@ -248,10 +248,10 @@
  }
  /**
   * Indicates whether the underlying database contains any referrals.
   * Indicates whether the underlying tree contains any referrals.
   *
   * @param  txn  The transaction to use when making the determination.
   * @return  {@code true} if it is believed that the underlying database may
   * @return  {@code true} if it is believed that the underlying tree may
   *          contain at least one referral, or {@code false} if it is certain
   *          that it doesn't.
   */
@@ -275,15 +275,15 @@
  }
  /**
   * Update the referral database for an entry that has been modified.  Does
   * Update the referral tree for an entry that has been modified.  Does
   * not do anything unless the entry before the modification or the entry after
   * the modification is a referral entry.
   *
   * @param txn a non null database transaction
   * @param txn a non null transaction
   * @param before The entry before the modifications have been applied.
   * @param after The entry after the modifications have been applied.
   * @param mods The sequence of modifications made to the entry.
   * @throws StorageRuntimeException If an error occurs in the database.
   * @throws StorageRuntimeException If an error occurs in the storage.
   */
  void modifyEntry(WriteableTransaction txn, Entry before, Entry after, List<Modification> mods)
      throws StorageRuntimeException
@@ -343,19 +343,19 @@
  }
  /**
   * Update the referral database for an entry that has been replaced. Does not
   * Update the referral tree for an entry that has been replaced. Does not
   * do anything unless the entry before it was replaced or the entry after it
   * was replaced is a referral entry.
   *
   * @param txn
   *          A database transaction used for the update, or null if none is
   *          A transaction used for the update, or null if none is
   *          required.
   * @param before
   *          The entry before it was replaced.
   * @param after
   *          The entry after it was replaced.
   * @throws StorageRuntimeException
   *           If an error occurs in the database.
   *           If an error occurs in the storage.
   */
  void replaceEntry(WriteableTransaction txn, Entry before, Entry after)
       throws StorageRuntimeException
@@ -365,11 +365,11 @@
  }
  /**
   * Update the referral database for a new entry. Does nothing if the entry
   * Update the referral tree for a new entry. Does nothing if the entry
   * is not a referral entry.
   * @param txn a non null database transaction
   * @param txn a non null transaction
   * @param entry The entry to be added.
   * @throws StorageRuntimeException If an error occurs in the database.
   * @throws StorageRuntimeException If an error occurs in the storage.
   */
  void addEntry(WriteableTransaction txn, Entry entry)
       throws StorageRuntimeException
@@ -382,11 +382,11 @@
  }
  /**
   * Update the referral database for a deleted entry. Does nothing if the entry
   * Update the referral tree for a deleted entry. Does nothing if the entry
   * was not a referral entry.
   * @param txn a non null database transaction
   * @param txn a non null transaction
   * @param entry The entry to be deleted.
   * @throws StorageRuntimeException If an error occurs in the database.
   * @throws StorageRuntimeException If an error occurs in the storage.
   */
  void deleteEntry(WriteableTransaction txn, Entry entry) throws StorageRuntimeException
  {
@@ -501,7 +501,7 @@
  /**
   * Process referral entries that are above the target DN of an operation.
   * @param txn a non null database transaction
   * @param txn a non null transaction
   * @param targetDN The target DN of the operation, or the base object of a
   * search operation.
   * @param searchScope The scope of the search operation, or null if the
@@ -558,8 +558,8 @@
  /**
   * Return search result references for a search operation using the referral
   * database to find all referral entries within scope of the search.
   * @param txn a non null database transaction
   * tree to find all referral entries within scope of the search.
   * @param txn a non null transaction
   * @param searchOp The search operation for which search result references
   * should be returned.
   * @return  <CODE>true</CODE> if the caller should continue processing the