directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1023385 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
Date Sat, 16 Oct 2010 22:14:12 GMT
Author: kayyagari
Date: Sat Oct 16 22:14:12 2010
New Revision: 1023385

URL: http://svn.apache.org/viewvc?rev=1023385&view=rev
Log:
o added code to  check for the existence of the base DN till it is available
  (this is only relevant for refresh and persist mode only)

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java?rev=1023385&r1=1023384&r2=1023385&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
Sat Oct 16 22:14:12 2010
@@ -519,6 +519,21 @@ public class SyncReplConsumer implements
         {
             try
             {
+                boolean exists;
+                
+                do
+                {
+                    // first check for the existence of base DN, if not, keep checking at
the default refresh intervals
+                    exists = connection.exists( config.getBaseDn() );
+                    
+                    if ( !exists )
+                    {
+                        LOG.warn( "replica base DN {} doesn't exist on the peer, retrying
after {} milliseconds", config.getBaseDn(), config.getRefreshInterval() );
+                        Thread.sleep( config.getRefreshInterval() );
+                    }
+                }
+                while( !exists );
+                
                 LOG.debug( "==================== Refresh And Persist ==========" );
                 doSyncSearch( SynchronizationModeEnum.REFRESH_AND_PERSIST, false );
             }



Mime
View raw message