directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1435493 - in /directory: apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ apacheds/trunk/server-integ/src/test/ja...
Date Sat, 19 Jan 2013 05:44:30 GMT
Author: kayyagari
Date: Sat Jan 19 05:44:30 2013
New Revision: 1435493

URL: http://svn.apache.org/viewvc?rev=1435493&view=rev
Log:
stale replica event log detection and removal

Added:
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/StaleEventLogDetectionIT.java
    directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.920.ldif
    directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.922.ldif
Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLogJanitor.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java
    directory/apacheds/trunk/server-integ/src/test/resources/log4j.properties
    directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/SchemaConstants.java
    directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.805.ldif
    directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schemaloader/SchemaManagerEnableDisableLoadTest.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=1435493&r1=1435492&r2=1435493&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java Sat Jan 19 05:44:30 2013
@@ -1649,6 +1649,12 @@ public class LdapServer extends Director
     }
 
 
+    public ReplicationRequestHandler getReplicationReqHandler()
+    {
+        return replicationReqHandler;
+    }
+
+
     public void setReplConsumers( List<ReplicationConsumer> replConsumers )
     {
         this.replConsumers = replConsumers;

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java?rev=1435493&r1=1435492&r2=1435493&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplConsumerManager.java Sat Jan 19 05:44:30 2013
@@ -173,10 +173,14 @@ public class ReplConsumerManager
             SchemaConstants.ADS_REPL_LAST_SENT_CSN, replica.getLastSentCsn(),
             SchemaConstants.ADS_REPL_SEARCH_SCOPE, replica.getSearchCriteria().getScope().getLdapUrlValue(),
             SchemaConstants.ADS_REPL_REFRESH_N_PERSIST, String.valueOf( replica.isRefreshNPersist() ),
-            SchemaConstants.ADS_REPL_SEARCH_FILTER, replica.getSearchFilter() );
+            SchemaConstants.ADS_REPL_SEARCH_FILTER, replica.getSearchFilter(),
+            SchemaConstants.ADS_REPL_LOG_MAX_IDLE, String.valueOf( replica.getMaxIdlePeriod() ),
+            SchemaConstants.ADS_REPL_LOG_PURGE_THRESHOLD_COUNT, String.valueOf( replica.getPurgeThresholdCount() ) );
 
         adminSession.add( entry );
         
+        replica.setConsumerEntryDn( consumerDn );
+        
         LOG.debug( "stored replication consumer entry {}", consumerDn );
     }
 
@@ -323,10 +327,18 @@ public class ReplConsumerManager
         searchCriteria.setEventMask( EventType.ALL_EVENT_TYPES_MASK );
         replica.setSearchCriteria( searchCriteria );
 
+        int maxIdlePeriod = Integer.parseInt( entry.get( SchemaConstants.ADS_REPL_LOG_MAX_IDLE ).getString() );
+        replica.setMaxIdlePeriod( maxIdlePeriod );
+        
+        int purgeThreshold = Integer.parseInt( entry.get( SchemaConstants.ADS_REPL_LOG_PURGE_THRESHOLD_COUNT ).getString() );
+        replica.setPurgeThresholdCount( purgeThreshold );
+        
         // explicitly mark the replica as not-dirty, cause we just loaded it from 
         // the store, this prevents updating the replica info immediately after loading
         replica.setDirty( false );
 
+        replica.setConsumerEntryDn( entry.getDn() );
+        
         return replica;
     }
 }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java?rev=1435493&r1=1435492&r2=1435493&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLog.java Sat Jan 19 05:44:30 2013
@@ -29,6 +29,7 @@ import jdbm.recman.BaseRecordManager;
 import jdbm.recman.TransactionManager;
 
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
+import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
 import org.apache.directory.api.ldap.model.schema.comparators.SerializableComparator;
 import org.apache.directory.server.core.api.DirectoryService;
@@ -87,6 +88,12 @@ public class ReplicaEventLog implements 
     /** flag indicating refreshAndPersist mode */
     private boolean refreshNPersist;
 
+    /** the duration(in seconds) of consumer inactivity after which this log will be deleted. Defaults to 172800 seconds (i.e. 2 days) */
+    private long maxIdlePeriod = DEFAULT_MAX_IDLE_PERIOD;
+    
+    /** the minimum number of entries to be present for beginning purging entries older than the last sent CSN. Default is 10000 */
+    private int purgeThresholdCount = DEFAULT_PURGE_THRESHOLD_COUNT;
+
     // fields that won't be serialized
     /** The Journal of modifications */
     private JdbmTable<String, ReplicaEventMessage> journal;
@@ -100,9 +107,15 @@ public class ReplicaEventLog implements 
     /** A flag used to indicate that the consumer is not up to date */
     private volatile boolean dirty;
 
-    public static final String REPLICA_EVENT_LOG_NAME_PREFIX = "REPL_EVENT_LOG.";
+    /** the DN of the entry where this event log details are stored */
+    private Dn consumerEntryDn;
 
+    public static final String REPLICA_EVENT_LOG_NAME_PREFIX = "REPL_EVENT_LOG.";
 
