summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cmscore/ldap/LdapConnModule.java
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2011-12-08 21:15:59 -0500
committerAde Lee <alee@redhat.com>2011-12-08 21:15:59 -0500
commit171aaece4f23709d33d180cf36eb3af5e454b0c9 (patch)
tree1485f9f0a7bd10de4ff25030db575dbb8dafae74 /pki/base/common/src/com/netscape/cmscore/ldap/LdapConnModule.java
parentadad2fcee8a29fdb82376fbce07dedb11fccc182 (diff)
downloadpki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.gz
pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.xz
pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.zip
Revert "Formatting"
This reverts commit 32150d3ee32f8ac27118af7c792794b538c78a2f.
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore/ldap/LdapConnModule.java')
-rw-r--r--pki/base/common/src/com/netscape/cmscore/ldap/LdapConnModule.java71
1 files changed, 38 insertions, 33 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/ldap/LdapConnModule.java b/pki/base/common/src/com/netscape/cmscore/ldap/LdapConnModule.java
index 0fa2f019..7574bf1b 100644
--- a/pki/base/common/src/com/netscape/cmscore/ldap/LdapConnModule.java
+++ b/pki/base/common/src/com/netscape/cmscore/ldap/LdapConnModule.java
@@ -17,6 +17,7 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.ldap;
+
import netscape.ldap.LDAPConnection;
import com.netscape.certsrv.apps.CMS;
@@ -33,6 +34,7 @@ import com.netscape.cmscore.ldapconn.LdapAuthInfo;
import com.netscape.cmscore.ldapconn.LdapBoundConnFactory;
import com.netscape.cmscore.ldapconn.LdapConnInfo;
+
public class LdapConnModule implements ILdapConnModule {
protected IConfigStore mConfig = null;
protected LdapBoundConnFactory mLdapConnFactory = null;
@@ -40,7 +42,7 @@ public class LdapConnModule implements ILdapConnModule {
private boolean mInited = false;
/**
- * instantiate connection factory.
+ * instantiate connection factory.
*/
public static final String PROP_LDAP = "ldap";
@@ -55,43 +57,44 @@ public class LdapConnModule implements ILdapConnModule {
protected ISubsystem mPubProcessor;
- public void init(ISubsystem p, IConfigStore config) throws EBaseException {
+ public void init(ISubsystem p,
+ IConfigStore config)
+ throws EBaseException {
CMS.debug("LdapConnModule: init called");
if (mInited) {
CMS.debug("LdapConnModule: already initialized. return.");
- return;
+ return;
}
CMS.debug("LdapConnModule: init begins");
mPubProcessor = p;
mConfig = config;
/*
- * mLdapConnFactory = new LdapBoundConnFactory();
- * mLdapConnFactory.init(mConfig.getSubStore("ldap"));
- */
+ mLdapConnFactory = new LdapBoundConnFactory();
+ mLdapConnFactory.init(mConfig.getSubStore("ldap"));
+ */
// support publishing dirsrv with different pwd than internaldb
IConfigStore ldap = mConfig.getSubStore("ldap");
- IConfigStore ldapconn = ldap
- .getSubStore(ILdapBoundConnFactory.PROP_LDAPCONNINFO);
- IConfigStore authinfo = ldap
- .getSubStore(ILdapBoundConnFactory.PROP_LDAPAUTHINFO);
- ILdapConnInfo connInfo = CMS.getLdapConnInfo(ldapconn);
- LdapAuthInfo authInfo = new LdapAuthInfo(authinfo,
- ldapconn.getString("host"), ldapconn.getInteger("port"),
- connInfo.getSecure());
-
- int minConns = mConfig.getInteger(ILdapBoundConnFactory.PROP_MINCONNS,
- 3);
- int maxConns = mConfig.getInteger(ILdapBoundConnFactory.PROP_MAXCONNS,
- 15);
+ IConfigStore ldapconn = ldap.getSubStore(
+ ILdapBoundConnFactory.PROP_LDAPCONNINFO);
+ IConfigStore authinfo = ldap.getSubStore(
+ ILdapBoundConnFactory.PROP_LDAPAUTHINFO);
+ ILdapConnInfo connInfo =
+ CMS.getLdapConnInfo(ldapconn);
+ LdapAuthInfo authInfo =
+ new LdapAuthInfo(authinfo, ldapconn.getString("host"),
+ ldapconn.getInteger("port"), connInfo.getSecure());
+
+ int minConns = mConfig.getInteger(ILdapBoundConnFactory.PROP_MINCONNS, 3);
+ int maxConns = mConfig.getInteger(ILdapBoundConnFactory.PROP_MAXCONNS, 15);
// must get authInfo from the config, don't default to internaldb!!!
- CMS.debug("Creating LdapBoundConnFactory for LdapConnModule.");
- mLdapConnFactory = new LdapBoundConnFactory(minConns, maxConns,
- (LdapConnInfo) connInfo, authInfo);
+ CMS.debug("Creating LdapBoundConnFactory for LdapConnModule.");
+ mLdapConnFactory =
+ new LdapBoundConnFactory(minConns, maxConns, (LdapConnInfo)connInfo, authInfo);
mInited = true;
@@ -99,14 +102,15 @@ public class LdapConnModule implements ILdapConnModule {
}
/**
- * Returns the internal ldap connection factory. This can be useful to get a
- * ldap connection to the ldap publishing directory without having to get it
- * again from the config file. Note that this means sharing a ldap
- * connection pool with the ldap publishing module so be sure to return
- * connections to pool. Use ILdapConnFactory.getConn() to get a Ldap
- * connection to the ldap publishing directory. Use
- * ILdapConnFactory.returnConn() to return the connection.
- *
+ * Returns the internal ldap connection factory.
+ * This can be useful to get a ldap connection to the
+ * ldap publishing directory without having to get it again from the
+ * config file. Note that this means sharing a ldap connection pool
+ * with the ldap publishing module so be sure to return connections to pool.
+ * Use ILdapConnFactory.getConn() to get a Ldap connection to the ldap
+ * publishing directory.
+ * Use ILdapConnFactory.returnConn() to return the connection.
+ *
* @see com.netscape.certsrv.ldap.ILdapBoundConnFactory
* @see com.netscape.certsrv.ldap.ILdapConnFactory
*/
@@ -123,8 +127,9 @@ public class LdapConnModule implements ILdapConnModule {
}
public void log(int level, String msg) {
- mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_LDAP, level,
- "LdapPublishModule: " + msg);
+ mLogger.log(ILogger.EV_SYSTEM, null, ILogger.S_LDAP, level,
+ "LdapPublishModule: " + msg);
}
-
+
}
+