directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r997411 - /directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Date Wed, 15 Sep 2010 17:37:53 GMT
Author: kayyagari
Date: Wed Sep 15 17:37:53 2010
New Revision: 997411

URL: http://svn.apache.org/viewvc?rev=997411&view=rev
Log:
o updated SASL based bind methods to take controls

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

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=997411&r1=997410&r2=997411&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
(original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
Wed Sep 15 17:37:53 2010
@@ -1139,15 +1139,16 @@ public class LdapNetworkConnection exten
      * @param name the DN of the user
      * @param credentials password of the user
      * @param authzId the authorization ID (can be null)
+     * @param ctrls controls to be sent with the bind request
      * @return response of the bind operation
      * @throws LdapException
      * @throws IOException
      */
-    public BindResponse bindCramMd5( String name, byte[] credentials, String authzId )
+    public BindResponse bindCramMd5( String name, byte[] credentials, String authzId, Control...
ctrls )
         throws LdapException,
         IOException
     {
-        BindFuture bindFuture = bindSasl( name, credentials, SupportedSaslMechanisms.CRAM_MD5,
authzId, null );
+        BindFuture bindFuture = bindSasl( name, credentials, SupportedSaslMechanisms.CRAM_MD5,
authzId, null, ctrls );
 
         try
         {
@@ -1166,6 +1167,17 @@ public class LdapNetworkConnection exten
 
 
     /**
+     * @see #bindCramMd5(String, byte[], String, Control...)
+     */
+    public BindResponse bindCramMd5( String name, byte[] credentials, String authzId )
+        throws LdapException,
+        IOException
+    {
+        return bindCramMd5( name, credentials, authzId, new Control[0] );
+    }
+
+
+    /**
      * @see #bindCramMd5(String, byte[], String)
      */
     public BindResponse bindDigestMd5( String name, String credentials, String authzId, String
realmName )
@@ -1188,11 +1200,12 @@ public class LdapNetworkConnection exten
      * @throws LdapException
      * @throws IOException
      */
-    public BindResponse bindDigestMd5( String name, byte[] credentials, String authzId, String
realmName )
+    public BindResponse bindDigestMd5( String name, byte[] credentials, String authzId, String
realmName,
+        Control... ctrls )
         throws LdapException,
         IOException
     {
-        BindFuture bindFuture = bindSasl( name, credentials, SupportedSaslMechanisms.DIGEST_MD5,
authzId, realmName );
+        BindFuture bindFuture = bindSasl( name, credentials, SupportedSaslMechanisms.DIGEST_MD5,
authzId, realmName, ctrls );
 
         try
         {
@@ -1211,6 +1224,17 @@ public class LdapNetworkConnection exten
 
 
     /**
+     * @see #bindDigestMd5(String, byte[], String, String, Control...)
+     */
+    public BindResponse bindDigestMd5( String name, byte[] credentials, String authzId, String
realmName )
+        throws LdapException,
+        IOException
+    {
+        return bindDigestMd5( name, credentials, authzId, realmName, new Control[0] );
+    }
+
+
+    /**
      * {@inheritDoc}
      */
     public Cursor<Response> search( DN baseDn, String filter, SearchScope scope, String...
attributes )
@@ -3336,12 +3360,14 @@ public class LdapNetworkConnection exten
     /**
      * perform SASL based bind operation @see {@link #bindSasl(SaslRequest)} 
      */
-    private BindFuture bindSasl( String name, byte[] credentials, String saslMech, String
authzId, String realmName )
+    private BindFuture bindSasl( String name, byte[] credentials, String saslMech, String
authzId, String realmName,
+        Control... ctrls )
         throws LdapException, IOException
     {
         BindRequest bindReq = createBindRequest( name, credentials );
         bindReq.setSaslMechanism( saslMech );
         bindReq.setSimple( false );
+        bindReq.addAllControls( ctrls );
 
         SaslRequest saslReq = new SaslRequest( bindReq );
         saslReq.setRealmName( realmName );



Mime
View raw message