+    public static final int DEFAULT_PURGE_THRESHOLD_COUNT = 10000;
+    
+    public static final int DEFAULT_MAX_IDLE_PERIOD = 2 * 24 * 60;
+    
     /**
      * Creates a new instance of EventLog for a replica
      * 
@@ -434,7 +447,7 @@ public class ReplicaEventLog implements 
         return journal.getName();
     }
 
-
+    
     /**
      * @return the number of entries present in the replica log
      */
@@ -451,13 +464,59 @@ public class ReplicaEventLog implements 
     }
 
 
-    /**
-     * {@inheritDoc}
-     */
+    public long getMaxIdlePeriod()
+    {
+        return maxIdlePeriod;
+    }
+
+
+    public void setMaxIdlePeriod( long maxIdlePeriod )
+    {
+        if( maxIdlePeriod <= 0 )
+        {
+            maxIdlePeriod = DEFAULT_MAX_IDLE_PERIOD;
+        }
+        
+        this.maxIdlePeriod = maxIdlePeriod;
+    }
+
+
+    public int getPurgeThresholdCount()
+    {
+        return purgeThresholdCount;
+    }
+
+
+    public void setPurgeThresholdCount( int purgeThresholdCount )
+    {
+        if( purgeThresholdCount <= 0 )
+        {
+            purgeThresholdCount = DEFAULT_PURGE_THRESHOLD_COUNT;
+        }
+        
+        this.purgeThresholdCount = purgeThresholdCount;
+    }
+
+
+    public Dn getConsumerEntryDn()
+    {
+        return consumerEntryDn;
+    }
+
+
+    public void setConsumerEntryDn( Dn consumerEntryDn )
+    {
+        this.consumerEntryDn = consumerEntryDn;
+    }
+
+
     @Override
     public String toString()
     {
-        return "ClientMessageQueueLog [ipAddress=" + hostName + ", filter=" + searchFilter + ", replicaId=" + replicaId
-            + ", lastSentCookie=" + lastSentCsn + "]";
+        return "ReplicaEventLog [hostName=" + hostName + ", searchFilter=" + searchFilter + ", lastSentCsn="
+            + lastSentCsn + ", searchCriteria=" + searchCriteria + ", replicaId=" + replicaId 
+            + ", refreshNPersist=" + refreshNPersist + ", maxInactivePeriod=" + maxIdlePeriod 
+            + ", purgeThresholdCount=" + purgeThresholdCount + ", journalFile=" + journalFile
+            + ", dirty=" + dirty + ", consumerEntryDn=" + consumerEntryDn + "]";
     }
 }

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLogJanitor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLogJanitor.java?rev=1435493&r1=1435492&r2=1435493&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLogJanitor.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/ReplicaEventLogJanitor.java Sat Jan 19 05:44:30 2013
@@ -20,11 +20,14 @@
 package org.apache.directory.server.ldap.replication.provider;
 
 
+import java.io.File;
 import java.util.Map;
 
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.csn.Csn;
+import org.apache.directory.api.ldap.model.exception.LdapException;
 import org.apache.directory.api.util.DateUtils;
