directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r752481 - in /directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl: LdapConnectionImpl.java LdapProtocolDecoder.java SyncreplConsumer.java
Date Wed, 11 Mar 2009 15:47:05 GMT
Author: elecharny
Date: Wed Mar 11 15:47:04 2009
New Revision: 752481

URL: http://svn.apache.org/viewvc?rev=752481&view=rev
Log:
Modified the generated logs which were too verbose. Fixed the PDU logs

Modified:
    directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/LdapConnectionImpl.java
    directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/LdapProtocolDecoder.java
    directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/SyncreplConsumer.java

Modified: directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/LdapConnectionImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/LdapConnectionImpl.java?rev=752481&r1=752480&r2=752481&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/LdapConnectionImpl.java
(original)
+++ directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/LdapConnectionImpl.java
Wed Mar 11 15:47:04 2009
@@ -714,7 +714,7 @@
         // Feed the response and store it into the session
         LdapMessage response = (LdapMessage)message;
 
-        LOG.debug( "-------> Messagessage received <-------" + response );
+        LOG.debug( "-------> {} Message received <-------", response.getMessageTypeName()
);
         
         switch( response.getMessageType() )
         {

Modified: directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/LdapProtocolDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/LdapProtocolDecoder.java?rev=752481&r1=752480&r2=752481&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/LdapProtocolDecoder.java
(original)
+++ directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/LdapProtocolDecoder.java
Wed Mar 11 15:47:04 2009
@@ -65,7 +65,7 @@
         Asn1Decoder ldapDecoder = new LdapDecoder();
         IAsn1Container ldapMessageContainer = (LdapMessageContainer)session.getAttribute(
"LDAP-Container" );
     	ByteBuffer buf = buffer.buf();
-
+    	int currentPos = 0;
         
         while ( buf.hasRemaining() )
         {
@@ -77,11 +77,12 @@
                 {
                     LOG.debug( "Decoding the PDU : " );
                 	int size = buf.capacity();
+                	int pos = buf.position();
                 	
-                	byte[] b = new byte[size];
-                	
-                	System.arraycopy( buf.array(), 0, b, 0, size );
+                	byte[] b = new byte[pos-currentPos];
                 	
+                	System.arraycopy( buf.array(), currentPos, b, 0, pos-currentPos );
+                	currentPos = pos;
                 	System.out.println( "Received buffer : " + StringTools.dumpBytes( b ) );
                 }
                 

Modified: directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/SyncreplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/SyncreplConsumer.java?rev=752481&r1=752480&r2=752481&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/SyncreplConsumer.java
(original)
+++ directory/apacheds/branches/apacheds-replication/mitosis/src/main/java/org/apache/directory/mitosis/syncrepl/SyncreplConsumer.java
Wed Mar 11 15:47:04 2009
@@ -450,12 +450,10 @@
 
         try
         {
-
             int pass = 1;
 
             do
             {
-
                 if( config.isRefreshPersist() )
                 {
                     syncReq.setMode( SynchronizationModeEnum.REFRESH_AND_PERSIST );
@@ -472,7 +470,16 @@
                 {
                     LOG.debug( "========================================================
Pass #" + pass + "==========" );
                     pass++;
-                    LOG.debug( "searching with searchRequest..." + StringTools.utf8ToString(
syncReq.getCookie() ) );
+                    
+                    if ( ( syncReq.getCookie() == null ) || ( syncReq.getCookie().length
== 0 ) )
+                    {
+                    	LOG.debug( "First search (no cookie)" );
+                    }
+                    else
+                    {
+                    	LOG.debug( "searching with searchRequest, cookie '{}'", StringTools.utf8ToString(
syncReq.getCookie() ) );
+                    }
+                    
                     connection.search( searchRequest );
 
                     LOG.info( "--------------------- Sleep for a little while ------------------"
);



Mime
View raw message