You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2009/07/27 01:46:09 UTC

svn commit: r798007 - /directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java

Author: elecharny
Date: Sun Jul 26 23:46:08 2009
New Revision: 798007

URL: http://svn.apache.org/viewvc?rev=798007&view=rev
Log:
Added a bind() method which takes a LdapDN instead of a String

Modified:
    directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java

Modified: directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java?rev=798007&r1=798006&r2=798007&view=diff
==============================================================================
--- directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java (original)
+++ directory/shared/trunk/client-api/src/main/java/org/apache/directory/shared/ldap/client/api/LdapConnection.java Sun Jul 26 23:46:08 2009
@@ -876,6 +876,19 @@
 
     
     /**
+     * An Unauthenticated Authentication Bind on a server. (cf RFC 4513,
+     * par 5.1.2)
+     *
+     * @param name The name we use to authenticate the user.
+     * @return The BindResponse LdapResponse 
+     */
+    public BindResponse bind( LdapDN name ) throws Exception
+    {
+        return bind( name, (byte[])null );
+    }
+
+    
+    /**
      * Simple Bind on a server.
      *
      * @param name The name we use to authenticate the user. It must be a 
@@ -894,6 +907,33 @@
      *
      * @param name The name we use to authenticate the user. It must be a 
      * valid DN
+     * @param credentials The password. It can't be null 
+     * @return The BindResponse LdapResponse 
+     */
+    public BindResponse bind( LdapDN name, String credentials ) throws LdapException
+    {
+        return bind( name, StringTools.getBytesUtf8( credentials ) );
+    }
+
+    
+    /**
+     * Simple Bind on a server.
+     *
+     * @param name The name we use to authenticate the user.
+     * @param credentials The password.
+     * @return The BindResponse LdapResponse 
+     */
+    public BindResponse bind( LdapDN name, byte[] credentials )  throws LdapException
+    {
+        return bind( name.getUpName(), credentials );
+    }
+
+    
+    /**
+     * Simple Bind on a server.
+     *
+     * @param name The name we use to authenticate the user. It must be a 
+     * valid DN
      * @param credentials The password.
      * @return The BindResponse LdapResponse 
      */