+import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.ldap.replication.ReplicaEventMessage;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -39,28 +42,23 @@ public class ReplicaEventLogJanitor exte
 {
     private static final Logger LOG = LoggerFactory.getLogger( ReplicaEventLogJanitor.class );
 
-    private long thresholdCount;
-
-    private long thresholdTime;
-
+    private DirectoryService directoryService;
+    
     private Map<Integer, ReplicaEventLog> replicaLogMap;
 
     private volatile boolean stop = false;
 
-
-    public ReplicaEventLogJanitor( Map<Integer, ReplicaEventLog> replicaLogMap )
-    {
-        // if log is in refreshNpersist mode, has more than 10k entries then 
-        // all the entries before the last sent CSN and older than 5 hours will be purged
-        this( replicaLogMap, 10000, ( 5 * 60 * 60 * 1000 ) );
-    }
-
-
-    public ReplicaEventLogJanitor( Map<Integer, ReplicaEventLog> replicaLogMap, long thresholdCount, long thresholdTime )
+    /** time the janitor thread sleeps before successive cleanup attempts. Default value is 5 minutes */
+    private long sleepTime = 5 * 60 * 1000L;
+    
+    private long thresholdTime = 2 * 60 * 60 * 1000L;
+    
+    public ReplicaEventLogJanitor( final DirectoryService directoryService, final Map<Integer, ReplicaEventLog> replicaLogMap )
     {
+        // if log is in refreshNpersist mode, has more entries than the log's threshold count then 
+        // all the entries before the last sent CSN and older than 2 hours will be purged
+        this.directoryService = directoryService;
         this.replicaLogMap = replicaLogMap;
-        this.thresholdCount = thresholdCount;
-        this.thresholdTime = thresholdTime;
         setDaemon( true );
     }
 
@@ -72,60 +70,86 @@ public class ReplicaEventLogJanitor exte
         {
             for ( ReplicaEventLog log : replicaLogMap.values() )
             {
-                if ( !log.isRefreshNPersist() )
-                {
-                    continue;
-                }
-
                 synchronized ( log ) // lock the log and clean
                 {
                     try
                     {
                         String lastSentCsn = log.getLastSentCsn();
-
+                        
                         if ( lastSentCsn == null )
                         {
                             LOG.debug( "last sent CSN is null for the replica {}, skipping cleanup", log.getName() );
                             return;
                         }
-
+                        
+                        long now = DateUtils.getDate( DateUtils.getGeneralizedTime() ).getTime();
+                        
+                        long maxIdleTime = log.getMaxIdlePeriod() * 1000L;
+                        
+                        long lastUpdatedTime = new Csn( lastSentCsn ).getTimestamp();
+                        
+                        LOG.debug( "checking log idle time now={} lastUpdatedTime={} maxIdleTime={}", now, lastUpdatedTime, maxIdleTime );
+                        
+                        if( ( now - lastUpdatedTime ) >= maxIdleTime )
+                        {
+                            //max idle time of the event log reached, delete it
+                            removeEventLog( log );
+                            
+                            // delete the associated entry from DiT, note that ConsumerLogEntryDeleteListener 
+                            // will get called eventually but removeEventLog() will not be called cause by 
+                            // that time this log will not be present in replicaLogMap
+                            // The reason we don't call this method first is to guard against any rename
+                            // operation performed on the log's entry in DiT
+                            try
+                            {
+                                directoryService.getAdminSession().delete( log.getConsumerEntryDn() );
+                            }
+                            catch( LdapException e )
+                            {
+                                LOG.warn( "Failed to delete the entry {} of replica event log {}", log.getConsumerEntryDn(), log.getName(), e );
+                            }
+                            
+                            continue;
+                        }
+                        
+                        long thresholdCount = log.getPurgeThresholdCount();
+                        
                         if ( log.count() < thresholdCount )
                         {
-                            return;
+                            continue;
                         }
-
+                        
                         LOG.debug( "starting to purge the log entries that are older than {} milliseconds",
                             thresholdTime );
-
-                        long now = DateUtils.getDate( DateUtils.getGeneralizedTime() ).getTime();
-
+                        
+                        
                         long deleteCount = 0;
-
+                        
                         ReplicaJournalCursor cursor = log.getCursor( null ); // pass no CSN
                         cursor.skipQualifyingWhileFetching();
-
+                        
                         while ( cursor.next() )
                         {
                             ReplicaEventMessage message = cursor.get();
                             String csnVal = message.getEntry().get( SchemaConstants.ENTRY_CSN_AT ).getString();
-
+                            
                             // skip if we reach the lastSentCsn or got past it
                             if ( csnVal.compareTo( lastSentCsn ) >= 0 )
                             {
                                 break;
                             }
-
+                            
                             Csn csn = new Csn( csnVal );
-
+                            
                             if ( ( now - csn.getTimestamp() ) >= thresholdTime )
                             {
                                 cursor.delete();
                                 deleteCount++;
                             }
                         }
-
+                        
                         cursor.close();
-
+                        
                         LOG.debug( "purged {} messages from the log {}", deleteCount, log.getName() );
                     }
                     catch ( Exception e )
@@ -137,16 +161,52 @@ public class ReplicaEventLogJanitor exte
 
             try
             {
-                Thread.sleep( thresholdTime );
+                Thread.sleep( sleepTime );
             }
             catch ( InterruptedException e )
             {
-                LOG.warn( "ReplicaEventLogJanitor thread was interrupted, stopping the thread", e );
-                stop = true;
+                LOG.warn( "ReplicaEventLogJanitor thread was interrupted, processing logs for cleanup", e );
             }
         }
     }
 
+    
+    public synchronized void removeEventLog( ReplicaEventLog log )
+    {
+        directoryService.getEventService().removeListener( log.getPersistentListener() );
+        String name = log.getName();
+        LOG.debug( "removed the persistent listener for replication event log {}", name );
+
+        replicaLogMap.remove( log.getId() );
+        
+        try
+        {
+            log.stop();
+
+            new File( directoryService.getInstanceLayout().getReplDirectory(), name + ".db" ).delete();
+            new File( directoryService.getInstanceLayout().getReplDirectory(), name + ".lg" ).delete();
+            LOG.info( "successfully removed replication event log {}", name );
+        }
+        catch ( Exception e )
+        {
+            LOG.warn(
+                "Closing the replication event log of the entry {} was not successful, will be removed anyway",
+                name, e );
+        }
+    }
+
+    
+    public void setSleepTime( long sleepTime )
+    {
+        this.sleepTime = sleepTime;
+    }
+
+
+    public long getSleepTime()
+    {
+        return sleepTime;
+    }
+
 
     public void stopCleaning()
     {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java?rev=1435493&r1=1435492&r2=1435493&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/provider/SyncReplRequestHandler.java Sat Jan 19 05:44:30 2013
@@ -29,11 +29,11 @@ import java.io.File;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.net.InetSocketAddress;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -50,9 +50,11 @@ import org.apache.directory.api.ldap.ext
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
 import org.apache.directory.api.ldap.model.entry.Attribute;
 import org.apache.directory.api.ldap.model.entry.Entry;
+import org.apache.directory.api.ldap.model.entry.Modification;
 import org.apache.directory.api.ldap.model.entry.StringValue;
 import org.apache.directory.api.ldap.model.entry.Value;
 import org.apache.directory.api.ldap.model.exception.LdapException;
+import org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException;
 import org.apache.directory.api.ldap.model.exception.LdapURLEncodingException;
 import org.apache.directory.api.ldap.model.filter.AndNode;
 import org.apache.directory.api.ldap.model.filter.EqualityNode;
@@ -88,6 +90,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.event.NotificationCriteria;
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.api.interceptor.context.DeleteOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.ModifyOperationContext;
+import org.apache.directory.server.core.api.interceptor.context.OperationContext;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.ldap.LdapProtocolUtils;
 import org.apache.directory.server.ldap.LdapServer;
@@ -128,7 +132,7 @@ public class SyncReplRequestHandler impl
     /** The CSN AttributeType instance */
     private AttributeType CSN_AT;
 
-    private Map<Integer, ReplicaEventLog> replicaLogMap = new HashMap<Integer, ReplicaEventLog>();
+    private Map<Integer, ReplicaEventLog> replicaLogMap = new ConcurrentHashMap<Integer, ReplicaEventLog>();
 
     private File syncReplData;
 
@@ -136,10 +140,13 @@ public class SyncReplRequestHandler impl
 
     private ReplConsumerManager replicaUtil;
 
-    private ConsumerLogEntryDeleteListener cledListener;
+    private ConsumerLogEntryChangeListener cledListener;
 
     private ReplicaEventLogJanitor logJanitor;
 
+    private AttributeType REPL_LOG_MAX_IDLE_AT;
+    
+    private AttributeType REPL_LOG_PURGE_THRESHOLD_COUNT_AT;
 
     /**
      * Create a SyncReplRequestHandler empty instance 
@@ -177,6 +184,12 @@ public class SyncReplRequestHandler impl
             OBJECT_CLASS_AT = dirService.getSchemaManager()
                 .lookupAttributeTypeRegistry( SchemaConstants.OBJECT_CLASS_AT );
 
+            REPL_LOG_MAX_IDLE_AT = dirService.getSchemaManager()
+                .lookupAttributeTypeRegistry( SchemaConstants.ADS_REPL_LOG_MAX_IDLE );
+            
+            REPL_LOG_PURGE_THRESHOLD_COUNT_AT = dirService.getSchemaManager()
+                .lookupAttributeTypeRegistry( SchemaConstants.ADS_REPL_LOG_PURGE_THRESHOLD_COUNT );
+            
             // Get and create the replication directory if it does not exist
             syncReplData = dirService.getInstanceLayout().getReplDirectory();
 
@@ -193,12 +206,12 @@ public class SyncReplRequestHandler impl
 
             loadReplicaInfo();
 
-            logJanitor = new ReplicaEventLogJanitor( replicaLogMap );
+            logJanitor = new ReplicaEventLogJanitor( dirService, replicaLogMap );
             logJanitor.start();
 
             registerPersistentSearches();
 
-            cledListener = new ConsumerLogEntryDeleteListener();
+            cledListener = new ConsumerLogEntryChangeListener();
             NotificationCriteria criteria = new NotificationCriteria();
             criteria.setBase( new Dn( dirService.getSchemaManager(), ServerDNConstants.REPL_CONSUMER_DN_STR ) );
             criteria.setEventMask( EventType.DELETE );
@@ -227,10 +240,14 @@ public class SyncReplRequestHandler impl
      */
     public void stop()
     {
-        logJanitor.stopCleaning();
-
         EventService evtSrv = dirService.getEventService();
-
+        
+        evtSrv.removeListener( cledListener );
+        //first set the 'stop' flag
+        logJanitor.stopCleaning();
+        //then interrupt the janitor
+        logJanitor.interrupt();
+        
         for ( ReplicaEventLog log : replicaLogMap.values() )
         {
             try
@@ -246,8 +263,6 @@ public class SyncReplRequestHandler impl
             }
         }
 
-        evtSrv.removeListener( cledListener );
-
         initialized = false;
     }
 
@@ -323,10 +338,7 @@ public class SyncReplRequestHandler impl
             LOG.error( "Failed to handle the syncrepl request", e );
             PROVIDER_LOG.error( "Failed to handle the syncrepl request", e );
 
-            LdapException le = new LdapException( e.getMessage(), e );
-            le.initCause( e );
-
-            throw le;
+            throw new LdapException( e.getMessage(), e );
         }
     }
 
