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

Jean-Noel Rouvignac
26.25.2015 664be7d7d84b5c78001d984bd4ab51caa5273b80
Renamed ReadableStorage and WriteableStorage to ReadableTransaction and WriteableTransaction.
Code review: Matthew Swift
2 files renamed
24 files modified
485 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java 30 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2URI.java 24 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DatabaseContainer.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java 87 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ExportJob.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Entry.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Importer.java 86 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java 24 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexBuffer.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexFilter.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexQueryFactoryImpl.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/JECompressedSchema.java 8 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/NullIndex.java 22 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/RootContainer.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/State.java 10 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Suffix.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/TracedStorage.java 28 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java 26 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java 40 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/ReadOperation.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/ReadableTransaction.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/Storage.java 6 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/WriteOperation.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/WriteableTransaction.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
@@ -52,7 +52,7 @@
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.WriteOperation;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.*;
import org.opends.server.util.StaticUtils;
@@ -134,7 +134,7 @@
   * @param txn The database transaction
   * @throws ConfigException if a configuration related error occurs.
   */
  AttributeIndex(BackendIndexCfg indexConfig, EntryContainer entryContainer, WriteableStorage txn)
  AttributeIndex(BackendIndexCfg indexConfig, EntryContainer entryContainer, WriteableTransaction txn)
      throws ConfigException
  {
    this.entryContainer = entryContainer;
@@ -151,7 +151,7 @@
    extensibleIndexesMapping = computeExtensibleIndexesMapping();
  }
  private void buildPresenceIndex(WriteableStorage txn)
  private void buildPresenceIndex(WriteableTransaction txn)
  {
    final IndexType indexType = IndexType.PRESENCE;
    if (indexConfig.getIndexType().contains(indexType))
@@ -161,7 +161,7 @@
    }
  }
  private Index newPresenceIndex(WriteableStorage txn, BackendIndexCfg cfg)
  private Index newPresenceIndex(WriteableTransaction txn, BackendIndexCfg cfg)
  {
    final AttributeType attrType = cfg.getAttribute();
    final TreeName indexName = getIndexName(attrType, IndexType.PRESENCE.toString());
@@ -169,7 +169,7 @@
    return entryContainer.newIndexForAttribute(txn, indexName, indexer, cfg.getIndexEntryLimit());
  }
  private void buildExtensibleIndexes(WriteableStorage txn) throws ConfigException
  private void buildExtensibleIndexes(WriteableTransaction txn) throws ConfigException
  {
    final IndexType indexType = IndexType.EXTENSIBLE;
    if (indexConfig.getIndexType().contains(indexType))
@@ -206,7 +206,7 @@
    }
  }
  private void buildIndexes(WriteableStorage txn, IndexType indexType) throws ConfigException
  private void buildIndexes(WriteableTransaction txn, IndexType indexType) throws ConfigException
  {
    if (indexConfig.getIndexType().contains(indexType))
    {
@@ -242,7 +242,7 @@
    }
  }
  private Index newAttributeIndex(WriteableStorage txn, BackendIndexCfg indexConfig,
  private Index newAttributeIndex(WriteableTransaction txn, BackendIndexCfg indexConfig,
      org.forgerock.opendj.ldap.spi.Indexer indexer)
  {
    final AttributeType attrType = indexConfig.getAttribute();
@@ -264,7 +264,7 @@
   * @throws StorageRuntimeException if a JE database error occurs while
   * opening the index.
   */
  void open(WriteableStorage txn) throws StorageRuntimeException
  void open(WriteableTransaction txn) throws StorageRuntimeException
  {
    for (Index index : nameToIndexes.values())
    {
@@ -647,7 +647,7 @@
      entryContainer.getRootContainer().getStorage().write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          applyChangeToPresenceIndex(txn, cfg, ccr);
          applyChangeToIndex(txn, IndexType.EQUALITY, cfg, ccr);
@@ -669,7 +669,7 @@
    return ccr;
  }
  private void applyChangeToExtensibleIndexes(WriteableStorage txn, BackendIndexCfg cfg, ConfigChangeResult ccr)
  private void applyChangeToExtensibleIndexes(WriteableTransaction txn, BackendIndexCfg cfg, ConfigChangeResult ccr)
  {
    final AttributeType attrType = cfg.getAttribute();
    if (!cfg.getIndexType().contains(IndexType.EXTENSIBLE))
@@ -723,7 +723,7 @@
  }
  /** Remove indexes which do not correspond to valid rules. */
  private void removeIndexesForExtensibleMatchingRules(WriteableStorage txn, Set<MatchingRule> validRules,
  private void removeIndexesForExtensibleMatchingRules(WriteableTransaction txn, Set<MatchingRule> validRules,
      Set<String> validIndexIds)
  {
    final Set<MatchingRule> rulesToDelete = getCurrentExtensibleMatchingRules();
@@ -777,7 +777,7 @@
    return rules;
  }
  private void applyChangeToIndex(final WriteableStorage txn, final IndexType indexType, final BackendIndexCfg cfg,
  private void applyChangeToIndex(final WriteableTransaction txn, final IndexType indexType, final BackendIndexCfg cfg,
      final ConfigChangeResult ccr)
  {
    String indexId = indexType.toString();
@@ -809,7 +809,7 @@
    }
  }
  private void applyChangeToPresenceIndex(WriteableStorage txn, BackendIndexCfg cfg, ConfigChangeResult ccr)
  private void applyChangeToPresenceIndex(WriteableTransaction txn, BackendIndexCfg cfg, ConfigChangeResult ccr)
  {
    final IndexType indexType = IndexType.PRESENCE;
    final String indexID = indexType.toString();
@@ -837,7 +837,7 @@
    }
  }
  private void removeIndex(WriteableStorage txn, Index index, IndexType indexType)
  private void removeIndex(WriteableTransaction txn, Index index, IndexType indexType)
  {
    if (index != null)
    {
@@ -854,7 +854,7 @@
    }
  }
  private void openIndex(WriteableStorage txn, Index index, ConfigChangeResult ccr)
  private void openIndex(WriteableTransaction txn, Index index, ConfigChangeResult ccr)
  {
    index.open(txn);
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java
@@ -55,7 +55,7 @@
import org.opends.server.backends.pluggable.spi.Storage;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.WriteOperation;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.core.*;
import org.opends.server.types.*;
import org.opends.server.util.RuntimeInformation;
@@ -888,7 +888,7 @@
        rootContainer.getStorage().write(new WriteOperation()
        {
          @Override
          public void run(WriteableStorage txn) throws Exception
          public void run(WriteableTransaction txn) throws Exception
          {
            SortedSet<DN> newBaseDNs = newCfg.getBaseDN();
            DN[] newBaseDNsArray = newBaseDNs.toArray(new DN[newBaseDNs.size()]);
@@ -916,7 +916,7 @@
    return ccr;
  }
  private void removeDeletedBaseDNs(SortedSet<DN> newBaseDNs, WriteableStorage txn) throws DirectoryException
  private void removeDeletedBaseDNs(SortedSet<DN> newBaseDNs, WriteableTransaction txn) throws DirectoryException
  {
    for (DN baseDN : cfg.getBaseDN())
    {
@@ -931,7 +931,7 @@
    }
  }
  private boolean createNewBaseDNs(DN[] newBaseDNsArray, ConfigChangeResult ccr, WriteableStorage txn)
  private boolean createNewBaseDNs(DN[] newBaseDNsArray, ConfigChangeResult ccr, WriteableTransaction txn)
  {
    for (DN baseDN : newBaseDNsArray)
    {
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2ID.java
@@ -29,10 +29,10 @@
import static org.opends.server.backends.pluggable.JebFormat.*;
import org.forgerock.opendj.ldap.ByteString;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.types.DN;
/**
@@ -66,7 +66,7 @@
   * @throws StorageRuntimeException If an error occurred while attempting to insert
   * the new record.
   */
  void put(WriteableStorage txn, DN dn, EntryID id) throws StorageRuntimeException
  void put(WriteableTransaction txn, DN dn, EntryID id) throws StorageRuntimeException
  {
    ByteString key = dnToDNKey(dn, prefixRDNComponents);
    ByteString value = id.toByteString();
@@ -82,7 +82,7 @@
   * @throws StorageRuntimeException If an error occurred while attempting to remove
   * the record.
   */
  boolean remove(WriteableStorage txn, DN dn) throws StorageRuntimeException
  boolean remove(WriteableTransaction txn, DN dn) throws StorageRuntimeException
  {
    ByteString key = dnToDNKey(dn, prefixRDNComponents);
@@ -97,7 +97,7 @@
   * @return The entry ID, or null if the given DN is not in the DN database.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  EntryID get(ReadableStorage txn, DN dn) throws StorageRuntimeException
  EntryID get(ReadableTransaction txn, DN dn) throws StorageRuntimeException
  {
    ByteString key = dnToDNKey(dn, prefixRDNComponents);
    ByteString value = txn.read(getName(), key);
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DN2URI.java
@@ -45,11 +45,11 @@
import org.forgerock.opendj.ldap.SearchScope;
import org.forgerock.util.Pair;
import org.opends.server.backends.pluggable.spi.Cursor;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.UpdateFunction;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.SearchOperation;
import org.opends.server.types.Attribute;
@@ -169,7 +169,7 @@
   * @param labeledURIs The labeled URI value of the ref attribute.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  private void put(final WriteableStorage txn, final DN dn, final Collection<String> labeledURIs)
  private void put(final WriteableTransaction txn, final DN dn, final Collection<String> labeledURIs)
      throws StorageRuntimeException
  {
    final ByteString key = toKey(dn);
@@ -207,7 +207,7 @@
   * @return true if the values were deleted, false if not.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  private boolean delete(WriteableStorage txn, DN dn) throws StorageRuntimeException
  private boolean delete(WriteableTransaction txn, DN dn) throws StorageRuntimeException
  {
    ByteString key = toKey(dn);
@@ -227,7 +227,7 @@
   * @param labeledURIs The URI value to be deleted.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  private void delete(final WriteableStorage txn, final DN dn, final Collection<String> labeledURIs)
  private void delete(final WriteableTransaction txn, final DN dn, final Collection<String> labeledURIs)
      throws StorageRuntimeException
  {
    ByteString key = toKey(dn);
@@ -259,7 +259,7 @@
   *          contain at least one referral, or {@code false} if it is certain
   *          that it doesn't.
   */
  private ConditionResult containsReferrals(ReadableStorage txn)
  private ConditionResult containsReferrals(ReadableTransaction txn)
  {
    Cursor cursor = txn.openCursor(getName());
    try
@@ -290,7 +290,7 @@
   * @param mods The sequence of modifications made to the entry.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  void modifyEntry(WriteableStorage txn, Entry before, Entry after, List<Modification> mods)
  void modifyEntry(WriteableTransaction txn, Entry before, Entry after, List<Modification> mods)
      throws StorageRuntimeException
  {
    DN entryDN = before.getName();
@@ -362,7 +362,7 @@
   * @throws StorageRuntimeException
   *           If an error occurs in the JE database.
   */
  void replaceEntry(WriteableStorage txn, Entry before, Entry after)
  void replaceEntry(WriteableTransaction txn, Entry before, Entry after)
       throws StorageRuntimeException
  {
    deleteEntry(txn, before);
@@ -377,7 +377,7 @@
   * @param entry The entry to be added.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  void addEntry(WriteableStorage txn, Entry entry)
  void addEntry(WriteableTransaction txn, Entry entry)
       throws StorageRuntimeException
  {
    Set<String> labeledURIs = entry.getReferralURLs();
@@ -395,7 +395,7 @@
   * @param entry The entry to be deleted.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  void deleteEntry(WriteableStorage txn, Entry entry) throws StorageRuntimeException
  void deleteEntry(WriteableTransaction txn, Entry entry) throws StorageRuntimeException
  {
    Set<String> labeledURIs = entry.getReferralURLs();
    if (labeledURIs != null)
@@ -518,7 +518,7 @@
   * DN.  The referral URLs will be set appropriately for the references found
   * in the referral entry.
   */
  void targetEntryReferrals(ReadableStorage txn, DN targetDN, SearchScope searchScope) throws DirectoryException
  void targetEntryReferrals(ReadableTransaction txn, DN targetDN, SearchScope searchScope) throws DirectoryException
  {
    if (containsReferrals == ConditionResult.UNDEFINED)
    {
@@ -576,7 +576,7 @@
   *          has been reached or the search has been abandoned).
   * @throws DirectoryException If a Directory Server error occurs.
   */
  boolean returnSearchReferences(ReadableStorage txn, SearchOperation searchOp) throws DirectoryException
  boolean returnSearchReferences(ReadableTransaction txn, SearchOperation searchOp) throws DirectoryException
  {
    if (containsReferrals == ConditionResult.UNDEFINED)
    {
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DatabaseContainer.java
@@ -26,10 +26,10 @@
 */
package org.opends.server.backends.pluggable;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
/**
 * This class is a wrapper around the JE database object and provides basic
@@ -59,7 +59,7 @@
   * @throws StorageRuntimeException
   *           if a JE database error occurs while opening the index.
   */
  void open(WriteableStorage txn) throws StorageRuntimeException
  void open(WriteableTransaction txn) throws StorageRuntimeException
  {
    txn.openTree(name);
  }
@@ -72,7 +72,7 @@
   * @throws StorageRuntimeException
   *           if a database error occurs while deleting the index.
   */
  void delete(WriteableStorage txn) throws StorageRuntimeException
  void delete(WriteableTransaction txn) throws StorageRuntimeException
  {
    txn.deleteTree(name);
  }
@@ -86,7 +86,7 @@
   * @throws StorageRuntimeException
   *           If an error occurs in the DB operation.
   */
  long getRecordCount(ReadableStorage txn) throws StorageRuntimeException
  long getRecordCount(ReadableTransaction txn) throws StorageRuntimeException
  {
    return txn.getRecordCount(name);
  }
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/EntryContainer.java
@@ -75,12 +75,12 @@
import org.opends.server.api.plugin.PluginResult.SubordinateModifyDN;
import org.opends.server.backends.pluggable.spi.Cursor;
import org.opends.server.backends.pluggable.spi.ReadOperation;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.Storage;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.WriteOperation;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.controls.PagedResultsControl;
import org.opends.server.controls.ServerSideSortRequestControl;
import org.opends.server.controls.ServerSideSortResponseControl;
@@ -200,7 +200,7 @@
        storage.write(new WriteOperation()
        {
          @Override
          public void run(WriteableStorage txn) throws Exception
          public void run(WriteableTransaction txn) throws Exception
          {
            //Try creating all the indexes before confirming they are valid ones.
            new AttributeIndex(cfg, EntryContainer.this, txn);
@@ -225,7 +225,7 @@
        storage.write(new WriteOperation()
        {
          @Override
          public void run(WriteableStorage txn) throws Exception
          public void run(WriteableTransaction txn) throws Exception
          {
            final AttributeIndex index = new AttributeIndex(cfg, EntryContainer.this, txn);
            index.open(txn);
@@ -267,7 +267,7 @@
        storage.write(new WriteOperation()
        {
          @Override
          public void run(WriteableStorage txn) throws Exception
          public void run(WriteableTransaction txn) throws Exception
          {
            AttributeIndex index = attrIndexMap.get(cfg.getAttribute());
            deleteAttributeIndex(txn, index);
@@ -369,7 +369,7 @@
        storage.write(new WriteOperation()
        {
          @Override
          public void run(WriteableStorage txn) throws Exception
          public void run(WriteableTransaction txn) throws Exception
          {
            VLVIndex vlvIndex = new VLVIndex(cfg, state, storage, EntryContainer.this, txn);
            vlvIndex.open(txn);
@@ -409,7 +409,7 @@
        storage.write(new WriteOperation()
        {
          @Override
          public void run(WriteableStorage txn) throws Exception
          public void run(WriteableTransaction txn) throws Exception
          {
            VLVIndex vlvIndex = vlvIndexMap.get(cfg.getName().toLowerCase());
            deleteDatabase(txn, vlvIndex);
@@ -482,7 +482,7 @@
   * @throws StorageRuntimeException If an error occurs in the JE database.
   * @throws ConfigException if a configuration related error occurs.
   */
  void open(WriteableStorage txn) throws StorageRuntimeException, ConfigException
  void open(WriteableTransaction txn) throws StorageRuntimeException, ConfigException
  {
    try
    {
@@ -552,7 +552,7 @@
    }
  }
  private NullIndex openNewNullIndex(WriteableStorage txn, String indexId, Indexer indexer)
  private NullIndex openNewNullIndex(WriteableTransaction txn, String indexId, Indexer indexer)
  {
    return new NullIndex(getIndexName(indexId), indexer, state, txn, this);
  }
@@ -703,7 +703,7 @@
   * @return The highest entry ID.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  EntryID getHighestEntryID(ReadableStorage txn) throws StorageRuntimeException
  EntryID getHighestEntryID(ReadableTransaction txn) throws StorageRuntimeException
  {
    Cursor cursor = txn.openCursor(id2entry.getName());
    try
@@ -740,7 +740,7 @@
      return storage.read(new ReadOperation<Long>()
      {
        @Override
        public Long run(ReadableStorage txn) throws Exception
        public Long run(ReadableTransaction txn) throws Exception
        {
          EntryID entryID = dn2id.get(txn, entryDN);
          if (entryID != null)
@@ -783,7 +783,7 @@
      storage.read(new ReadOperation<Void>()
      {
        @Override
        public Void run(ReadableStorage txn) throws Exception
        public Void run(ReadableTransaction txn) throws Exception
        {
          DN aBaseDN = searchOperation.getBaseDN();
          SearchScope searchScope = searchOperation.getScope();
@@ -1110,8 +1110,8 @@
   * @throws DirectoryException If an error prevented the search from being
   * processed.
   */
  private void searchNotIndexed(ReadableStorage txn, SearchOperation searchOperation, PagedResultsControl pageRequest)
      throws DirectoryException, CanceledOperationException
  private void searchNotIndexed(ReadableTransaction txn, SearchOperation searchOperation,
      PagedResultsControl pageRequest) throws DirectoryException, CanceledOperationException
  {
    DN aBaseDN = searchOperation.getBaseDN();
    SearchScope searchScope = searchOperation.getScope();
@@ -1286,7 +1286,7 @@
   * @throws DirectoryException
   *           If an error occurs retrieving the entry
   */
  Entry getEntry(ReadableStorage txn, EntryID entryID) throws DirectoryException
  Entry getEntry(ReadableTransaction txn, EntryID entryID) throws DirectoryException
  {
    // Try the entry cache first.
    final EntryCache<?> entryCache = getEntryCache();
@@ -1328,7 +1328,7 @@
   * @throws DirectoryException If an error prevented the search from being
   * processed.
   */
  private void searchIndexed(ReadableStorage txn, EntryIDSet entryIDSet, boolean candidatesAreInScope,
  private void searchIndexed(ReadableTransaction txn, EntryIDSet entryIDSet, boolean candidatesAreInScope,
      SearchOperation searchOperation, PagedResultsControl pageRequest) throws DirectoryException,
      CanceledOperationException
  {
@@ -1497,7 +1497,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          DN parentDN = getParentWithinBase(entry.getName());
@@ -1631,7 +1631,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          final IndexBuffer indexBuffer = new IndexBuffer(EntryContainer.this);
@@ -1775,7 +1775,7 @@
    return newBS;
  }
  private void deleteEntry(WriteableStorage txn,
  private void deleteEntry(WriteableTransaction txn,
      IndexBuffer indexBuffer,
      boolean manageDsaIT,
      DN targetDN,
@@ -1883,7 +1883,7 @@
   * @throws  DirectoryException  If a problem occurs while trying to make the
   *                              determination.
   */
  private boolean entryExists(ReadableStorage txn, final DN entryDN) throws DirectoryException
  private boolean entryExists(ReadableTransaction txn, final DN entryDN) throws DirectoryException
  {
    // Try the entry cache first.
    EntryCache<?> entryCache = DirectoryServer.getEntryCache();
@@ -1914,7 +1914,7 @@
      return storage.read(new ReadOperation<Entry>()
      {
        @Override
        public Entry run(ReadableStorage txn) throws Exception
        public Entry run(ReadableTransaction txn) throws Exception
        {
          return getEntry0(txn, entryDN);
        }
@@ -1928,7 +1928,7 @@
    }
  }
  private Entry getEntry0(ReadableStorage txn, final DN entryDN) throws StorageRuntimeException, DirectoryException
  private Entry getEntry0(ReadableTransaction txn, final DN entryDN) throws StorageRuntimeException, DirectoryException
  {
    final EntryCache<?> entryCache = DirectoryServer.getEntryCache();
@@ -2000,7 +2000,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          try
          {
@@ -2125,7 +2125,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          DN oldSuperiorDN = getParentWithinBase(currentDN);
          DN newSuperiorDN = getParentWithinBase(entry.getName());
@@ -2348,7 +2348,7 @@
    }
  }
  private void addRenamedEntry(WriteableStorage txn, IndexBuffer buffer,
  private void addRenamedEntry(WriteableTransaction txn, IndexBuffer buffer,
                           EntryID newID,
                           Entry newEntry,
                           boolean isApexEntryMoved,
@@ -2386,7 +2386,7 @@
    }
  }
  private void removeApexEntry(WriteableStorage txn, IndexBuffer buffer,
  private void removeApexEntry(WriteableTransaction txn, IndexBuffer buffer,
      DN oldSuperiorDN,
      EntryID oldID, EntryID newID,
      Entry oldEntry, Entry newEntry,
@@ -2456,7 +2456,7 @@
    }
  }
  private void removeSubordinateEntry(WriteableStorage txn, IndexBuffer buffer,
  private void removeSubordinateEntry(WriteableTransaction txn, IndexBuffer buffer,
      DN oldSuperiorDN,
      EntryID oldID, EntryID newID,
      Entry oldEntry, DN newDN,
@@ -2669,7 +2669,7 @@
   * @return The number of entries stored in this entry container.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  long getEntryCount(ReadableStorage txn) throws StorageRuntimeException
  long getEntryCount(ReadableTransaction txn) throws StorageRuntimeException
  {
    final EntryID entryID = dn2id.get(txn, baseDN);
    if (entryID != null)
@@ -2754,7 +2754,7 @@
   * @throws StorageRuntimeException If an error occurs while removing the entry
   *                           container.
   */
  void delete(WriteableStorage txn) throws StorageRuntimeException
  void delete(WriteableTransaction txn) throws StorageRuntimeException
  {
    List<DatabaseContainer> databases = new ArrayList<DatabaseContainer>();
    listDatabases(databases);
@@ -2773,7 +2773,7 @@
   * @throws StorageRuntimeException If an error occurs while attempting to delete the
   * database.
   */
  void deleteDatabase(WriteableStorage txn, DatabaseContainer database) throws StorageRuntimeException
  void deleteDatabase(WriteableTransaction txn, DatabaseContainer database) throws StorageRuntimeException
  {
    if(database == state)
    {
@@ -2794,7 +2794,8 @@
   * @throws StorageRuntimeException If an JE database error occurs while attempting
   * to delete the index.
   */
  private void deleteAttributeIndex(WriteableStorage txn, AttributeIndex attributeIndex) throws StorageRuntimeException
  private void deleteAttributeIndex(WriteableTransaction txn, AttributeIndex attributeIndex)
      throws StorageRuntimeException
  {
    attributeIndex.close();
    for (Index index : attributeIndex.getAllIndexes())
@@ -2833,7 +2834,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          for(DatabaseContainer db : databases)
          {
@@ -2868,7 +2869,7 @@
        storage.write(new WriteOperation()
        {
          @Override
          public void run(WriteableStorage txn) throws Exception
          public void run(WriteableTransaction txn) throws Exception
          {
            // Open the containers backup.
            for(DatabaseContainer db : databases)
@@ -2935,7 +2936,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          if (config.isSubordinateIndexesEnabled() != cfg.isSubordinateIndexesEnabled())
          {
@@ -3003,7 +3004,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          clear0(txn);
        }
@@ -3015,7 +3016,7 @@
    }
  }
  private void clear0(WriteableStorage txn) throws StorageRuntimeException
  private void clear0(WriteableTransaction txn) throws StorageRuntimeException
  {
    final List<DatabaseContainer> databases = new ArrayList<DatabaseContainer>();
    listDatabases(databases);
@@ -3050,7 +3051,7 @@
   * @param database The database to clear.
   * @throws StorageRuntimeException if a JE database error occurs.
   */
  void clearDatabase(WriteableStorage txn, DatabaseContainer database)
  void clearDatabase(WriteableTransaction txn, DatabaseContainer database)
      throws StorageRuntimeException
  {
    try
@@ -3076,7 +3077,7 @@
   * @throws DirectoryException If an error prevented the check of an
   * existing entry from being performed.
   */
  private DN getMatchedDN(ReadableStorage txn, DN baseDN) throws DirectoryException
  private DN getMatchedDN(ReadableTransaction txn, DN baseDN) throws DirectoryException
  {
    DN parentDN  = baseDN.getParentDNInSuffix();
    while (parentDN != null && parentDN.isDescendantOf(getBaseDN()))
@@ -3091,13 +3092,13 @@
  }
  /** Opens the id2children and id2subtree indexes. */
  private void openSubordinateIndexes(WriteableStorage txn)
  private void openSubordinateIndexes(WriteableTransaction txn)
  {
    id2children = newIndex(txn, ID2CHILDREN_DATABASE_NAME, new ID2CIndexer());
    id2subtree = newIndex(txn, ID2SUBTREE_DATABASE_NAME, new ID2SIndexer());
  }
  private Index newIndex(WriteableStorage txn, String name, Indexer indexer)
  private Index newIndex(WriteableTransaction txn, String name, Indexer indexer)
  {
    final Index index = new Index(getIndexName(name), indexer, state, config.getIndexEntryLimit(), 0, true, txn, this);
    index.open(txn);
@@ -3117,7 +3118,7 @@
   * @param indexEntryLimit the index entry limit
   * @return a new index
   */
  Index newIndexForAttribute(WriteableStorage txn, TreeName indexName, Indexer indexer, int indexEntryLimit)
  Index newIndexForAttribute(WriteableTransaction txn, TreeName indexName, Indexer indexer, int indexEntryLimit)
  {
    return new Index(indexName, indexer, state, indexEntryLimit, CURSOR_ENTRY_LIMIT, false, txn, this);
  }
@@ -3167,7 +3168,7 @@
   * @return the Entry matching the baseDN.
   * @throws DirectoryException if the baseDN doesn't exist.
   */
  private Entry fetchBaseEntry(ReadableStorage txn, DN baseDN, SearchScope searchScope)
  private Entry fetchBaseEntry(ReadableTransaction txn, DN baseDN, SearchScope searchScope)
      throws DirectoryException
  {
    Entry baseEntry = null;
@@ -3195,7 +3196,7 @@
    return baseEntry;
  }
  private EntryIDSet sort(ReadableStorage txn, EntryIDSet entryIDSet, SearchOperation searchOperation,
  private EntryIDSet sort(ReadableTransaction txn, EntryIDSet entryIDSet, SearchOperation searchOperation,
      SortOrder sortOrder, VLVRequestControl vlvRequest) throws DirectoryException
  {
    if (!entryIDSet.isDefined())
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ExportJob.java
@@ -36,7 +36,7 @@
import org.forgerock.opendj.ldap.ByteString;
import org.opends.server.backends.pluggable.spi.Cursor;
import org.opends.server.backends.pluggable.spi.ReadOperation;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
@@ -135,7 +135,7 @@
      rootContainer.getStorage().read(new ReadOperation<Void>()
      {
        @Override
        public Void run(ReadableStorage txn) throws Exception
        public Void run(ReadableTransaction txn) throws Exception
        {
          for (EntryContainer exportContainer : exportContainers)
          {
@@ -191,7 +191,7 @@
   * @throws  LDIFException  If an error occurs while trying to determine
   *                         whether to write an entry.
   */
  private void exportContainer(ReadableStorage txn, EntryContainer entryContainer)
  private void exportContainer(ReadableTransaction txn, EntryContainer entryContainer)
       throws StorageRuntimeException, IOException, LDIFException
  {
    Cursor cursor = txn.openCursor(entryContainer.getID2Entry().getName());
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Entry.java
@@ -44,10 +44,10 @@
import org.forgerock.opendj.ldap.ByteStringBuilder;
import org.forgerock.opendj.ldap.DecodeException;
import org.opends.server.api.CompressedSchema;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
@@ -319,7 +319,7 @@
   * @throws  DirectoryException  If a problem occurs while attempting to encode
   *                              the entry.
   */
  public void put(WriteableStorage txn, EntryID id, Entry entry)
  public void put(WriteableTransaction txn, EntryID id, Entry entry)
       throws StorageRuntimeException, DirectoryException
  {
    ByteString key = id.toByteString();
@@ -343,7 +343,7 @@
   * @return true if the entry was removed, false if it was not.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  boolean remove(WriteableStorage txn, EntryID id) throws StorageRuntimeException
  boolean remove(WriteableTransaction txn, EntryID id) throws StorageRuntimeException
  {
    return txn.delete(getName(), id.toByteString());
  }
@@ -357,7 +357,7 @@
   * @throws DirectoryException If a problem occurs while getting the entry.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  public Entry get(ReadableStorage txn, EntryID id)
  public Entry get(ReadableTransaction txn, EntryID id)
       throws DirectoryException, StorageRuntimeException
  {
    return get0(id, txn.read(getName(), id.toByteString()));
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Importer.java
@@ -102,13 +102,13 @@
import org.opends.server.backends.RebuildConfig.RebuildMode;
import org.opends.server.backends.persistit.PersistItStorage;
import org.opends.server.backends.pluggable.spi.Cursor;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.Storage;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.UpdateFunction;
import org.opends.server.backends.pluggable.spi.WriteOperation;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.core.DirectoryServer;
import org.opends.server.extensions.DiskSpaceMonitor;
import org.opends.server.types.AttributeType;
@@ -379,7 +379,7 @@
   * @param backendCfg
   *          the backend configuration object
   * @return true if the backend must be cleared, false otherwise
   * @see Importer#getSuffix(WriteableStorage, EntryContainer) for per-suffix cleanups.
   * @see Importer#getSuffix(WriteableTransaction, EntryContainer) for per-suffix cleanups.
   */
  static boolean mustClearBackend(LDIFImportConfig importCfg, PluggableBackendCfg backendCfg)
  {
@@ -653,7 +653,7 @@
    }
  }
  private void initializeSuffixes(WriteableStorage txn) throws StorageRuntimeException,
  private void initializeSuffixes(WriteableTransaction txn) throws StorageRuntimeException,
      ConfigException
  {
    for (EntryContainer ec : rootContainer.getEntryContainers())
@@ -713,7 +713,7 @@
    return System.identityHashCode(index);
  }
  private Suffix getSuffix(WriteableStorage txn, EntryContainer entryContainer)
  private Suffix getSuffix(WriteableTransaction txn, EntryContainer entryContainer)
      throws ConfigException
  {
    DN baseDN = entryContainer.getBaseDN();
@@ -800,7 +800,7 @@
    return new Suffix(entryContainer, sourceEntryContainer, includeBranches, excludeBranches);
  }
  private EntryContainer createEntryContainer(WriteableStorage txn, DN baseDN) throws ConfigException
  private EntryContainer createEntryContainer(WriteableTransaction txn, DN baseDN) throws ConfigException
  {
    try
    {
@@ -888,7 +888,7 @@
    rootContainer.getStorage().write(new WriteOperation()
    {
      @Override
      public void run(WriteableStorage txn) throws Exception
      public void run(WriteableTransaction txn) throws Exception
      {
        final long startTime = System.currentTimeMillis();
        rebuildManager.initialize();
@@ -907,7 +907,7 @@
    storage.write(new WriteOperation()
    {
      @Override
      public void run(WriteableStorage txn) throws Exception
      public void run(WriteableTransaction txn) throws Exception
      {
        rebuildManager.initialize();
        rebuildManager.printStartMessage(txn);
@@ -922,7 +922,7 @@
    storage.write(new WriteOperation()
    {
      @Override
      public void run(WriteableStorage txn) throws Exception
      public void run(WriteableTransaction txn) throws Exception
      {
        rebuildManager.postRebuildIndexes(txn);
      }
@@ -962,7 +962,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          initializeSuffixes(txn);
          setIndexesTrusted(txn, false);
@@ -994,7 +994,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          setIndexesTrusted(txn, true);
          switchEntryContainers(txn);
@@ -1050,7 +1050,7 @@
    dir.delete();
  }
  private void switchEntryContainers(WriteableStorage txn) throws StorageRuntimeException, InitializationException
  private void switchEntryContainers(WriteableTransaction txn) throws StorageRuntimeException, InitializationException
  {
    for (Suffix suffix : dnSuffixMap.values())
    {
@@ -1073,7 +1073,7 @@
    }
  }
  private void setIndexesTrusted(WriteableStorage txn, boolean trusted) throws StorageRuntimeException
  private void setIndexesTrusted(WriteableTransaction txn, boolean trusted) throws StorageRuntimeException
  {
    try
    {
@@ -1111,7 +1111,7 @@
    storage.write(new WriteOperation()
    {
      @Override
      public void run(WriteableStorage txn) throws Exception
      public void run(WriteableTransaction txn) throws Exception
      {
        execService.submit(new MigrateExistingTask(txn)).get();
      }
@@ -1123,14 +1123,14 @@
    {
      for (int i = 0; i < threadCount; i++)
      {
        tasks.add(new AppendReplaceTask(storage.getWriteableStorage()));
        tasks.add(new AppendReplaceTask(storage.getWriteableTransaction()));
      }
    }
    else
    {
      for (int i = 0; i < threadCount; i++)
      {
        tasks.add(new ImportTask(storage.getWriteableStorage()));
        tasks.add(new ImportTask(storage.getWriteableTransaction()));
      }
    }
    getAll(execService.invokeAll(tasks));
@@ -1139,7 +1139,7 @@
    storage.write(new WriteOperation()
    {
      @Override
      public void run(WriteableStorage txn) throws Exception
      public void run(WriteableTransaction txn) throws Exception
      {
        execService.submit(new MigrateExcludedTask(txn)).get();
      }
@@ -1280,7 +1280,7 @@
    {
      // avoid threading issues by allocating one writeable storage per thread
      // DB transactions are generally tied to a single thread
      WriteableStorage txn = this.rootContainer.getStorage().getWriteableStorage();
      WriteableTransaction txn = this.rootContainer.getStorage().getWriteableTransaction();
      futures.add(dbService.submit(new IndexDBWriteTask(indexMgr, txn, permits, buffers, readAheadSize)));
    }
  }
@@ -1305,7 +1305,7 @@
  /** Task used to migrate excluded branch. */
  private final class MigrateExcludedTask extends ImportTask
  {
    private MigrateExcludedTask(final WriteableStorage txn)
    private MigrateExcludedTask(final WriteableTransaction txn)
    {
      super(txn);
    }
@@ -1369,7 +1369,7 @@
  /** Task to migrate existing entries. */
  private final class MigrateExistingTask extends ImportTask
  {
    private MigrateExistingTask(final WriteableStorage txn)
    private MigrateExistingTask(final WriteableTransaction txn)
    {
      super(txn);
    }
@@ -1458,7 +1458,7 @@
   */
  private class AppendReplaceTask extends ImportTask
  {
    public AppendReplaceTask(final WriteableStorage txn)
    public AppendReplaceTask(final WriteableTransaction txn)
    {
      super(txn);
    }
@@ -1583,13 +1583,13 @@
   */
  private class ImportTask implements Callable<Void>
  {
    WriteableStorage txn;
    WriteableTransaction txn;
    private final Map<IndexKey, IndexOutputBuffer> indexBufferMap = new HashMap<IndexKey, IndexOutputBuffer>();
    private final Set<ByteString> insertKeySet = new HashSet<ByteString>();
    private final EntryInformation entryInfo = new EntryInformation();
    private final IndexKey dnIndexKey = new IndexKey(dnType, ImportIndexType.DN, 1);
    public ImportTask(final WriteableStorage txn)
    public ImportTask(final WriteableTransaction txn)
    {
      this.txn = txn;
    }
@@ -1865,7 +1865,7 @@
    private int nextBufferID;
    private int ownedPermits;
    private volatile boolean isRunning;
    private final WriteableStorage txn;
    private final WriteableTransaction txn;
    /**
     * Creates a new index DB writer.
@@ -1881,7 +1881,7 @@
     * @param cacheSize
     *          The buffer cache size.
     */
    public IndexDBWriteTask(IndexManager indexMgr, WriteableStorage txn, Semaphore permits, int maxPermits,
    public IndexDBWriteTask(IndexManager indexMgr, WriteableTransaction txn, Semaphore permits, int maxPermits,
        int cacheSize)
    {
      this.indexMgr = indexMgr;
@@ -2205,7 +2205,7 @@
      }
      /** Why do we still need this if we are checking parents in the first phase? */
      private boolean checkParent(ReadableStorage txn, ImportIDSet idSet) throws StorageRuntimeException
      private boolean checkParent(ReadableTransaction txn, ImportIDSet idSet) throws StorageRuntimeException
      {
        entryID = new EntryID(idSet.valueToByteString());
        parentDN = getParent(idSet.getKey());
@@ -2301,7 +2301,7 @@
        return idSet;
      }
      private EntryID getParentID(ReadableStorage txn, ByteSequence dn) throws StorageRuntimeException
      private EntryID getParentID(ReadableTransaction txn, ByteSequence dn) throws StorageRuntimeException
      {
        // Bypass the cache for append data, lookup the parent DN in the DN2ID db
        if (importConfiguration == null || !importConfiguration.appendToExistingData())
@@ -2312,7 +2312,7 @@
        return value != null ? new EntryID(value) : null;
      }
      private void id2SubTree(ReadableStorage txn, EntryID childID) throws DirectoryException
      private void id2SubTree(ReadableTransaction txn, EntryID childID) throws DirectoryException
      {
        if (parentID == null)
        {
@@ -2926,7 +2926,7 @@
    /**
     * Print start message.
     */
    void printStartMessage(WriteableStorage txn) throws StorageRuntimeException
    void printStartMessage(WriteableTransaction txn) throws StorageRuntimeException
    {
      this.txn = txn;
      totalEntries = suffix.getID2Entry().getRecordCount(txn);
@@ -3009,7 +3009,7 @@
      }
    }
    private void clearDegradedState(WriteableStorage txn)
    private void clearDegradedState(WriteableTransaction txn)
    {
      setIndexesListsToBeRebuilt(txn);
      logger.info(NOTE_JEB_REBUILD_CLEARDEGRADEDSTATE_FINAL_STATUS, rebuildConfig.getRebuildList());
@@ -3017,7 +3017,7 @@
    }
    private void preRebuildIndexes(WriteableStorage txn)
    private void preRebuildIndexes(WriteableTransaction txn)
    {
      setIndexesListsToBeRebuilt(txn);
      setRebuildListIndexesTrusted(txn, false);
@@ -3032,13 +3032,13 @@
      }
    }
    private void postRebuildIndexes(WriteableStorage txn)
    private void postRebuildIndexes(WriteableTransaction txn)
    {
      setRebuildListIndexesTrusted(txn, true);
    }
    @SuppressWarnings("fallthrough")
    private void setIndexesListsToBeRebuilt(WriteableStorage txn) throws StorageRuntimeException
    private void setIndexesListsToBeRebuilt(WriteableTransaction txn) throws StorageRuntimeException
    {
      // Depends on rebuild mode, (re)building indexes' lists.
      final RebuildMode mode = rebuildConfig.getRebuildMode();
@@ -3078,7 +3078,7 @@
      }
    }
    private void rebuildIndexMap(WriteableStorage txn, boolean onlyDegraded)
    private void rebuildIndexMap(WriteableTransaction txn, boolean onlyDegraded)
    {
      // rebuildList contains the user-selected index(in USER_DEFINED mode).
      final List<String> rebuildList = rebuildConfig.getRebuildList();
@@ -3106,7 +3106,7 @@
      }
    }
    private void rebuildAttributeIndexes(WriteableStorage txn, AttributeIndex attrIndex, AttributeType attrType,
    private void rebuildAttributeIndexes(WriteableTransaction txn, AttributeIndex attrIndex, AttributeType attrType,
        boolean onlyDegraded) throws StorageRuntimeException
    {
      fillIndexMap(txn, attrType, attrIndex.getSubstringIndex(), ImportIndexType.SUBSTRING, onlyDegraded);
@@ -3125,7 +3125,7 @@
      }
    }
    private void fillIndexMap(WriteableStorage txn, AttributeType attrType, Collection<Index> indexes,
    private void fillIndexMap(WriteableTransaction txn, AttributeType attrType, Collection<Index> indexes,
        ImportIndexType importIndexType, boolean onlyDegraded)
    {
      if (indexes != null && !indexes.isEmpty())
@@ -3154,7 +3154,7 @@
      }
    }
    private void fillIndexMap(WriteableStorage txn, AttributeType attrType, Index index,
    private void fillIndexMap(WriteableTransaction txn, AttributeType attrType, Index index,
        ImportIndexType importIndexType, boolean onlyDegraded)
    {
      if (index != null
@@ -3167,7 +3167,7 @@
      }
    }
    private void clearIndexes(WriteableStorage txn, boolean onlyDegraded) throws StorageRuntimeException
    private void clearIndexes(WriteableTransaction txn, boolean onlyDegraded) throws StorageRuntimeException
    {
      // Clears all the entry's container databases which are containing the indexes
      if (!onlyDegraded)
@@ -3219,7 +3219,7 @@
      }
    }
    private void setRebuildListIndexesTrusted(WriteableStorage txn, boolean trusted) throws StorageRuntimeException
    private void setRebuildListIndexesTrusted(WriteableTransaction txn, boolean trusted) throws StorageRuntimeException
    {
      try
      {
@@ -3251,7 +3251,7 @@
      }
    }
    private void setTrusted(WriteableStorage txn, final Collection<Index> indexes, boolean trusted)
    private void setTrusted(WriteableTransaction txn, final Collection<Index> indexes, boolean trusted)
    {
      if (indexes != null && !indexes.isEmpty())
      {
@@ -3262,7 +3262,7 @@
      }
    }
    /** @see Importer#importPhaseOne(WriteableStorage) */
    /** @see Importer#importPhaseOne(WriteableTransaction) */
    private void rebuildIndexesPhaseOne() throws StorageRuntimeException, InterruptedException,
        ExecutionException
    {
@@ -3994,7 +3994,7 @@
    private static final String DB_NAME = "dn_cache";
    private final TreeName dnCache = new TreeName("", DB_NAME);
    private final Storage storage;
    private final WriteableStorage txn;
    private final WriteableTransaction txn;
    /**
     * Create a temporary DB environment and database to be used as a cache of
@@ -4022,7 +4022,7 @@
        storage = new PersistItStorage(newPersistitBackendCfgProxy(returnValues),
            DirectoryServer.getInstance().getServerContext());
        storage.open();
        txn = storage.getWriteableStorage();
        txn = storage.getWriteableTransaction();
        txn.openTree(dnCache);
      }
      catch (Exception e)
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Index.java
@@ -43,11 +43,11 @@
import org.forgerock.opendj.ldap.spi.IndexingOptions;
import org.opends.server.backends.pluggable.IndexBuffer.BufferedIndexValues;
import org.opends.server.backends.pluggable.spi.Cursor;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.UpdateFunction;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.types.Entry;
import org.opends.server.types.Modification;
import org.opends.server.util.StaticUtils;
@@ -114,7 +114,7 @@
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  Index(TreeName name, Indexer indexer, State state, int indexEntryLimit, int cursorEntryLimit, boolean maintainCount,
      WriteableStorage txn, EntryContainer entryContainer) throws StorageRuntimeException
      WriteableTransaction txn, EntryContainer entryContainer) throws StorageRuntimeException
  {
    super(name);
    this.indexer = indexer;
@@ -149,7 +149,7 @@
   * @param importIdSet The import ID set to delete.
   * @throws StorageRuntimeException If a database error occurs.
   */
  final void delete(WriteableStorage txn, ImportIDSet importIdSet) throws StorageRuntimeException
  final void delete(WriteableTransaction txn, ImportIDSet importIdSet) throws StorageRuntimeException
  {
    ByteSequence key = importIdSet.getKey();
    ByteString value = txn.read(getName(), key);
@@ -178,7 +178,7 @@
   * @param importIdSet The set of import IDs.
   * @throws StorageRuntimeException If a database error occurs.
   */
  final void insert(WriteableStorage txn, ImportIDSet importIdSet) throws StorageRuntimeException
  final void insert(WriteableTransaction txn, ImportIDSet importIdSet) throws StorageRuntimeException
  {
    ByteSequence key = importIdSet.getKey();
    ByteString value = txn.read(getName(), key);
@@ -197,7 +197,7 @@
    txn.put(getName(), key, value);
  }
  void updateKey(WriteableStorage txn, ByteString key, EntryIDSet deletedIDs, EntryIDSet addedIDs)
  void updateKey(WriteableTransaction txn, ByteString key, EntryIDSet deletedIDs, EntryIDSet addedIDs)
      throws StorageRuntimeException
  {
    /*
@@ -263,7 +263,7 @@
    return entryIDSet != null && entryIDSet.size() > 0;
  }
  private void updateKeyWithRMW(final WriteableStorage txn, final ByteString key, final EntryIDSet deletedIDs,
  private void updateKeyWithRMW(final WriteableTransaction txn, final ByteString key, final EntryIDSet deletedIDs,
      final EntryIDSet addedIDs) throws StorageRuntimeException
  {
    txn.update(getName(), key, new UpdateFunction()
@@ -362,7 +362,7 @@
    getBufferedIndexValues(buffer, keyBytes).deleteEntryID(keyBytes, entryID);
  }
  private void logIndexCorruptError(WriteableStorage txn, ByteString key)
  private void logIndexCorruptError(WriteableTransaction txn, ByteString key)
  {
    if (logger.isTraceEnabled())
    {
@@ -399,7 +399,7 @@
   * @throws StorageRuntimeException
   *           If an error occurs in the JE database.
   */
  ConditionResult containsID(ReadableStorage txn, ByteString key, EntryID entryID)
  ConditionResult containsID(ReadableTransaction txn, ByteString key, EntryID entryID)
       throws StorageRuntimeException
  {
    ByteString value = txn.read(getName(), key);
@@ -422,7 +422,7 @@
   * @param key The key to read
   * @return The non null set of entry IDs.
   */
  EntryIDSet read(ReadableStorage txn, ByteSequence key)
  EntryIDSet read(ReadableTransaction txn, ByteSequence key)
  {
    try
    {
@@ -463,7 +463,7 @@
   *                      specified.
   * @return The non null set of entry IDs.
   */
  EntryIDSet readRange(ReadableStorage txn,
  EntryIDSet readRange(ReadableTransaction txn,
      ByteSequence lower, ByteSequence upper, boolean lowerIncluded, boolean upperIncluded)
  {
    // If this index is not trusted, then just return an undefined id set.
@@ -615,7 +615,7 @@
    return indexEntryLimit;
  }
  synchronized void setTrusted(WriteableStorage txn, boolean trusted) throws StorageRuntimeException
  synchronized void setTrusted(WriteableTransaction txn, boolean trusted) throws StorageRuntimeException
  {
    this.trusted = trusted;
    state.putIndexTrustState(txn, this, trusted);
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexBuffer.java
@@ -36,7 +36,7 @@
import org.forgerock.opendj.ldap.ByteString;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.types.DirectoryException;
/**
@@ -239,7 +239,7 @@
   * @throws StorageRuntimeException If an error occurs in the JE database.
   * @throws DirectoryException If a Directory Server error occurs.
   */
  void flush(WriteableStorage txn) throws StorageRuntimeException, DirectoryException
  void flush(WriteableTransaction txn) throws StorageRuntimeException, DirectoryException
  {
    /*
     * FIXME: this seems like a surprising way to update the indexes. Why not
@@ -279,7 +279,7 @@
    }
  }
  private void updateKeys(Index index, WriteableStorage txn,
  private void updateKeys(Index index, WriteableTransaction txn,
      Map<ByteString, BufferedIndexValues> bufferedValues)
  {
    if (bufferedValues != null)
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexFilter.java
@@ -34,7 +34,7 @@
import java.util.Map;
import org.opends.server.backends.pluggable.AttributeIndex.IndexFilterType;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.core.SearchOperation;
import org.opends.server.types.AttributeType;
import org.opends.server.types.FilterType;
@@ -59,7 +59,7 @@
  /** The entry container holding the attribute indexes. */
  private final EntryContainer entryContainer;
  private final ReadableStorage txn;
  private final ReadableTransaction txn;
  /**
   * The search operation provides the search base, scope and filter.
@@ -85,7 +85,7 @@
   *                     which will help determine how the indexes contributed
   *                     to this search.
   */
  IndexFilter(EntryContainer entryContainer, ReadableStorage txn, SearchOperation searchOp,
  IndexFilter(EntryContainer entryContainer, ReadableTransaction txn, SearchOperation searchOp,
      StringBuilder debugBuilder, DatabaseEnvironmentMonitor monitor)
  {
    this.entryContainer = entryContainer;
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/IndexQueryFactoryImpl.java
@@ -35,7 +35,7 @@
import org.forgerock.opendj.ldap.ByteSequence;
import org.forgerock.opendj.ldap.spi.IndexQueryFactory;
import org.forgerock.opendj.ldap.spi.IndexingOptions;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
/**
 * This class is an implementation of IndexQueryFactory which creates
@@ -46,7 +46,7 @@
  private static final String PRESENCE_INDEX_KEY = "presence";
  private final ReadableStorage txn;
  private final ReadableTransaction txn;
  /** The Map containing the string type identifier and the corresponding index. */
  private final AttributeIndex attributeIndex;
@@ -58,7 +58,7 @@
   * @param attributeIndex
   *          The targeted attribute index
   */
  IndexQueryFactoryImpl(ReadableStorage txn, AttributeIndex attributeIndex)
  IndexQueryFactoryImpl(ReadableTransaction txn, AttributeIndex attributeIndex)
  {
    this.txn = txn;
    this.attributeIndex = attributeIndex;
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/JECompressedSchema.java
@@ -44,7 +44,7 @@
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.WriteOperation;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.InitializationException;
@@ -93,7 +93,7 @@
   *           If an error occurs while loading and processing the compressed
   *           schema definitions.
   */
  JECompressedSchema(final Storage storage, WriteableStorage txn)
  JECompressedSchema(final Storage storage, WriteableTransaction txn)
      throws StorageRuntimeException, InitializationException
  {
    this.storage = storage;
@@ -159,7 +159,7 @@
   * @throws InitializationException
   *           If an error occurs while loading and processing the definitions.
   */
  private void load(WriteableStorage txn) throws StorageRuntimeException, InitializationException
  private void load(WriteableTransaction txn) throws StorageRuntimeException, InitializationException
  {
    txn.openTree(adTreeName);
    txn.openTree(ocTreeName);
@@ -236,7 +236,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          txn.put(treeName, keyEntry, value);
        }
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/NullIndex.java
@@ -33,10 +33,10 @@
import org.forgerock.opendj.ldap.ByteString;
import org.forgerock.opendj.ldap.ConditionResult;
import org.forgerock.opendj.ldap.spi.IndexingOptions;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.types.Entry;
import org.opends.server.types.Modification;
@@ -47,7 +47,7 @@
final class NullIndex extends Index
{
  NullIndex(TreeName name, Indexer indexer, State state, WriteableStorage txn,
  NullIndex(TreeName name, Indexer indexer, State state, WriteableTransaction txn,
      EntryContainer entryContainer) throws StorageRuntimeException
  {
    super(name, indexer, state, 0, 0, false, txn, entryContainer);
@@ -56,7 +56,7 @@
  }
  @Override
  void updateKey(WriteableStorage txn, ByteString key, EntryIDSet deletedIDs, EntryIDSet addedIDs)
  void updateKey(WriteableTransaction txn, ByteString key, EntryIDSet deletedIDs, EntryIDSet addedIDs)
      throws StorageRuntimeException
  {
    // Do nothing.
@@ -69,20 +69,20 @@
  }
  @Override
  ConditionResult containsID(ReadableStorage txn, ByteString key, EntryID entryID)
  ConditionResult containsID(ReadableTransaction txn, ByteString key, EntryID entryID)
      throws StorageRuntimeException
  {
    return ConditionResult.UNDEFINED;
  }
  @Override
  EntryIDSet read(ReadableStorage txn, ByteSequence key)
  EntryIDSet read(ReadableTransaction txn, ByteSequence key)
  {
    return newUndefinedSet();
  }
  @Override
  EntryIDSet readRange(ReadableStorage txn, ByteSequence lower, ByteSequence upper, boolean lowerIncluded,
  EntryIDSet readRange(ReadableTransaction txn, ByteSequence lower, ByteSequence upper, boolean lowerIncluded,
      boolean upperIncluded)
  {
    return newUndefinedSet();
@@ -128,7 +128,7 @@
  }
  @Override
  void setTrusted(WriteableStorage txn, boolean trusted) throws StorageRuntimeException
  void setTrusted(WriteableTransaction txn, boolean trusted) throws StorageRuntimeException
  {
    // Do nothing.
  }
@@ -152,19 +152,19 @@
  }
  @Override
  void open(WriteableStorage txn) throws StorageRuntimeException
  void open(WriteableTransaction txn) throws StorageRuntimeException
  {
    // Do nothing.
  }
  @Override
  long getRecordCount(ReadableStorage txn) throws StorageRuntimeException
  long getRecordCount(ReadableTransaction txn) throws StorageRuntimeException
  {
    return 0;
  }
  @Override
  void delete(WriteableStorage txn) throws StorageRuntimeException
  void delete(WriteableTransaction txn) throws StorageRuntimeException
  {
    // Do nothing.
  }
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/RootContainer.java
@@ -52,12 +52,12 @@
import org.opends.server.admin.std.server.PluggableBackendCfg;
import org.opends.server.api.CompressedSchema;
import org.opends.server.backends.pluggable.spi.ReadOperation;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.Storage;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.StorageStatus;
import org.opends.server.backends.pluggable.spi.WriteOperation;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.SearchOperation;
import org.opends.server.types.DN;
@@ -354,7 +354,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          compressedSchema = new JECompressedSchema(storage, txn);
          openAndRegisterEntryContainers(txn, config.getBaseDN());
@@ -385,7 +385,7 @@
   * @throws ConfigException
   *           If an configuration error occurs while opening the entry container.
   */
  EntryContainer openEntryContainer(DN baseDN, WriteableStorage txn)
  EntryContainer openEntryContainer(DN baseDN, WriteableTransaction txn)
      throws StorageRuntimeException, ConfigException
  {
    EntryContainer ec = new EntryContainer(baseDN, backend, config, storage, this);
@@ -432,7 +432,7 @@
   *           If a configuration error occurs while opening the entry
   *           container.
   */
  private void openAndRegisterEntryContainers(WriteableStorage txn, Set<DN> baseDNs) throws StorageRuntimeException,
  private void openAndRegisterEntryContainers(WriteableTransaction txn, Set<DN> baseDNs) throws StorageRuntimeException,
      InitializationException, ConfigException
  {
    EntryID highestID = null;
@@ -632,7 +632,7 @@
      return storage.read(new ReadOperation<Long>()
      {
        @Override
        public Long run(ReadableStorage txn) throws Exception
        public Long run(ReadableTransaction txn) throws Exception
        {
          long entryCount = 0;
          for (EntryContainer ec : entryContainers.values())
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/State.java
@@ -27,10 +27,10 @@
package org.opends.server.backends.pluggable;
import org.forgerock.opendj.ldap.ByteString;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.util.StaticUtils;
/**
@@ -74,7 +74,7 @@
   * @return true if the entry was removed, false if it was not.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  boolean removeIndexTrustState(WriteableStorage txn, DatabaseContainer index) throws StorageRuntimeException
  boolean removeIndexTrustState(WriteableTransaction txn, DatabaseContainer index) throws StorageRuntimeException
  {
    ByteString key = keyForIndex(index);
    return txn.delete(getName(), key);
@@ -87,7 +87,7 @@
   * @return The trusted state of the index in the database.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  boolean getIndexTrustState(ReadableStorage txn, DatabaseContainer index)
  boolean getIndexTrustState(ReadableTransaction txn, DatabaseContainer index)
      throws StorageRuntimeException
  {
    ByteString key = keyForIndex(index);
@@ -103,7 +103,7 @@
   * @param trusted The state value to put into the database.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  void putIndexTrustState(WriteableStorage txn, DatabaseContainer index, boolean trusted)
  void putIndexTrustState(WriteableTransaction txn, DatabaseContainer index, boolean trusted)
      throws StorageRuntimeException
  {
    ByteString key = keyForIndex(index);
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/Suffix.java
@@ -35,9 +35,9 @@
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.opends.server.backends.pluggable.Importer.DNCache;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.types.AttributeType;
import org.opends.server.types.DN;
@@ -215,7 +215,7 @@
   * @throws InterruptedException If an error occurred processing the pending
   *                              map.
   */
  public boolean isParentProcessed(ReadableStorage txn, DN dn, DNCache dnCache, boolean clearedBackend)
  public boolean isParentProcessed(ReadableTransaction txn, DN dn, DNCache dnCache, boolean clearedBackend)
      throws StorageRuntimeException, InterruptedException {
    synchronized(synchObject) {
      if(parentSet.contains(dn))
@@ -258,7 +258,7 @@
   * @param trusted True if the indexes should be trusted or false otherwise.
   * @throws StorageRuntimeException If an error occurred setting the indexes to trusted.
   */
  public void setIndexesTrusted(WriteableStorage txn, boolean trusted) throws StorageRuntimeException
  public void setIndexesTrusted(WriteableTransaction txn, boolean trusted) throws StorageRuntimeException
  {
    entryContainer.getID2Children().setTrusted(txn, trusted);
    entryContainer.getID2Subtree().setTrusted(txn, trusted);
@@ -281,7 +281,7 @@
    }
  }
  private void setTrusted(WriteableStorage txn, Index index, boolean trusted)
  private void setTrusted(WriteableTransaction txn, Index index, boolean trusted)
  {
    if (index != null)
    {
@@ -289,7 +289,7 @@
    }
  }
  private void setTrusted(WriteableStorage txn, Collection<Index> indexes, boolean trusted)
  private void setTrusted(WriteableTransaction txn, Collection<Index> indexes, boolean trusted)
  {
    if (indexes != null)
    {
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/TracedStorage.java
@@ -34,14 +34,14 @@
import org.opends.server.backends.pluggable.spi.Cursor;
import org.opends.server.backends.pluggable.spi.Importer;
import org.opends.server.backends.pluggable.spi.ReadOperation;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.Storage;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.StorageStatus;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.UpdateFunction;
import org.opends.server.backends.pluggable.spi.WriteOperation;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
/**
 * Decorates a {@link Storage} with additional trace logging.
@@ -91,13 +91,13 @@
  }
  /**
   * Decorates an {@link ReadableStorage} with additional trace logging.
   * Decorates an {@link ReadableTransaction} with additional trace logging.
   */
  private final class TracedReadableStorage implements ReadableStorage
  private final class TracedReadableStorage implements ReadableTransaction
  {
    private final ReadableStorage txn;
    private final ReadableTransaction txn;
    private TracedReadableStorage(final ReadableStorage txn)
    private TracedReadableStorage(final ReadableTransaction txn)
    {
      this.txn = txn;
    }
@@ -142,13 +142,13 @@
  }
  /**
   * Decorates an {@link WriteableStorage} with additional trace logging.
   * Decorates an {@link WriteableTransaction} with additional trace logging.
   */
  private final class TracedWriteableStorage implements WriteableStorage
  private final class TracedWriteableStorage implements WriteableTransaction
  {
    private final WriteableStorage txn;
    private final WriteableTransaction txn;
    private TracedWriteableStorage(final WriteableStorage txn)
    private TracedWriteableStorage(final WriteableTransaction txn)
    {
      this.txn = txn;
    }
@@ -300,7 +300,7 @@
      op = new ReadOperation<T>()
      {
        @Override
        public T run(final ReadableStorage txn) throws Exception
        public T run(final ReadableTransaction txn) throws Exception
        {
          return readOperation.run(new TracedReadableStorage(txn));
        }
@@ -346,7 +346,7 @@
      op = new WriteOperation()
      {
        @Override
        public void run(final WriteableStorage txn) throws Exception
        public void run(final WriteableTransaction txn) throws Exception
        {
          writeOperation.run(new TracedWriteableStorage(txn));
        }
@@ -356,9 +356,9 @@
  }
  @Override
  public WriteableStorage getWriteableStorage()
  public WriteableTransaction getWriteableTransaction()
  {
    final WriteableStorage writeableStorage = storage.getWriteableStorage();
    final WriteableTransaction writeableStorage = storage.getWriteableTransaction();
    if (logger.isTraceEnabled())
    {
      return new TracedWriteableStorage(writeableStorage);
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
@@ -54,12 +54,12 @@
import org.opends.server.admin.std.meta.BackendVLVIndexCfgDefn.Scope;
import org.opends.server.admin.std.server.BackendVLVIndexCfg;
import org.opends.server.backends.pluggable.spi.Cursor;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.Storage;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.backends.pluggable.spi.TreeName;
import org.opends.server.backends.pluggable.spi.WriteOperation;
import org.opends.server.backends.pluggable.spi.WriteableStorage;
import org.opends.server.backends.pluggable.spi.WriteableTransaction;
import org.opends.server.controls.ServerSideSortRequestControl;
import org.opends.server.controls.VLVRequestControl;
import org.opends.server.controls.VLVResponseControl;
@@ -133,8 +133,8 @@
   * @throws ConfigException if a error occurs while reading the VLV index
   * configuration
   */
  VLVIndex(BackendVLVIndexCfg config, State state, Storage storage, EntryContainer entryContainer, WriteableStorage txn)
      throws StorageRuntimeException, ConfigException
  VLVIndex(BackendVLVIndexCfg config, State state, Storage storage, EntryContainer entryContainer,
      WriteableTransaction txn) throws StorageRuntimeException, ConfigException
  {
    super(new TreeName(entryContainer.getDatabasePrefix(), "vlv." + config.getName()));
@@ -227,7 +227,7 @@
  /** {@inheritDoc} */
  @Override
  void open(WriteableStorage txn) throws StorageRuntimeException
  void open(WriteableTransaction txn) throws StorageRuntimeException
  {
    super.open(txn);
@@ -397,7 +397,7 @@
   * JE database.
   * @throws DirectoryException If a Directory Server error occurs.
   */
  private SortValuesSet getSortValuesSet(ReadableStorage txn, long entryID,
  private SortValuesSet getSortValuesSet(ReadableTransaction txn, long entryID,
      ByteString[] values, AttributeType[] types) throws StorageRuntimeException,
      DirectoryException
  {
@@ -452,7 +452,7 @@
   * JE database.
   * @throws DirectoryException If a Directory Server error occurs.
   */
  private boolean containsValues(ReadableStorage txn, long entryID, ByteString[] values, AttributeType[] types)
  private boolean containsValues(ReadableTransaction txn, long entryID, ByteString[] values, AttributeType[] types)
      throws StorageRuntimeException, DirectoryException
  {
    SortValuesSet valuesSet = getSortValuesSet(txn, entryID, values, types);
@@ -486,7 +486,7 @@
   * @throws DirectoryException If a Directory Server
   * error occurs.
   */
  void updateIndex(WriteableStorage txn, TreeSet<SortValues> addedValues, TreeSet<SortValues> deletedValues)
  void updateIndex(WriteableTransaction txn, TreeSet<SortValues> addedValues, TreeSet<SortValues> deletedValues)
      throws DirectoryException, StorageRuntimeException
  {
    // Handle cases where nothing is changed early to avoid
@@ -644,7 +644,7 @@
   * @throws DirectoryException If a Directory Server error occurs.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  EntryIDSet evaluate(ReadableStorage txn,
  EntryIDSet evaluate(ReadableTransaction txn,
                             SearchOperation searchOperation,
                             ServerSideSortRequestControl sortControl,
                             VLVRequestControl vlvRequest,
@@ -940,7 +940,7 @@
   *                otherwise.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  synchronized void setTrusted(WriteableStorage txn, boolean trusted)
  synchronized void setTrusted(WriteableTransaction txn, boolean trusted)
      throws StorageRuntimeException
  {
    this.trusted = trusted;
@@ -1155,7 +1155,7 @@
      storage.write(new WriteOperation()
      {
        @Override
        public void run(WriteableStorage txn) throws Exception
        public void run(WriteableTransaction txn) throws Exception
        {
          applyConfigurationChange0(txn, cfg, ccr);
        }
@@ -1168,7 +1168,7 @@
    }
  }
  private synchronized void applyConfigurationChange0(WriteableStorage txn, BackendVLVIndexCfg cfg,
  private synchronized void applyConfigurationChange0(WriteableTransaction txn, BackendVLVIndexCfg cfg,
      ConfigChangeResult ccr)
  {
    // Update base DN only if changed..
@@ -1373,7 +1373,7 @@
    return sortOrder;
  }
  boolean verifyEntry(ReadableStorage txn, EntryID entryID, Entry entry) throws DirectoryException
  boolean verifyEntry(ReadableTransaction txn, EntryID entryID, Entry entry) throws DirectoryException
  {
    return shouldInclude(entry) && !containsValues(txn, entryID.longValue(), getSortValues(entry), getSortTypes());
  }
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VerifyJob.java
@@ -56,7 +56,7 @@
import org.opends.server.backends.VerifyConfig;
import org.opends.server.backends.pluggable.spi.Cursor;
import org.opends.server.backends.pluggable.spi.ReadOperation;
import org.opends.server.backends.pluggable.spi.ReadableStorage;
import org.opends.server.backends.pluggable.spi.ReadableTransaction;
import org.opends.server.backends.pluggable.spi.StorageRuntimeException;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.Attribute;
@@ -146,7 +146,7 @@
      return rootContainer.getStorage().read(new ReadOperation<Long>()
      {
        @Override
        public Long run(ReadableStorage txn) throws Exception
        public Long run(ReadableTransaction txn) throws Exception
        {
          return verifyBackend0(txn, rootContainer);
        }
@@ -162,7 +162,7 @@
    }
  }
  private long verifyBackend0(ReadableStorage txn, RootContainer rootContainer)
  private long verifyBackend0(ReadableTransaction txn, RootContainer rootContainer)
      throws StorageRuntimeException, DirectoryException
  {
    this.rootContainer = rootContainer;
@@ -387,7 +387,7 @@
   *
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  private void iterateID2Entry(ReadableStorage txn) throws StorageRuntimeException
  private void iterateID2Entry(ReadableTransaction txn) throws StorageRuntimeException
  {
    Cursor cursor = txn.openCursor(id2entry.getName());
    try
@@ -461,7 +461,7 @@
   * @throws StorageRuntimeException If an error occurs in the JE database.
   * @throws DirectoryException If an error occurs reading values in the index.
   */
  private void iterateIndex(ReadableStorage txn) throws StorageRuntimeException, DirectoryException
  private void iterateIndex(ReadableTransaction txn) throws StorageRuntimeException, DirectoryException
  {
    if (verifyDN2ID)
    {
@@ -498,7 +498,7 @@
   *
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  private void iterateDN2ID(ReadableStorage txn) throws StorageRuntimeException
  private void iterateDN2ID(ReadableTransaction txn) throws StorageRuntimeException
  {
    Cursor cursor = txn.openCursor(dn2id.getName());
    try
@@ -569,7 +569,7 @@
   *
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  private void iterateID2Children(ReadableStorage txn) throws StorageRuntimeException
  private void iterateID2Children(ReadableTransaction txn) throws StorageRuntimeException
  {
    Cursor cursor = txn.openCursor(id2c.getName());
    try
@@ -695,7 +695,7 @@
   *
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  private void iterateID2Subtree(ReadableStorage txn) throws StorageRuntimeException
  private void iterateID2Subtree(ReadableTransaction txn) throws StorageRuntimeException
  {
    Cursor cursor = txn.openCursor(id2s.getName());
    try
@@ -873,7 +873,7 @@
   * @throws StorageRuntimeException If an error occurs in the JE database.
   * @throws DirectoryException If an error occurs reading values in the index.
   */
  private void iterateVLVIndex(ReadableStorage txn, VLVIndex vlvIndex, boolean verifyID)
  private void iterateVLVIndex(ReadableTransaction txn, VLVIndex vlvIndex, boolean verifyID)
      throws StorageRuntimeException, DirectoryException
  {
    if(vlvIndex == null)
@@ -977,7 +977,7 @@
   * @param index The index database to be checked.
   * @throws StorageRuntimeException If an error occurs in the JE database.
   */
  private void iterateAttrIndex(ReadableStorage txn, Index index, IndexingOptions options)
  private void iterateAttrIndex(ReadableTransaction txn, Index index, IndexingOptions options)
      throws StorageRuntimeException
  {
    if (index == null)
@@ -1117,7 +1117,7 @@
   * @param entryID The entry ID.
   * @param entry The entry to be checked.
   */
  private void verifyEntry(ReadableStorage txn, EntryID entryID, Entry entry)
  private void verifyEntry(ReadableTransaction txn, EntryID entryID, Entry entry)
  {
    if (verifyDN2ID)
    {
@@ -1140,7 +1140,7 @@
   * @param entryID The entry ID.
   * @param entry The entry to be checked.
   */
  private void verifyDN2ID(ReadableStorage txn, EntryID entryID, Entry entry)
  private void verifyDN2ID(ReadableTransaction txn, EntryID entryID, Entry entry)
  {
    DN dn = entry.getName();
@@ -1209,7 +1209,7 @@
   * @param entryID The entry ID.
   * @param entry The entry to be checked.
   */
  private void verifyID2Children(ReadableStorage txn, EntryID entryID, Entry entry)
  private void verifyID2Children(ReadableTransaction txn, EntryID entryID, Entry entry)
  {
    DN dn = entry.getName();
@@ -1276,7 +1276,7 @@
   * @param entryID The entry ID.
   * @param entry The entry to be checked.
   */
  private void verifyID2Subtree(ReadableStorage txn, EntryID entryID, Entry entry)
  private void verifyID2Subtree(ReadableTransaction txn, EntryID entryID, Entry entry)
  {
    for (DN dn = getParent(entry.getName()); dn != null; dn = getParent(dn))
    {
@@ -1386,7 +1386,7 @@
   * @param entryID The entry ID.
   * @param entry The entry to be checked.
   */
  private void verifyIndex(ReadableStorage txn, EntryID entryID, Entry entry)
  private void verifyIndex(ReadableTransaction txn, EntryID entryID, Entry entry)
  {
    for (AttributeIndex attrIndex : attrIndexList)
    {
@@ -1454,8 +1454,8 @@
   * @param attrList The attribute to be checked.
   * @throws DirectoryException If a Directory Server error occurs.
   */
  private void verifyAttribute(ReadableStorage txn, AttributeIndex attrIndex, EntryID entryID, List<Attribute> attrList)
      throws DirectoryException
  private void verifyAttribute(ReadableTransaction txn, AttributeIndex attrIndex, EntryID entryID,
      List<Attribute> attrList) throws DirectoryException
  {
    if (attrList == null || attrList.isEmpty())
    {
@@ -1510,7 +1510,7 @@
    }
  }
  private void verifyAttributeInIndex(Index index, ReadableStorage txn,
  private void verifyAttributeInIndex(Index index, ReadableTransaction txn,
      ByteString key, EntryID entryID)
  {
    try
@@ -1597,7 +1597,7 @@
     * @throws StorageRuntimeException An error occurred while accessing the JE
     * database.
     */
    private ProgressTask(boolean indexIterator, ReadableStorage txn) throws StorageRuntimeException
    private ProgressTask(boolean indexIterator, ReadableTransaction txn) throws StorageRuntimeException
    {
      previousTime = System.currentTimeMillis();
@@ -1637,7 +1637,7 @@
      }
    }
    private long getRecordCount(ReadableStorage txn, Index index)
    private long getRecordCount(ReadableTransaction txn, Index index)
    {
      if (index != null)
      {
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/ReadOperation.java
@@ -43,5 +43,5 @@
   * @throws Exception
   *           if a problem occurs with the underlying storage engine
   */
  T run(ReadableStorage txn) throws Exception;
  T run(ReadableTransaction txn) throws Exception;
}
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/ReadableTransaction.java
File was renamed from opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/ReadableStorage.java
@@ -33,7 +33,7 @@
/**
 * Represents a readable transaction on a storage engine.
 */
public interface ReadableStorage extends Closeable
public interface ReadableTransaction extends Closeable
{
  /**
   * Reads the record's value associated to the provided key, in the tree whose name is provided.
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/Storage.java
@@ -80,11 +80,11 @@
  void write(WriteOperation writeOperation) throws Exception;
  /**
   * Returns a new writeable storage.
   * Returns a new writeable transaction.
   *
   * @return a new writeable storage
   * @return a new writeable transaction
   */
  WriteableStorage getWriteableStorage();
  WriteableTransaction getWriteableTransaction();
  /**
   * Remove all files for a backend of this storage.
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/WriteOperation.java
@@ -39,5 +39,5 @@
   * @throws Exception
   *           if a problem occurs with the underlying storage engine
   */
  void run(WriteableStorage txn) throws Exception;
  void run(WriteableTransaction txn) throws Exception;
}
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/WriteableTransaction.java
File was renamed from opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/spi/WriteableStorage.java
@@ -30,7 +30,7 @@
/**
 * Represents a writeable transaction on a storage engine.
 */
public interface WriteableStorage extends ReadableStorage
public interface WriteableTransaction extends ReadableTransaction
{
  /**
   * Opens the tree identified by the provided name. The tree is created if it does not already exist.