directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r937243 - in /directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api: LdapAsyncConnection.java LdapConnectionFactory.java
Date Fri, 23 Apr 2010 10:56:59 GMT
Author: kayyagari
Date: Fri Apr 23 10:56:59 2010
New Revision: 937243

URL: http://svn.apache.org/viewvc?rev=937243&view=rev
Log:
o fixed the CoreSessionConnection class name
o added getConfig() method to the async connection interface

Modified:
    directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
    directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionFactory.java

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java?rev=937243&r1=937242&r2=937243&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapAsyncConnection.java
Fri Apr 23 10:56:59 2010
@@ -177,4 +177,11 @@ public interface LdapAsyncConnection ext
      */
     ExtendedFuture extendedAsync( ExtendedRequest extendedRequest ) throws LdapException;
 
+    
+    /**
+     * configuration of LdapNetworkConnection
+     * 
+     * @return
+     */
+    LdapConnectionConfig getConfig();
 }
\ No newline at end of file

Modified: directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionFactory.java
URL: http://svn.apache.org/viewvc/directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionFactory.java?rev=937243&r1=937242&r2=937243&view=diff
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionFactory.java
(original)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionFactory.java
Fri Apr 23 10:56:59 2010
@@ -35,7 +35,7 @@ public class LdapConnectionFactory
     {
         try
         {
-            Class cl = Class.forName( "org.apache.directory.ldap.client.api.LdapCoreSessionConnection"
);
+            Class cl = Class.forName( "org.apache.directory.server.core.LdapCoreSessionConnection"
);
             return ( LdapConnection ) cl.newInstance();
         }
         catch( Exception e )
@@ -48,8 +48,21 @@ public class LdapConnectionFactory
     /**
      * @return the LdapNetworkConnection
      */
-    public static LdapAsyncConnection getNetworkConnection()
+    public static LdapAsyncConnection getNetworkConnection( String host, int port )
     {
-        return new LdapNetworkConnection();
+        try
+        {
+            Class cl = Class.forName( "org.apache.directory.ldap.client.api.LdapNetworkConnection"
);
+            
+            LdapAsyncConnection networkConnection = ( LdapAsyncConnection ) cl.newInstance();
+            networkConnection.getConfig().setLdapHost( host );
+            networkConnection.getConfig().setLdapPort( port );
+            
+            return networkConnection;
+        }
+        catch( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
     }
 }



Mime
View raw message