@@ -920,6 +932,18 @@ public class SyncReplRequestHandler impl
     }
 
 
+    public ReplicaEventLogJanitor getLogJanitor()
+    {
+        return logJanitor;
+    }
+
+
+    public Map<Integer, ReplicaEventLog> getReplicaLogMap()
+    {
+        return replicaLogMap;
+    }
+
+
     private EqualityNode<String> newIsReferralEqualityNode( LdapSession session ) throws Exception
     {
         EqualityNode<String> ocIsReferral = new EqualityNode<String>( SchemaConstants.OBJECT_CLASS_AT, new StringValue(
@@ -1143,50 +1167,83 @@ public class SyncReplRequestHandler impl
         return replDir.listFiles( filter );
     }
 
+    
     /**
-     * an event listener for handling deletions of replication event log entries present under ou=consumers,ou=system
+     * an event listener for handling deletions and updates of replication event log entries present under ou=consumers,ou=system
      */
-    private class ConsumerLogEntryDeleteListener extends DirectoryListenerAdapter
+    private class ConsumerLogEntryChangeListener extends DirectoryListenerAdapter
     {
+        
+        private ReplicaEventLog getEventLog( OperationContext opCtx )
+        {
+            Dn consumerLogDn = opCtx.getDn();
+            String name = ReplicaEventLog.REPLICA_EVENT_LOG_NAME_PREFIX + consumerLogDn.getRdn().getValue().getString();
+
+            for ( ReplicaEventLog log : replicaLogMap.values() )
+            {
+                if ( name.equalsIgnoreCase( log.getName() ) )
+                {
+                    return log;
+                }
+            } // end of for
+            
+            return null;
+        }
+        
         @Override
         public void entryDeleted( DeleteOperationContext deleteContext )
         {
-            Dn consumerLogDn = deleteContext.getDn();
-            String name = ReplicaEventLog.REPLICA_EVENT_LOG_NAME_PREFIX + consumerLogDn.getRdn().getValue().getString();
             // lock this listener instance
             synchronized ( this )
             {
-                for ( ReplicaEventLog log : replicaLogMap.values() )
+                ReplicaEventLog log = getEventLog( deleteContext );
+                if( log != null )
                 {
-                    if ( name.equalsIgnoreCase( log.getName() ) )
+                    logJanitor.removeEventLog( log );
+                }
+            } // end of synchronized block
+        } // end of delete method
+
+        
+        @Override
+        public void entryModified( ModifyOperationContext modifyContext )
+        {
+            List<Modification> mods = modifyContext.getModItems();
+            
+            // lock this listener instance
+            synchronized ( this )
+            {
+                for( Modification m : mods )
+                {
+                    try
                     {
-                        synchronized ( log )
+                        Attribute at = m.getAttribute();
+                        
+                        if( at.isInstanceOf( REPL_LOG_MAX_IDLE_AT ) )
                         {
-                            dirService.getEventService().removeListener( log.getPersistentListener() );
-                            LOG.debug( "removed the persistent listener for replication event log {}", consumerLogDn );
-
-                            replicaLogMap.remove( log.getId() );
-                            try
+                            ReplicaEventLog log = getEventLog( modifyContext );
+                            if( log != null )
                             {
-                                // get the correct name, just incase cause we used equalsIgnoreCase
-                                name = log.getName();
-                                log.stop();
-
-                                new File( dirService.getInstanceLayout().getReplDirectory(), name ).delete();
-                                LOG.info( "successfully removed replication event log {}", consumerLogDn );
+                                int maxIdlePeriod = Integer.parseInt( m.getAttribute().getString() );
+                                log.setMaxIdlePeriod( maxIdlePeriod );
                             }
-                            catch ( Exception e )
+                        }
+                        else if( at.isInstanceOf( REPL_LOG_PURGE_THRESHOLD_COUNT_AT ) )
+                        {
+                            ReplicaEventLog log = getEventLog( modifyContext );
+                            if( log != null )
                             {
-                                LOG.warn(
-                                    "Closing the replication event log of the entry {} was not successful, will be removed anyway",
-                                    consumerLogDn, e );
+                                int purgeThreshold = Integer.parseInt( m.getAttribute().getString() );
+                                log.setPurgeThresholdCount( purgeThreshold );
                             }
                         }
-
-                        break;
                     }
-                } // end of for
-            } // end of synchronized block
-        } // end of delete method
-    }
+                    catch( LdapInvalidAttributeValueException e )
+                    {
+                        LOG.warn( "Invalid attribute type", e );
+                    }
+                }
+            }
+        }
+    } // end of listener class
 }

