From 54fbe518d8e0f66c95a8825209d6a176dcb323a1 Mon Sep 17 00:00:00 2001
From: Fabio Pistolesi <fabio.pistolesi@forgerock.com>
Date: Fri, 20 Mar 2015 14:44:40 +0000
Subject: [PATCH] Preparatory commit for OPENDJ-1727, propagating a serverContext to all backends and storages to access informations about the current running environment. Changes in API only.

---
 opendj-server-legacy/src/main/java/org/opends/server/api/Backend.java |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/api/Backend.java b/opendj-server-legacy/src/main/java/org/opends/server/api/Backend.java
index 01b24a6..aacbbf7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/api/Backend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/api/Backend.java
@@ -52,6 +52,7 @@
 import org.opends.server.core.PersistentSearch;
 import org.opends.server.core.PersistentSearch.CancellationCallback;
 import org.opends.server.core.SearchOperation;
+import org.opends.server.core.ServerContext;
 import org.opends.server.monitors.BackendMonitor;
 import org.opends.server.types.AttributeType;
 import org.opends.server.types.BackupConfig;
@@ -112,15 +113,26 @@
       new ConcurrentLinkedQueue<PersistentSearch>();
 
   /**
+   * Temporarily sets up the server context for the first phase of add of a new configuration entry.
+   * Will be needed for checking storage parameters before committing the change in configuration.
+   *
+   * @param context the server context for this instance
+   */
+  public void setServerContext(ServerContext context)
+  {
+  }
+
+  /**
    * Configure this backend based on the information in the provided
    * configuration.
    *
    * @param  cfg          The configuration of this backend.
+   * @param  serverContext The server context for this instance
    *
    * @throws  ConfigException
    *                      If there is an error in the configuration.
    */
-  public abstract void configureBackend(C cfg) throws ConfigException;
+  public abstract void configureBackend(C cfg, ServerContext serverContext) throws ConfigException;
 
   /**
    * Indicates whether the provided configuration is acceptable for
@@ -166,8 +178,7 @@
    *                                   related to the server
    *                                   configuration.
    */
-  public abstract void initializeBackend()
-         throws ConfigException, InitializationException;
+  public abstract void initializeBackend() throws ConfigException, InitializationException;
 
   /**
    * Performs any necessary work to finalize this backend, including

--
Gitblit v1.10.0