[Dirconsole-cvs] dirconsole/DirConsoleJar/src/java/dirconsole/api LdapFactory.java,1.3,1.4
Brought to you by:
bavodr
|
From: Bavo De R. <ba...@us...> - 2004-07-25 19:55:22
|
Update of /cvsroot/dirconsole/dirconsole/DirConsoleJar/src/java/dirconsole/api In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7654/DirConsoleJar/src/java/dirconsole/api Modified Files: LdapFactory.java Log Message: Formatting Index: LdapFactory.java =================================================================== RCS file: /cvsroot/dirconsole/dirconsole/DirConsoleJar/src/java/dirconsole/api/LdapFactory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LdapFactory.java 24 Jul 2004 14:12:10 -0000 1.3 --- LdapFactory.java 25 Jul 2004 19:55:13 -0000 1.4 *************** *** 1,20 **** /* ! * Copyright 2001 - 2004, Bavo De Ridder * * This file is part of Directory Console. ! * ! * Directory Console is free software; you can redistribute it ! * and/or modify it under the terms of the GNU General Public License ! * as published by the Free Software Foundation; either version 2 of the ! * License, or (at your option) any later version. ! * ! * Directory Console is distributed in the hope that it will be ! * useful, but WITHOUT ANY WARRANTY; without even the implied warranty ! * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! * GNU General Public License for more details. ! * ! * You should have received a copy of the GNU General Public License ! * along with Directory Console; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston * * http://www.gnu.org/licenses/gpl.html --- 1,20 ---- /* ! * Copyright 2001 - 2004, Bavo De Ridder * * This file is part of Directory Console. ! * ! * Directory Console is free software; you can redistribute it and/or modify it ! * under the terms of the GNU General Public License as published by the Free ! * Software Foundation; either version 2 of the License, or (at your option) any ! * later version. ! * ! * Directory Console is distributed in the hope that it will be useful, but ! * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ! * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ! * details. ! * ! * You should have received a copy of the GNU General Public License along with ! * Directory Console; if not, write to the Free Software Foundation, Inc., 59 ! * Temple Place, Suite 330, Boston * * http://www.gnu.org/licenses/gpl.html *************** *** 33,67 **** /** ! * <p>This class uses the following registry keys and default values:</p> * <table border="1" cellspacing="3" cellpadding="2"> * <tr> ! * <td><b>Name</b></td> ! * <td><b>Type</b></td> ! * <td><b>Default</b></td> ! * <td><b>Description</b></td> * </tr> * <tr> ! * <td>dirconsole.api.ldap.connection.ProviderUrl</td> ! * <td>String</td> ! * <td></td> ! * <td>The provider url to use when connecting to the LDAP directory e.g. <i>ldap://10.0.0.1:389/</i></td> * </tr> * <tr> ! * <td>dirconsole.api.ldap.connection.ConnectionName</td> ! * <td>String</td> ! * <td></td> ! * <td>The DN to use when binding to the LDAP directory</td> * </tr> * <tr> ! * <td>dirconsole.api.ldap.connection.ConnectionPassword</td> ! * <td>String</td> ! * <td></td> ! * <td>The password to use when binding to the LDAP directory</td> * </tr> * <tr> ! * <td>dirconsole.api.ldap.connection.Base</td> ! * <td>String</td> ! * <td></td> ! * <td>Base context of the LDAP tree, e.g. <i>o=ACME</i></td> * </tr> * </table> --- 33,70 ---- /** ! * <p> ! * This class uses the following registry keys and default values: ! * </p> * <table border="1" cellspacing="3" cellpadding="2"> * <tr> ! * <td><b>Name </b></td> ! * <td><b>Type </b></td> ! * <td><b>Default </b></td> ! * <td><b>Description </b></td> * </tr> * <tr> ! * <td>dirconsole.api.ldap.connection.ProviderUrl</td> ! * <td>String</td> ! * <td></td> ! * <td>The provider url to use when connecting to the LDAP directory e.g. ! * <i>ldap://10.0.0.1:389/ </i></td> * </tr> * <tr> ! * <td>dirconsole.api.ldap.connection.ConnectionName</td> ! * <td>String</td> ! * <td></td> ! * <td>The DN to use when binding to the LDAP directory</td> * </tr> * <tr> ! * <td>dirconsole.api.ldap.connection.ConnectionPassword</td> ! * <td>String</td> ! * <td></td> ! * <td>The password to use when binding to the LDAP directory</td> * </tr> * <tr> ! * <td>dirconsole.api.ldap.connection.Base</td> ! * <td>String</td> ! * <td></td> ! * <td>Base context of the LDAP tree, e.g. <i>o=ACME </i></td> * </tr> * </table> *************** *** 71,82 **** public class LdapFactory { ! private static final String REG_KEY_PROVIDER_URL = ! "dirconsole.api.ldap.connection.ProviderUrl"; ! private static final String REG_KEY_CONNECTION_NAME = ! "dirconsole.api.ldap.connection.ConnectionName"; ! private static final String REG_KEY_CONNECTION_PASSWORD = ! "dirconsole.api.ldap.connection.ConnectionPassword"; ! private static final String REG_KEY_BASE = ! "dirconsole.api.ldap.connection.Base"; public static String getBaseCtx() throws LdapException --- 74,81 ---- public class LdapFactory { ! private static final String REG_KEY_PROVIDER_URL = "dirconsole.api.ldap.connection.ProviderUrl"; ! private static final String REG_KEY_CONNECTION_NAME = "dirconsole.api.ldap.connection.ConnectionName"; ! private static final String REG_KEY_CONNECTION_PASSWORD = "dirconsole.api.ldap.connection.ConnectionPassword"; ! private static final String REG_KEY_BASE = "dirconsole.api.ldap.connection.Base"; public static String getBaseCtx() throws LdapException *************** *** 94,98 **** public static DirContext getRootContext() throws LdapException { ! return getContext(""); } --- 93,104 ---- public static DirContext getRootContext() throws LdapException { ! try ! { ! return getContext(""); ! } ! catch (Exception e) ! { ! throw new LdapException("Could not create root context", e); ! } } *************** *** 102,107 **** { Hashtable env = new Hashtable(); ! env.put( ! Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, getProviderUrl() + "/" + base); --- 108,112 ---- { Hashtable env = new Hashtable(); ! env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, getProviderUrl() + "/" + base); *************** *** 114,120 **** catch (Exception e) { ! throw new LdapException( ! "Could not create context for base [" + base + "]", ! e); } } --- 119,124 ---- catch (Exception e) { ! throw new LdapException("Could not create context for base [" ! + base + "]", e); } } *************** *** 139,141 **** return StringKey.getValue(REG_KEY_BASE); } ! } --- 143,145 ---- return StringKey.getValue(REG_KEY_BASE); } ! } \ No newline at end of file |