From b892b0038d7dc619ee4fac7058189736d2d73f0d Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Thu, 07 Apr 2011 12:41:00 +0000
Subject: [PATCH] Fix OPENDJ-112 - The Changelog virtual attribute appears in al entries, should only apply to rootDSE. The changes introduce a scope in the VirtualAttributeRule. The default is Whole_Subtree. The changelog virtual attributes are now registered with a BASE_OBJECT scope and "" base DNs, meaning the rootDSE only. Also each virtual attribute provider override the hasValue() method for optimization and avoiding computing the values and throwing them away.
---
opends/src/server/org/opends/server/replication/common/LastCookieVirtualProvider.java | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/opends/src/server/org/opends/server/replication/common/LastCookieVirtualProvider.java b/opends/src/server/org/opends/server/replication/common/LastCookieVirtualProvider.java
index 9ead5f7..da4335c 100644
--- a/opends/src/server/org/opends/server/replication/common/LastCookieVirtualProvider.java
+++ b/opends/src/server/org/opends/server/replication/common/LastCookieVirtualProvider.java
@@ -23,6 +23,7 @@
*
*
* Copyright 2009 Sun Microsystems, Inc.
+ * Portions Copyright 2011 ForgeRock AS
*/
package org.opends.server.replication.common;
@@ -104,10 +105,8 @@
@Override()
public boolean hasValue(Entry entry, VirtualAttributeRule rule)
{
- // Indicates whether this virtual attribute provider will generate
- // at least one value for the provided entry.
- // True is the DN is the one of the root DSE : "".
- return entry.getDN().toNormalizedString().equalsIgnoreCase("");
+ // There's only a value for the rootDSE, i.e. the Null DN.
+ return entry.getDN().isNullDN();
}
--
Gitblit v1.10.0