directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r929311 - /directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionFactory.java
Date Tue, 30 Mar 2010 21:47:12 GMT
Author: kayyagari
Date: Tue Mar 30 21:47:11 2010
New Revision: 929311

URL: http://svn.apache.org/viewvc?rev=929311&view=rev
Log:
a connection factory for LdapConnectionS

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

Added: 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=929311&view=auto
==============================================================================
--- directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionFactory.java
(added)
+++ directory/clients/ldap/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionFactory.java
Tue Mar 30 21:47:11 2010
@@ -0,0 +1,55 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+
+package org.apache.directory.ldap.client.api;
+
+/**
+ * A LdapConnection factory
+ *  
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class LdapConnectionFactory
+{
+    /**
+     * @return a connection based on the the CoreSession
+     */
+    public static LdapConnection getCoreSessionConnection()
+    {
+        try
+        {
+            Class cl = Class.forName( "org.apache.directory.ldap.client.api.LdapCoreSessionConnection"
);
+            return ( LdapConnection ) cl.newInstance();
+        }
+        catch( Exception e )
+        {
+            throw new RuntimeException( e );
+        }
+    }
+    
+    
+    /**
+     * @return the LdapNetworkConnection
+     */
+    public static LdapAsyncConnection getNetworkConnection()
+    {
+        return new LdapNetworkConnection();
+    }
+}



Mime
View raw message