diff options
| author | ogattaz <olivier@gattaz.com> | 2014-07-24 10:15:59 +0200 |
|---|---|---|
| committer | ogattaz <olivier@gattaz.com> | 2014-07-24 10:15:59 +0200 |
| commit | c58aff0580096990b747c990dc003ef6222de72f (patch) | |
| tree | fcfba0f7a63762d229943e7abf6311040e826dce /src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java | |
| parent | 8943c56c500ef9b90a0eab8ca9f621c94e7f87ac (diff) | |
| parent | 7ed322e896143cc687e0f3ada8a659473aea0567 (diff) | |
Merge branch 'master' of ssh://dev.cccs.uwe.ac.uk:22/var/git/cristal-ldap
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);
}
|
