directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1151204 - in /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication: ReplicaEventLog.java SyncReplConsumer.java SyncReplRequestHandler.java
Date Tue, 26 Jul 2011 18:42:07 GMT
Author: elecharny
Date: Tue Jul 26 18:42:06 2011
New Revision: 1151204

URL: http://svn.apache.org/viewvc?rev=1151204&view=rev
Log:
o Minor refactoring
o Javadoc addition

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

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLog.java?rev=1151204&r1=1151203&r2=1151204&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLog.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventLog.java
Tue Jul 26 18:42:06 2011
@@ -110,7 +110,7 @@ public class ReplicaEventLog
      */
     public void configure( final ActiveMQConnection amqConnection, final BrokerService brokerService
) throws Exception
     {
-        if ( amqSession == null || !amqSession.isRunning() )
+        if ( ( amqSession == null ) || !amqSession.isRunning() )
         {
             this.amqConnection = amqConnection;
             amqSession = ( ActiveMQSession ) amqConnection.createSession( false, ActiveMQSession.AUTO_ACKNOWLEDGE
);
@@ -146,7 +146,6 @@ public class ReplicaEventLog
         {
             LOG.warn( "Failed to insert the entry into syncrepl log", e );
         }
-
     }
 
 
@@ -330,6 +329,7 @@ public class ReplicaEventLog
     public ReplicaEventLogCursor getCursor() throws Exception
     {
         Queue regionQueue = ( Queue ) brokerService.getRegionBroker().getDestinationMap().get(
queue );
+        
         return new ReplicaEventLogCursor( amqSession, queue, regionQueue );
     }
 
@@ -340,5 +340,4 @@ public class ReplicaEventLog
         return "ClientMessageQueueLog [ipAddress=" + hostName + ", filter=" + searchFilter
+ ", replicaId=" + replicaId
             + ", lastSentCookie=" + lastSentCsn + "]";
     }
-
 }

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=1151204&r1=1151203&r2=1151204&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
Tue Jul 26 18:42:06 2011
@@ -94,7 +94,6 @@ import org.slf4j.LoggerFactory;
  */
 public class SyncReplConsumer implements ConnectionClosedEventListener, ReplicationConsumer
 {
-
     /** the syncrepl configuration */
     private SyncreplConfiguration config;
 
@@ -135,7 +134,6 @@ public class SyncReplConsumer implements
     /** the cookie that was saved last time */
     private byte[] lastSavedCookie;
 
-    private static AttributeType ENTRY_UUID_AT;
 
     private static final PresenceNode ENTRY_UUID_PRESENCE_FILTER = new PresenceNode( SchemaConstants.ENTRY_UUID_AT
);
 
@@ -143,7 +141,9 @@ public class SyncReplConsumer implements
 
     private List<Modification> cookieModLst;
 
+    /** AttributeTypes used for replication */
     private static AttributeType COOKIE_AT_TYPE;
+    private static AttributeType ENTRY_UUID_AT;
 
 
     /**
@@ -155,6 +155,10 @@ public class SyncReplConsumer implements
     }
 
 
+    /**
+     * Init the replication service
+     * @param directoryservice The directory service
+     */
     public void init( DirectoryService directoryservice ) throws Exception
     {
         this.directoryService = directoryservice;
@@ -172,10 +176,10 @@ public class SyncReplConsumer implements
         schemaManager = directoryservice.getSchemaManager();
 
         ENTRY_UUID_AT = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.ENTRY_UUID_AT
);
+        COOKIE_AT_TYPE = schemaManager.lookupAttributeTypeRegistry( "ads-replCookie" );
 
         ENTRY_UUID_ATOP_SET.add( new AttributeTypeOptions( ENTRY_UUID_AT ) );
 
-        COOKIE_AT_TYPE = schemaManager.lookupAttributeTypeRegistry( "ads-replCookie" );
         Attribute cookieAttr = new DefaultAttribute( COOKIE_AT_TYPE );
 
         Modification cookieMod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE,
cookieAttr );
@@ -186,6 +190,10 @@ public class SyncReplConsumer implements
     }
 
 
+    /**
+     * Connect to the remote servers
+     * @return
+     */
     public boolean connect()
     {
         try
@@ -197,6 +205,7 @@ public class SyncReplConsumer implements
             if ( connection == null )
             {
                 connection = new LdapNetworkConnection( providerHost, port );
+                connection.setTimeOut( -1L );
                 
                 if( config.isUseTls() )
                 {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplRequestHandler.java?rev=1151204&r1=1151203&r2=1151204&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplRequestHandler.java
Tue Jul 26 18:42:06 2011
@@ -148,6 +148,7 @@ public class SyncReplRequestHandler impl
 
             File workDir = dirService.getInstanceLayout().getLogDirectory();
             syncReplData = new File( workDir, "syncrepl-data" );
+            
             if ( !syncReplData.exists() )
             {
                 syncReplData.mkdirs();



Mime
View raw message