Added: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/StaleEventLogDetectionIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/StaleEventLogDetectionIT.java?rev=1435493&view=auto
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/StaleEventLogDetectionIT.java (added)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/StaleEventLogDetectionIT.java Sat Jan 19 05:44:30 2013
@@ -0,0 +1,316 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+
+package org.apache.directory.server.replication;
+
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.directory.api.ldap.model.entry.DefaultEntry;
+import org.apache.directory.api.ldap.model.entry.Entry;
+import org.apache.directory.api.ldap.model.message.SearchRequest;
+import org.apache.directory.api.ldap.model.message.SearchRequestImpl;
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.server.annotations.CreateLdapServer;
+import org.apache.directory.server.annotations.CreateTransport;
+import org.apache.directory.server.core.annotations.ContextEntry;
+import org.apache.directory.server.core.annotations.CreateDS;
+import org.apache.directory.server.core.annotations.CreateIndex;
+import org.apache.directory.server.core.annotations.CreatePartition;
+import org.apache.directory.server.core.api.CoreSession;
+import org.apache.directory.server.core.api.DirectoryService;
+import org.apache.directory.server.core.api.MockDirectoryService;
+import org.apache.directory.server.core.factory.DSAnnotationProcessor;
+import org.apache.directory.server.core.integ.FrameworkRunner;
+import org.apache.directory.server.factory.ServerAnnotationProcessor;
+import org.apache.directory.server.ldap.LdapServer;
+import org.apache.directory.server.ldap.replication.SyncReplConfiguration;
+import org.apache.directory.server.ldap.replication.consumer.ReplicationConsumer;
+import org.apache.directory.server.ldap.replication.provider.ReplicaEventLog;
+import org.apache.directory.server.ldap.replication.provider.SyncReplRequestHandler;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Tests the stale event log removal capability
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StaleEventLogDetectionIT
+{
+    private static LdapServer providerServer;
+
+    private static SchemaManager schemaManager;
+
+    private static CoreSession providerSession;
+
+    private static AtomicInteger entryCount = new AtomicInteger();
+
+    private static final int INSERT_COUNT = 10;
+    
+    private static final int TOTAL_COUNT = INSERT_COUNT + 1;
+
+    private static File cookiesDir;
+    
+    @BeforeClass
+    public static void setUp() throws Exception
+    {
+        Class<?> justLoadToSetControlProperties = Class.forName( FrameworkRunner.class.getName() );
+
+        startProvider();
+
+        // Load 1000 entries
+        for ( int i = 0; i < INSERT_COUNT; i++ )
+        {
+            Entry entry = createEntry();
+
+            providerSession.add( entry );
+        }
+        
+        cookiesDir = new File( FileUtils.getTempDirectory(), MockSyncReplConsumer.COOKIES_DIR_NAME );
+    }
+
+    
+    @Before
+    @After
+    public void deleteCookies() throws IOException
+    {
+        if( cookiesDir.exists() )
+        {
+            FileUtils.cleanDirectory( cookiesDir );
+        }
+    }
+
+    
+    @AfterClass
+    public static void tearDown() throws Exception
+    {
+        providerServer.stop();
+        providerServer.getDirectoryService().shutdown();
+
+        FileUtils.deleteDirectory( providerServer.getDirectoryService().getInstanceLayout().getInstanceDirectory() );
+        FileUtils.deleteDirectory( cookiesDir );
+    }
+
+
+    private static Entry createEntry() throws Exception
+    {
+        String user = "user" + entryCount.incrementAndGet();
+
+        String dn = "cn=" + user + ",dc=example,dc=com";
+
+        DefaultEntry entry = new DefaultEntry( schemaManager, dn,
+            "objectClass", "person",
+            "cn", user,
+            "sn", user );
+
+        return entry;
+    }
+
+
+    @CreateDS(allowAnonAccess = true, name = "provider-replication", partitions =
+        {
+            @CreatePartition(
+                name = "example",
+                suffix = "dc=example,dc=com",
+                indexes =
+                    {
+                        @CreateIndex(attribute = "objectClass"),
+                        @CreateIndex(attribute = "dc"),
+                        @CreateIndex(attribute = "ou")
+                },
+                contextEntry = @ContextEntry(entryLdif =
+                    "dn: dc=example,dc=com\n" +
+                        "objectClass: domain\n" +
+                        "dc: example"))
+    })
+    @CreateLdapServer(transports =
+        { @CreateTransport(port = 16000, protocol = "LDAP") })
+    public static void startProvider() throws Exception
+    {
+        DirectoryService provDirService = DSAnnotationProcessor.getDirectoryService();
+
+        providerServer = ServerAnnotationProcessor.getLdapServer( provDirService );
+
+        providerServer.setReplicationReqHandler( new SyncReplRequestHandler() );
+        providerServer.startReplicationProducer();
+
+        Runnable r = new Runnable()
+        {
+            public void run()
+            {
+                try
+                {
+                    schemaManager = providerServer.getDirectoryService().getSchemaManager();
+                    providerSession = providerServer.getDirectoryService().getAdminSession();
+                }
+                catch ( Exception e )
+                {
+                    e.printStackTrace();
+                }
+            }
+        };
+
+        Thread t = new Thread( r );
+        t.setDaemon( true );
+        t.start();
+        t.join();
+    }
+
+
+    /**
+     * Wait for the expected number of entries to be added into the client
+     */
+    private boolean waitForSyncReplClient( ReplicationConsumer consumer, int expected ) throws Exception
+    {
+        System.out.println( "\nNbAdded every 100ms : " );
+        boolean isFirst = true;
+
+        for ( int i = 0; i < 50; i++ )
+        {
+            int nbAdded = ( ( MockSyncReplConsumer ) consumer ).getNbAdded();
+
+            if ( isFirst )
+            {
+                isFirst = false;
+            }
+            else
+            {
+                System.out.print( ", " );
+            }
+
+            System.out.print( nbAdded );
+
+            if ( nbAdded == expected )
+            {
+                return true;
+            }
+
+            Thread.sleep( 100 );
+        }
+
+        return false;
+    }
+
+
+    private ReplicationConsumer createConsumer() throws Exception
+    {
+        final ReplicationConsumer syncreplClient = new MockSyncReplConsumer();
+        final SyncReplConfiguration config = new SyncReplConfiguration();
+        config.setRemoteHost( "localhost" );
+        config.setRemotePort( 16000 );
+        config.setReplUserDn( "uid=admin,ou=system" );
+        config.setReplUserPassword( "secret".getBytes() );
+        config.setUseTls( false );
+        config.setBaseDn( "dc=example,dc=com" );
+        config.setRefreshInterval( 1000 );
+
+        syncreplClient.setConfig( config );
+
+        assertTrue( true );
+
+        Runnable consumerTask = new Runnable()
+        {
+            public void run()
+            {
+                try
+                {
+                    String baseDn = config.getBaseDn();
+
+                    SearchRequest searchRequest = new SearchRequestImpl();
+
+                    searchRequest.setBase( new Dn( baseDn ) );
+                    searchRequest.setFilter( config.getFilter() );
+                    searchRequest.setSizeLimit( config.getSearchSizeLimit() );
+                    searchRequest.setTimeLimit( config.getSearchTimeout() );
+
+                    searchRequest.setDerefAliases( config.getAliasDerefMode() );
+                    searchRequest.setScope( config.getSearchScope() );
+                    searchRequest.setTypesOnly( false );
+
+                    searchRequest.addAttributes( config.getAttributes() );
+
+                    DirectoryService directoryService = new MockDirectoryService();
+                    directoryService.setSchemaManager( schemaManager );
+                    ( ( MockSyncReplConsumer ) syncreplClient ).init( directoryService );
+                    syncreplClient.connect( true );
+                    syncreplClient.startSync();
+                }
+                catch ( Exception e )
+                {
+                    throw new RuntimeException( e );
+                }
+            }
+        };
+
+        Thread consumerThread = new Thread( consumerTask );
+        consumerThread.setDaemon( true );
+        consumerThread.start();
+
+        return syncreplClient;
+    }
+
+
+    @Test
+    public void testDeleteStaleEventLog() throws Exception
+    {
+        System.out.println( "\n---> Running testDeleteStaleEventLog" );
+
+        ReplicationConsumer consumer = createConsumer();
+
+        // We should have 1000 entries plus the base entry = TOTAL_COUNT
+        assertTrue( waitForSyncReplClient( consumer, TOTAL_COUNT ) );
+        consumer.stop();
+
+        Thread.sleep( 5 * 1000 ); // let the journal be created and put in the map
+        
+        SyncReplRequestHandler syncreplHandler = ( SyncReplRequestHandler ) providerServer.getReplicationReqHandler();
+        
+        ReplicaEventLog log = syncreplHandler.getReplicaLogMap().values().iterator().next();
+        log.setMaxIdlePeriod( 10 ); // in seconds
+        
+        syncreplHandler.getLogJanitor().setSleepTime( 1000 ); // every second
+        syncreplHandler.getLogJanitor().interrupt();
+        
+        File replDir = providerServer.getDirectoryService().getInstanceLayout().getReplDirectory();
+        File logFile = new File( replDir, log.getName() + ".db" );
+        
+        // there should be only one log file
+        assertTrue( logFile.exists() );
+        
+        // let it sleep for 10 seconds + 5 seconds (above)
+        Thread.sleep( 10 * 1000 );
+        
+        // there should be only one log file
+        assertFalse( logFile.exists() );
+        
+        System.out.println( "\n<-- Done" );
+    }
+}

