diff options
Diffstat (limited to 'src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java index 0a27a0d..372a91c 100644 --- a/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java +++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java @@ -56,17 +56,21 @@ public class LDAPLookup implements LookupManager protected LDAPAuthManager mLDAPAuth;
protected LDAPPropertyManager mPropManager;
- final String mItemTypeRoot, mDomainTypeRoot, mGlobalPath, mRootPath, mLocalPath, mRolePath;
+ private String mGlobalPath, mRootPath, mLocalPath, mRolePath, mItemTypeRoot, mDomainTypeRoot;
+ LDAPProperties ldapProps;
+ public LDAPLookup() {
+ }
+
+
/**
- * Creates a new LDAPLookup manager with the properties supplied.
- * This should be only done by the Gateway during initialisation.
- *
- * @param props The LDAP properties object that extracts LDAP connection properties from the global c2kprops
+ * Initializes the DN paths from the Root, global and local paths supplied by the LDAP properties.
+ * @param props
*/
- public LDAPLookup(LDAPProperties props)
+ protected void initPaths(LDAPProperties props)
{
Logger.msg(8,"LDAPLookup - initialising.");
+ ldapProps = props;
mGlobalPath=props.mGlobalPath;
mRootPath=props.mRootPath;
@@ -75,17 +79,20 @@ public class LDAPLookup implements LookupManager mItemTypeRoot = "cn=entity,"+props.mLocalPath;
mDomainTypeRoot = "cn=domain,"+props.mLocalPath;
mRolePath = "cn=agent,"+mDomainTypeRoot;
-
- }
-
- public LDAPLookup() {
- this(new LDAPProperties(Gateway.getProperties()));
}
+ /**
+ * Initializes the LDAPLookup manager with the Gateway properties.
+ * This should be only done by the Gateway during initialisation.
+ *
+ * @param auth A LDAPAuthManager authenticator
+ */
@Override
public void open(Authenticator auth) {
+ if (ldapProps == null)
+ initPaths(new LDAPProperties(Gateway.getProperties()));
+
mLDAPAuth = (LDAPAuthManager)auth;
- Logger.msg(7, "LDAP.useOldProps="+Gateway.getProperties().getBoolean("LDAP.useOldProps", false));
mPropManager = new LDAPPropertyManager(this, mLDAPAuth);
}
|
