directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r763407 - in /directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages: AbstractMessage.java BindRequestImpl.java
Date Wed, 08 Apr 2009 21:32:10 GMT
Author: elecharny
Date: Wed Apr  8 21:32:09 2009
New Revision: 763407

URL: http://svn.apache.org/viewvc?rev=763407&view=rev
Log:
Added a toString method

Modified:
    directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractMessage.java
    directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/BindRequestImpl.java

Modified: directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractMessage.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractMessage.java?rev=763407&r1=763406&r2=763407&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractMessage.java
(original)
+++ directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/AbstractMessage.java
Wed Apr  8 21:32:09 2009
@@ -148,4 +148,28 @@
         
         return this;
     }
+    
+    
+    /**
+     * Get a String representation of a LdapMessage
+     * 
+     * @return A LdapMessage String
+     */
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+
+        sb.append( "LdapMessage\n" );
+        sb.append( "    message Id : " ).append( messageId ).append( '\n' );
+
+        if ( controls != null )
+        {
+            for ( Control control:controls.values() )
+            {
+                sb.append( control );
+            }
+        }
+
+        return sb.toString();
+    }
 }

Modified: directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/BindRequestImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/BindRequestImpl.java?rev=763407&r1=763406&r2=763407&view=diff
==============================================================================
--- directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/BindRequestImpl.java
(original)
+++ directory/shared/branches/shared-replication/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/messages/BindRequestImpl.java
Wed Apr  8 21:32:09 2009
@@ -176,4 +176,41 @@
         
         return this;
     }
+    
+    
+    /**
+     * Get a String representation of a BindRequest
+     * 
+     * @return A BindRequest String
+     */
+    public String toString()
+    {
+        StringBuffer sb = new StringBuffer();
+        
+        sb.append( super.toString() );
+        sb.append( "    BindRequest\n" );
+        sb.append( "        Version : '" ).append( version ).append( "'\n" );
+
+        if ( ( null == name ) || StringTools.isEmpty( name.toString() ) )
+        {
+            sb.append( "        Name : anonymous\n" );
+        }
+        else
+        {
+            sb.append( "        Name : '" ).append( name ).append( "'\n" );
+
+            if ( isSimple )
+            {
+                sb.append( "        Simple authentication : '" ).append( StringTools.utf8ToString(
credentials ) ).append( "'\n" );
+            }
+            else
+            {
+                sb.append( "        Sasl authentication : \n" );
+                sb.append( "            mechanism : '" ).append(  saslMechanism ).append(
"'\n" );
+                sb.append( "            credentials : '" ).append( StringTools.utf8ToString(
credentials ) ).append( "'\n" );
+            }
+        }
+        
+        return sb.toString();
+    }
 }



Mime
View raw message