Modified: directory/apacheds/trunk/server-integ/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/resources/log4j.properties?rev=1435493&r1=1435492&r2=1435493&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/resources/log4j.properties (original)
+++ directory/apacheds/trunk/server-integ/src/test/resources/log4j.properties Sat Jan 19 05:44:30 2013
@@ -51,3 +51,4 @@ log4j.logger.org.apache.directory.ldap.c
 log4j.logger.org.apache.directory.server.ldap.replication.provider=FATAL
 log4j.logger.PROVIDER_LOG=FATAL
 log4j.logger.CONSUMER_LOG=FATAL
+org.apache.directory.server.replication.MockSyncReplConsumer=FATAL

Modified: directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/SchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/SchemaConstants.java?rev=1435493&r1=1435492&r2=1435493&view=diff
==============================================================================
--- directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/SchemaConstants.java (original)
+++ directory/shared/trunk/ldap/model/src/main/java/org/apache/directory/api/ldap/model/constants/SchemaConstants.java Sat Jan 19 05:44:30 2013
@@ -639,6 +639,14 @@ public final class SchemaConstants
     public final static String ADS_REPL_ENABLED = "ads-replEnabled";
     public final static String ADS_REPL_ENABLED_OID = "1.3.6.1.4.1.18060.0.4.1.2.838";
 
