From 528610c52f309c0fa3e5429224e106707f2cb07c Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 13 Dec 2006 00:44:34 +0000
Subject: [PATCH] Update the backend monitor entries to include a ds-backend-is-private attribute which indicates whether the associated backend is registered as a private backend.
---
opends/resource/schema/02-config.ldif | 5 ++++-
opends/src/server/org/opends/server/monitors/BackendMonitor.java | 13 +++++++++++++
opends/src/server/org/opends/server/util/ServerConstants.java | 9 +++++++++
3 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/opends/resource/schema/02-config.ldif b/opends/resource/schema/02-config.ldif
index cd3a18b..7d0cc19 100644
--- a/opends/resource/schema/02-config.ldif
+++ b/opends/resource/schema/02-config.ldif
@@ -1021,6 +1021,9 @@
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.299 NAME
'ds-connectionhandler-protocol' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE X-ORIGIN 'OpenDS Directory Server' )
+attributeTypes: ( 1.3.6.1.4.1.26027.1.1.300 NAME 'ds-backend-is-private'
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE
+ X-ORIGIN 'OpenDS Directory Server' )
objectClasses: ( 1.3.6.1.4.1.26027.1.2.1
NAME 'ds-cfg-access-control-handler' SUP top STRUCTURAL
MUST ( cn $ ds-cfg-acl-handler-class $ ds-cfg-acl-handler-enabled )
@@ -1394,7 +1397,7 @@
STRUCTURAL MUST cn X-ORIGIN 'OpenDS Directory Server' )
objectClasses: ( 1.3.6.1.4.1.26027.1.2.78 NAME 'ds-backend-monitor-entry'
SUP ds-monitor-entry STRUCTURAL MAY ( ds-backend-id $ ds-backend-base-dn $
- ds-backend-entry-count $ ds-backend-writability-mode )
+ ds-backend-entry-count $ ds-backend-writability-mode $ ds-backend-is-private )
X-ORIGIN 'OpenDS Directory Server' )
objectClasses: ( 1.3.6.1.4.1.26027.1.2.79 NAME
'ds-connectionhandler-monitor-entry' SUP ds-monitor-entry STRUCTURAL
diff --git a/opends/src/server/org/opends/server/monitors/BackendMonitor.java b/opends/src/server/org/opends/server/monitors/BackendMonitor.java
index eb910e1..4eb7e8a 100644
--- a/opends/src/server/org/opends/server/monitors/BackendMonitor.java
+++ b/opends/src/server/org/opends/server/monitors/BackendMonitor.java
@@ -35,6 +35,7 @@
import org.opends.server.api.Backend;
import org.opends.server.api.MonitorProvider;
import org.opends.server.config.ConfigEntry;
+import org.opends.server.schema.BooleanSyntax;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
@@ -73,6 +74,9 @@
// The attribute type that will be used to report the number of entries.
private AttributeType entryCountType;
+ // The attribute type that will be used to indicate if a backend is private.
+ private AttributeType isPrivateType;
+
// The attribute type that will be used to report the writability mode.
private AttributeType writabilityModeType;
@@ -122,6 +126,10 @@
DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_ENTRY_COUNT,
true);
+ isPrivateType =
+ DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_IS_PRIVATE,
+ true);
+
writabilityModeType =
DirectoryConfig.getAttributeType(ATTR_MONITOR_BACKEND_WRITABILITY_MODE,
true);
@@ -206,6 +214,11 @@
attrs.add(new Attribute(baseDNType, ATTR_MONITOR_BACKEND_BASE_DN, values));
values = new LinkedHashSet<AttributeValue>();
+ values.add(BooleanSyntax.createBooleanValue(backend.isPrivateBackend()));
+ attrs.add(new Attribute(isPrivateType, ATTR_MONITOR_BACKEND_IS_PRIVATE,
+ values));
+
+ values = new LinkedHashSet<AttributeValue>();
values.add(new AttributeValue(entryCountType,
ByteStringFactory.create(String.valueOf(backend.getEntryCount()))));
attrs.add(new Attribute(entryCountType, ATTR_MONITOR_BACKEND_ENTRY_COUNT,
diff --git a/opends/src/server/org/opends/server/util/ServerConstants.java b/opends/src/server/org/opends/server/util/ServerConstants.java
index bc74ccc..3010a9b 100644
--- a/opends/src/server/org/opends/server/util/ServerConstants.java
+++ b/opends/src/server/org/opends/server/util/ServerConstants.java
@@ -200,6 +200,15 @@
/**
+ * The name of the monitor attribute that is used to indicate whether a
+ * backend is private.
+ */
+ public static final String ATTR_MONITOR_BACKEND_IS_PRIVATE =
+ "ds-backend-is-private";
+
+
+
+ /**
* The name of the monitor attribute that is used to hold the backend entry
* count.
*/
--
Gitblit v1.10.0