From 061cfa8f64566b1a8661fd4bc2df87dfcaa41866 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 27 Jan 2015 17:00:39 +0000
Subject: [PATCH] OPENDJ-1716 Various PluggableBackend/Storage refactorings Code review: Nicolas Capponi

---
 opendj3-server-dev/src/server/org/opends/server/backends/pluggable/AttributeIndex.java |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/opendj3-server-dev/src/server/org/opends/server/backends/pluggable/AttributeIndex.java b/opendj3-server-dev/src/server/org/opends/server/backends/pluggable/AttributeIndex.java
index 0ce0c19..d3bb424 100644
--- a/opendj3-server-dev/src/server/org/opends/server/backends/pluggable/AttributeIndex.java
+++ b/opendj3-server-dev/src/server/org/opends/server/backends/pluggable/AttributeIndex.java
@@ -27,6 +27,10 @@
  */
 package org.opends.server.backends.pluggable;
 
+import static org.opends.messages.JebMessages.*;
+import static org.opends.server.util.ServerConstants.*;
+import static org.opends.server.util.StaticUtils.*;
+
 import java.io.Closeable;
 import java.util.*;
 
@@ -53,10 +57,6 @@
 import org.opends.server.types.*;
 import org.opends.server.util.StaticUtils;
 
-import static org.opends.messages.JebMessages.*;
-import static org.opends.server.util.ServerConstants.*;
-import static org.opends.server.util.StaticUtils.*;
-
 /**
  * Class representing an attribute index.
  * We have a separate database for each type of indexing, which makes it easy
@@ -131,9 +131,11 @@
    *
    * @param indexConfig The attribute index configuration.
    * @param entryContainer The entryContainer of this attribute index.
+   * @param txn The database transaction
    * @throws ConfigException if a configuration related error occurs.
    */
-  public AttributeIndex(BackendIndexCfg indexConfig, EntryContainer entryContainer, WriteableStorage txn) throws ConfigException
+  public AttributeIndex(BackendIndexCfg indexConfig, EntryContainer entryContainer, WriteableStorage txn)
+      throws ConfigException
   {
     this.entryContainer = entryContainer;
     this.indexConfig = indexConfig;
@@ -258,6 +260,7 @@
   /**
    * Open the attribute index.
    *
+   * @param txn The database transaction
    * @throws StorageRuntimeException if a JE database error occurs while
    * opening the index.
    */
@@ -643,7 +646,7 @@
     final ConfigChangeResult ccr = new ConfigChangeResult();
     try
     {
-      entryContainer.getStorage().write(new WriteOperation()
+      entryContainer.getRootContainer().getStorage().write(new WriteOperation()
       {
         @Override
         public void run(WriteableStorage txn) throws Exception
@@ -776,7 +779,8 @@
     return rules;
   }
 
-  private void applyChangeToIndex(WriteableStorage txn, IndexType indexType, BackendIndexCfg cfg, ConfigChangeResult ccr)
+  private void applyChangeToIndex(final WriteableStorage txn, final IndexType indexType, final BackendIndexCfg cfg,
+      final ConfigChangeResult ccr)
   {
     String indexId = indexType.toString();
     Index index = nameToIndexes.get(indexId);

--
Gitblit v1.10.0