+    // ads-replLogMaxIdle AT
+    public final static String ADS_REPL_LOG_MAX_IDLE = "ads-replLogMaxIdle";
+    public final static String ADS_REPL_LOG_MAX_IDLE_OID = "1.3.6.1.4.1.18060.0.4.1.2.920";
+
+    // ads-replLogPurgeThresholdCount AT
+    public final static String ADS_REPL_LOG_PURGE_THRESHOLD_COUNT = "ads-replLogPurgeThresholdCount";
+    public final static String ADS_REPL_LOG_PURGE_THRESHOLD_COUNT_OID = "1.3.6.1.4.1.18060.0.4.1.2.922";
+
     //-------------------------------------------------------------------------
     // ---- Syntaxes ----------------------------------------------------------
     //-------------------------------------------------------------------------

Added: directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.920.ldif
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou%3Dschema/cn%3Dadsconfig/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.920.ldif?rev=1435493&view=auto
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.920.ldif (added)
+++ directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.920.ldif Sat Jan 19 05:44:30 2013
@@ -0,0 +1,14 @@
+version: 1
+dn: m-oid=1.3.6.1.4.1.18060.0.4.1.2.920,ou=attributetypes,cn=adsconfig,ou=schema
+objectclass: metaAttributeType
+objectclass: metaTop
+objectclass: top
+m-oid: 1.3.6.1.4.1.18060.0.4.1.2.920
+m-name: ads-replLogMaxIdle
+m-description: the duration(in seconds) of consumer inactivity after which the a
+ ssociated log will be deleted. Defaults to 172800 seconds (i.e. 2 days)
+m-equality: bigIntegerMatch
+m-ordering: integerOrderingMatch
+m-syntax: 1.3.6.1.4.1.1466.115.121.1.27
+m-length: 0
+m-singleValue: TRUE

