From db8ccd3607a951d74b373afc6ca63b3b18554ab1 Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Thu, 08 Mar 2007 08:50:49 +0000
Subject: [PATCH] Issue 613 : Add the capability to deal with schema changes made be editing the schema files : The core server provides a notification to the synchronization. The synchronization generates a pseudo changes and propagate it to the other LDAP servers through the synchronization servers.

---
 opends/src/server/org/opends/server/synchronization/plugin/MultimasterSynchronization.java |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/synchronization/plugin/MultimasterSynchronization.java b/opends/src/server/org/opends/server/synchronization/plugin/MultimasterSynchronization.java
index d0cb7b9..d11b99f 100644
--- a/opends/src/server/org/opends/server/synchronization/plugin/MultimasterSynchronization.java
+++ b/opends/src/server/org/opends/server/synchronization/plugin/MultimasterSynchronization.java
@@ -27,6 +27,7 @@
 package org.opends.server.synchronization.plugin;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.opends.server.api.ConfigAddListener;
@@ -47,6 +48,7 @@
 import org.opends.server.core.ModifyOperation;
 import org.opends.server.core.Operation;
 import org.opends.server.types.ConfigChangeResult;
+import org.opends.server.types.Modification;
 import org.opends.server.types.ResultCode;
 import org.opends.server.types.SynchronizationProviderResult;
 
@@ -535,6 +537,24 @@
     SynchronizationDomain domain = findDomain(dn, null);
     domain.backupEnd();
   }
+
+  /**
+   * This method is called whenever the server detects a modification
+   * of the schema done by directly modifying the backing files
+   * of the schema backend.
+   * Call the schema Synchronization Domain if it exists.
+   *
+   * @param  modifications  The list of modifications that was
+   *                                      applied to the schema.
+   *
+   */
+  public static void schemaChangeNotification(List<Modification> modifications)
+  {
+    SynchronizationDomain domain =
+      findDomain(DirectoryServer.getSchemaDN(), null);
+    if (domain != null)
+      domain.synchronizeModifications(modifications);
+  }
 }
 
 

--
Gitblit v1.10.0