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/backends/pluggable/BackendImpl.java |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java
index 70d2295..40de1cc 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/BackendImpl.java
@@ -95,6 +95,9 @@
       OID_SERVER_SIDE_SORT_REQUEST_CONTROL,
       OID_VLV_REQUEST_CONTROL));
 
+  /** The server context for this directory server. */
+  protected ServerContext serverContext;
+
   /**
    * Begin a Backend API method that accesses the database and returns the <code>EntryContainer</code> for
    * <code>entryDN</code>.
@@ -144,19 +147,19 @@
 
   /** {@inheritDoc} */
   @Override
-  public void configureBackend(C cfg) throws ConfigException
+  public void configureBackend(C cfg, ServerContext serverContext) throws ConfigException
   {
     Reject.ifNull(cfg);
 
     this.cfg = cfg;
+    this.serverContext = serverContext;
     baseDNs = this.cfg.getBaseDN().toArray(new DN[0]);
     storage = new TracedStorage(configureStorage(cfg), cfg.getBackendId());
   }
 
   /** {@inheritDoc} */
   @Override
-  public void initializeBackend()
-      throws ConfigException, InitializationException
+  public void initializeBackend() throws ConfigException, InitializationException
   {
     if (mustOpenRootContainer())
     {
@@ -801,6 +804,13 @@
 
   /** {@inheritDoc} */
   @Override
+  public void setServerContext(ServerContext context)
+  {
+    this.serverContext = context;
+  }
+
+  /** {@inheritDoc} */
+  @Override
   public boolean isConfigurationAcceptable(C config, List<LocalizableMessage> unacceptableReasons)
   {
     return isConfigurationChangeAcceptable(config, unacceptableReasons);

--
Gitblit v1.10.0