summaryrefslogtreecommitdiff
path: root/src/main/java/com
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2014-06-05 16:13:23 +0200
committerAndrew Branson <andrew.branson@cern.ch>2014-06-05 16:13:23 +0200
commit8dbf947eb6e84ec6a3c6e9ba421c682d847a8b00 (patch)
tree0ce685c5a8d7a8855a1ab9d10219a1f7ba989140 /src/main/java/com
parent49fe139f52afcb444478400d10db41263ef1162d (diff)
Make LDAPNextKeyManager independent of the LDAPLookup. The authenticator
is the only required common component.
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java12
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPNextKeyManager.java11
2 files changed, 8 insertions, 15 deletions
diff --git a/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java
index a96a46b..10c1830 100644
--- a/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java
@@ -55,7 +55,6 @@ public class LDAPLookup implements Lookup
{
private LDAPAuthManager mLDAPAuth;
- private LDAPNextKeyManager mNextKeyManager;
private LDAPPropertyManager mPropManager;
final String mItemTypeRoot, mDomainTypeRoot, mGlobalPath, mRootPath, mLocalPath, mRolePath;
@@ -87,22 +86,11 @@ public class LDAPLookup implements Lookup
@Override
public void open(Authenticator auth) {
mLDAPAuth = (LDAPAuthManager)auth;
- mNextKeyManager = new LDAPNextKeyManager(mLDAPAuth, "cn=last,"+mItemTypeRoot);
- Gateway.getProperties().setProperty("NextKeyManager", mNextKeyManager);
Logger.msg(7, "LDAP.useOldProps="+Gateway.getProperties().getBoolean("LDAP.useOldProps", false));
mPropManager = new LDAPPropertyManager(this, mLDAPAuth);
}
/**
- * Gets the entity key generator, used to get a unique system key for new entities.
- * @return the global NextKeyManager
- */
- public LDAPNextKeyManager getNextKeyManager()
- {
- return mNextKeyManager;
- }
-
- /**
* Gets the property manager, that is used to read and write cristal properties to the LDAP store.
* @return Returns the global LDAPPropertyManager.
*/
diff --git a/src/main/java/com/c2kernel/lookup/ldap/LDAPNextKeyManager.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPNextKeyManager.java
index 4db8a49..48f938e 100644
--- a/src/main/java/com/c2kernel/lookup/ldap/LDAPNextKeyManager.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPNextKeyManager.java
@@ -8,6 +8,7 @@ import com.c2kernel.lookup.ItemPath;
import com.c2kernel.persistency.ClusterStorageException;
import com.c2kernel.persistency.NextKeyManager;
import com.c2kernel.process.Gateway;
+import com.c2kernel.process.auth.Authenticator;
import com.c2kernel.utils.Logger;
import com.novell.ldap.LDAPEntry;
@@ -26,10 +27,14 @@ public class LDAPNextKeyManager implements NextKeyManager {
LDAPAuthManager ldap;
String lastKeyPath;
- public LDAPNextKeyManager(LDAPAuthManager ldap, String lastKeyPath) {
+ public LDAPNextKeyManager() {
super();
- this.ldap = ldap;
- this.lastKeyPath = lastKeyPath;
+ LDAPProperties props = new LDAPProperties(Gateway.getProperties());
+ this.lastKeyPath = "cn=last,cn=entity,"+props.mLocalPath;
+ }
+
+ public void open(Authenticator auth) {
+ this.ldap = (LDAPAuthManager)auth;
}
@Override