directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r681173 - in /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog: ChangeLog.java DefaultChangeLog.java
Date Wed, 30 Jul 2008 18:47:40 GMT
Author: kayyagari
Date: Wed Jul 30 11:47:39 2008
New Revision: 681173

URL: http://svn.apache.org/viewvc?rev=681173&view=rev
Log:
added a new method to allow exposing the contents of CLS

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

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLog.java?rev=681173&r1=681172&r2=681173&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLog.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLog.java
Wed Jul 30 11:47:39 2008
@@ -177,4 +177,13 @@
     void sync() throws Exception;
 
     void destroy() throws Exception;
+    
+    /**
+     * Exposes the contents of ChangeLog to clients if set to true. Default setting is false.
+     *
+     * @param exposeChangeLog true to expose the contents, false to not expose.
+     */
+    void setExposeChangeLog( boolean exposeChangeLog );
+    
+    boolean isExposeChangeLog();
 }

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java?rev=681173&r1=681172&r2=681173&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
Wed Jul 30 11:47:39 2008
@@ -21,6 +21,7 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.authn.LdapPrincipal;
+import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 
 
@@ -38,6 +39,8 @@
     private Tag latest;
     private ChangeLogStore store = new MemoryChangeLogStore();
 
+    private boolean exposeChangeLog;
+
 
     public ChangeLogStore getChangeLogStore()
     {
@@ -59,7 +62,7 @@
 
     public ChangeLogEvent log( LdapPrincipal principal, LdifEntry forward, LdifEntry reverse
) throws Exception
     {
-        if ( ! enabled )
+        if ( !enabled )
         {
             throw new IllegalStateException( "The ChangeLog has not been enabled." );
         }
@@ -94,7 +97,7 @@
         }
 
         throw new UnsupportedOperationException(
-                "The underlying changelog store does not support searching through it's logs"
);
+            "The underlying changelog store does not support searching through it's logs"
);
     }
 
 
@@ -106,7 +109,7 @@
         }
 
         throw new UnsupportedOperationException(
-                "The underlying changelog store does not support searching through it's tags"
);
+            "The underlying changelog store does not support searching through it's tags"
);
     }
 
 
@@ -167,7 +170,7 @@
         {
             return latest;
         }
-        
+
         if ( store instanceof TaggableChangeLogStore )
         {
             return latest = ( ( TaggableChangeLogStore ) store ).getLatest();
@@ -182,6 +185,14 @@
         if ( enabled )
         {
             store.init( service );
+            
+            if( exposeChangeLog && isTagSearchSupported() )
+            {
+                Partition partition = ( ( TaggableSearchableChangeLogStore ) store ).getPartition();
+                partition.init( service );
+                
+                service.addPartition( partition );
+            }
         }
     }
 
@@ -202,4 +213,17 @@
             store.destroy();
         }
     }
+
+
+    public boolean isExposeChangeLog()
+    {
+        return exposeChangeLog;
+    }
+
+
+    public void setExposeChangeLog( boolean exposeChangeLog )
+    {
+        this.exposeChangeLog = exposeChangeLog;
+    }
+
 }



Mime
View raw message