directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r681997 - /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
Date Sat, 02 Aug 2008 15:31:45 GMT
Author: kayyagari
Date: Sat Aug  2 08:31:45 2008
New Revision: 681997

URL: http://svn.apache.org/viewvc?rev=681997&view=rev
Log:
added checks to avoid recording a change in changelog when a tag gets added or deleted

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=681997&r1=681996&r2=681997&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
Sat Aug  2 08:31:45 2008
@@ -51,6 +51,7 @@
 /**
  * An interceptor which intercepts write operations to the directory and
  * logs them with the server's ChangeLog service.
+ * Note: Adding/deleting a tag is not recorded as a change
  */
 public class ChangeLogInterceptor extends BaseInterceptor
 {
@@ -66,6 +67,9 @@
     /** we need the schema service to deal with special conditions */
     private SchemaService schemaService;
 
+    /** OID of the 'rev' attribute used in changeLogEvent and tag objectclasses */
+    private static final String REV_OID = "1.3.6.1.4.1.18060.0.4.1.2.47";
+    
     // -----------------------------------------------------------------------
     // Overridden init() and destroy() methods
     // -----------------------------------------------------------------------
@@ -96,11 +100,17 @@
             return;
         }
 
+        ServerEntry addEntry = opContext.getEntry();
+
+        // we don't want to record addition of a tag as a change
+        if( addEntry.get( REV_OID ) != null )
+        {
+           return; 
+        }
+        
         LdifEntry forward = new LdifEntry();
         forward.setChangeType( ChangeType.Add );
         forward.setDn( opContext.getDn().getUpName() );
-        
-        ServerEntry addEntry = opContext.getEntry();
 
         Set<AttributeType> list = addEntry.getAttributeTypes();
         
@@ -136,6 +146,12 @@
             return;
         }
 
+        // we don't want to record deleting a tag as a change
+        if( serverEntry.get( REV_OID ) != null )
+        {
+           return; 
+        }
+
         LdifEntry forward = new LdifEntry();
         forward.setChangeType( ChangeType.Delete );
         forward.setDn( opContext.getDn().getUpName() );



Mime
View raw message