From 2b1ccc8723b7cce6708c6f2ac8c10fc1c670b708 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Fri, 02 Feb 2007 19:51:36 +0000
Subject: [PATCH] Add initial support for static groups.  At present, this does not allow for nested static groups, but it does handle changes to the set of available groups and to group membership while the server is online.  It also includes a backend initialization listener API, which makes it possible for components to perform custom processing when a backend is brought online or offline, and this is used to identify all groups at the time that the server is started.

---
 opends/src/server/org/opends/server/core/BackendConfigManager.java |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/BackendConfigManager.java b/opends/src/server/org/opends/server/core/BackendConfigManager.java
index bddf933..05540ae 100644
--- a/opends/src/server/org/opends/server/core/BackendConfigManager.java
+++ b/opends/src/server/org/opends/server/core/BackendConfigManager.java
@@ -36,6 +36,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 
 import org.opends.server.api.Backend;
+import org.opends.server.api.BackendInitializationListener;
 import org.opends.server.api.ConfigAddListener;
 import org.opends.server.api.ConfigChangeListener;
 import org.opends.server.api.ConfigDeleteListener;
@@ -541,6 +542,14 @@
       }
 
 
+      // Notify any backend initialization listeners.
+      for (BackendInitializationListener listener :
+           DirectoryServer.getBackendInitializationListeners())
+      {
+        listener.performBackendInitializationProcessing(backend);
+      }
+
+
       // Register the backend with the server.
       try
       {
@@ -954,6 +963,13 @@
           // Directory Server.
           registeredBackends.remove(backendDN);
           DirectoryServer.deregisterBackend(backend);
+
+          for (BackendInitializationListener listener :
+               DirectoryServer.getBackendInitializationListeners())
+          {
+            listener.performBackendFinalizationProcessing(backend);
+          }
+
           backend.finalizeBackend();
 
           // Remove the shared lock for this backend.
@@ -1337,6 +1353,15 @@
                                       messages);
       }
 
+
+      // Notify any backend initialization listeners.
+      for (BackendInitializationListener listener :
+           DirectoryServer.getBackendInitializationListeners())
+      {
+        listener.performBackendInitializationProcessing(backend);
+      }
+
+
       // Register the backend with the server.
       try
       {
@@ -2075,6 +2100,14 @@
     }
 
 
+    // Notify any backend initialization listeners.
+    for (BackendInitializationListener listener :
+         DirectoryServer.getBackendInitializationListeners())
+    {
+      listener.performBackendInitializationProcessing(backend);
+    }
+
+
     // At this point, the backend should be online.  Add it as one of the
     // registered backends for this backend config manager.
     try
@@ -2203,6 +2236,12 @@
         assert debugException(CLASS_NAME, "applyConfigurationDelete", e);
       }
 
+      for (BackendInitializationListener listener :
+           DirectoryServer.getBackendInitializationListeners())
+      {
+        listener.performBackendFinalizationProcessing(backend);
+      }
+
       DirectoryServer.deregisterBackend(backend);
 
       return new ConfigChangeResult(resultCode, adminActionRequired,

--
Gitblit v1.10.0