From 679051a2a5aea0a95298083f1840735ea40bc71c Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Mon, 12 Mar 2007 16:36:07 +0000
Subject: [PATCH] Provide a mechanism for the server to notify the synchronization service about any schema changes that occur. The synchronization service can already handle schema changes that occur over protocol with the server online, but this set of changes adds support for detecting schema changes made by directly editing the schema configuration files with the server offline, as well as new schema elements added through the add schema file task.
---
opends/src/server/org/opends/server/core/DirectoryServer.java | 43 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/core/DirectoryServer.java b/opends/src/server/org/opends/server/core/DirectoryServer.java
index 3a8fe1f..7ee531b 100644
--- a/opends/src/server/org/opends/server/core/DirectoryServer.java
+++ b/opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -35,6 +35,7 @@
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
@@ -141,6 +142,7 @@
import org.opends.server.types.ErrorLogSeverity;
import org.opends.server.types.InitializationException;
import org.opends.server.types.MatchingRuleUse;
+import org.opends.server.types.Modification;
import org.opends.server.types.NameForm;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.ObjectClassType;
@@ -435,6 +437,10 @@
// The set of connections that are currently established.
private LinkedHashSet<ClientConnection> establishedConnections;
+ // The set of schema changes made by editing the schema configuration files
+ // with the server offline.
+ private List<Modification> offlineSchemaChanges;
+
// The logger configuration manager for the Directory Server.
private LoggerConfigManager loggerConfigManager;
@@ -670,6 +676,7 @@
directoryServer.saslMechanismHandlers =
new ConcurrentHashMap<String,SASLMechanismHandler>();
directoryServer.authenticatedUsers = new AuthenticatedUsers();
+ directoryServer.offlineSchemaChanges = new LinkedList<Modification>();
}
@@ -2585,6 +2592,42 @@
/**
+ * Retrieves a list of modifications detailing any schema changes that may
+ * have been made with the server offline (e.g., by directly editing the
+ * schema configuration files). Note that this information will not be
+ * available until the server backends (and in particular, the schema backend)
+ * have been initialized.
+ *
+ * @return A list of modifications detailing any schema changes that may have
+ * been made with the server offline, or an empty list if no offline
+ * schema changes have been detected.
+ */
+ public static List<Modification> getOfflineSchemaChanges()
+ {
+ return directoryServer.offlineSchemaChanges;
+ }
+
+
+
+ /**
+ * Specifies a list of modifications detailing any schema changes that may
+ * have been made with the server offline.
+ *
+ * @param offlineSchemaChanges A list of modifications detailing any schema
+ * changes that may have been made with the
+ * server offline. It must not be {@code null}.
+ */
+ public static void setOfflineSchemaChanges(List<Modification>
+ offlineSchemaChanges)
+ {
+ ensureNotNull(offlineSchemaChanges);
+
+ directoryServer.offlineSchemaChanges = offlineSchemaChanges;
+ }
+
+
+
+ /**
* Retrieves the set of matching rules registered with the Directory Server.
* The mapping will be between the lowercase name or OID for each matching
* rule and the matching rule implementation. The same matching rule instance
--
Gitblit v1.10.0