Added: directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.922.ldif
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou%3Dschema/cn%3Dadsconfig/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.922.ldif?rev=1435493&view=auto
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.922.ldif (added)
+++ directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.922.ldif Sat Jan 19 05:44:30 2013
@@ -0,0 +1,14 @@
+version: 1
+dn: m-oid=1.3.6.1.4.1.18060.0.4.1.2.922,ou=attributetypes,cn=adsconfig,ou=schema
+objectclass: metaAttributeType
+objectclass: metaTop
+objectclass: top
+m-oid: 1.3.6.1.4.1.18060.0.4.1.2.922
+m-name: ads-replLogPurgeThresholdCount
+m-description: the minimum number of entries to be present for beginning purging
+  entries older than the last sent CSN. Default is 10000
+m-equality: integerMatch
+m-ordering: integerOrderingMatch
+m-syntax: 1.3.6.1.4.1.1466.115.121.1.27
+m-length: 0
+m-singleValue: TRUE

Modified: directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.805.ldif
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou%3Dschema/cn%3Dadsconfig/ou%3Dobjectclasses/m-oid%3D1.3.6.1.4.1.18060.0.4.1.3.805.ldif?rev=1435493&r1=1435492&r2=1435493&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.805.ldif (original)
+++ directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.805.ldif Sat Jan 19 05:44:30 2013
@@ -13,6 +13,8 @@ m-must: ads-searchBaseDN
 m-must: ads-replSearchScope
 m-must: ads-replSearchFilter
 m-must: ads-replRefreshNPersist
+m-must: ads-replLogMaxIdle
+m-must: ads-replLogPurgeThresholdCount
 m-may: ads-replLastSentCsn
 m-may: ads-replCookie
 creatorsname: uid=admin,ou=system

Modified: directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schemaloader/SchemaManagerEnableDisableLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schemaloader/SchemaManagerEnableDisableLoadTest.java?rev=1435493&r1=1435492&r2=1435493&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schemaloader/SchemaManagerEnableDisableLoadTest.java (original)
+++ directory/shared/trunk/ldap/schema/data/src/test/java/org/apache/directory/api/ldap/schemaloader/SchemaManagerEnableDisableLoadTest.java Sat Jan 19 05:44:30 2013
@@ -157,14 +157,14 @@ public class SchemaManagerEnableDisableL
         assertEquals( 0, disabled.size() );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 414, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 416, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 48, schemaManager.getComparatorRegistry().size() );
         assertEquals( 48, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 48, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 120, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 68, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 73, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 655, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 657, schemaManager.getGlobalOidRegistry().size() );
         assertEquals( 12, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );
     }
@@ -201,14 +201,14 @@ public class SchemaManagerEnableDisableL
         assertNotNull( schemaManager.lookupAttributeTypeRegistry( "gecos" ) );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 441, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 443, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 49, schemaManager.getComparatorRegistry().size() );
         assertEquals( 49, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 49, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 133, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 70, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 75, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 698, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 700, schemaManager.getGlobalOidRegistry().size() );
         
         assertEquals( 13, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );
@@ -241,14 +241,14 @@ public class SchemaManagerEnableDisableL
         }
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 414, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 416, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 48, schemaManager.getComparatorRegistry().size() );
         assertEquals( 48, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 48, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 120, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 68, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 73, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 655, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 657, schemaManager.getGlobalOidRegistry().size() );
         
         assertEquals( 12, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNull( schemaManager.getRegistries().getLoadedSchema( "nis" ) );
@@ -293,14 +293,14 @@ public class SchemaManagerEnableDisableL
         assertNotNull( schemaManager.lookupAttributeTypeRegistry( "gecos" ) );
 
         assertTrue( schemaManager.getErrors().isEmpty() );
-        assertEquals( 488, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 490, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( 49, schemaManager.getComparatorRegistry().size() );
         assertEquals( 49, schemaManager.getMatchingRuleRegistry().size() );
         assertEquals( 49, schemaManager.getNormalizerRegistry().size() );
         assertEquals( 144, schemaManager.getObjectClassRegistry().size() );
         assertEquals( 70, schemaManager.getSyntaxCheckerRegistry().size() );
         assertEquals( 75, schemaManager.getLdapSyntaxRegistry().size() );
-        assertEquals( 756, schemaManager.getGlobalOidRegistry().size() );
+        assertEquals( 758, schemaManager.getGlobalOidRegistry().size() );
 
         assertEquals( 14, schemaManager.getRegistries().getLoadedSchemas().size() );
         assertNotNull( schemaManager.getRegistries().getLoadedSchema( "samba" ) );



Mime
View raw message