summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java')
-rw-r--r--src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java b/src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java
index 5a305f9..4762a33 100644
--- a/src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java
+++ b/src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java
@@ -4,10 +4,13 @@ import java.util.StringTokenizer;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.entity.C2KLocalObject;
-import com.c2kernel.lookup.EntityPath;
-import com.c2kernel.lookup.InvalidEntityPathException;
-import com.c2kernel.lookup.LDAPPropertyManager;
+import com.c2kernel.lookup.InvalidItemPathException;
+import com.c2kernel.lookup.ItemPath;
+import com.c2kernel.lookup.Lookup;
+import com.c2kernel.lookup.ldap.LDAPLookup;
+import com.c2kernel.lookup.ldap.LDAPPropertyManager;
import com.c2kernel.process.Gateway;
+import com.c2kernel.process.auth.Authenticator;
import com.c2kernel.property.Property;
import com.c2kernel.utils.Logger;
@@ -15,8 +18,12 @@ public class LDAPClusterStorage extends ClusterStorage {
LDAPPropertyManager ldapStore;
@Override
- public void open() throws ClusterStorageException {
- ldapStore = Gateway.getLDAPLookup().getPropManager();
+ public void open(Authenticator auth) throws ClusterStorageException {
+ Lookup lookup = Gateway.getLookup();
+ if (lookup instanceof LDAPLookup)
+ ldapStore = ((LDAPLookup)lookup).getPropManager();
+ else
+ throw new ClusterStorageException("Cannot use LDAP cluster storage without LDAP Lookup");
}
@@ -53,10 +60,10 @@ public class LDAPClusterStorage extends ClusterStorage {
throw new ClusterStorageException("Path length was invalid: "+path);
String type = tok.nextToken();
- EntityPath thisEntity;
+ ItemPath thisEntity;
try {
- thisEntity = new EntityPath(sysKey.intValue());
- } catch (InvalidEntityPathException e) {
+ thisEntity = new ItemPath(sysKey.intValue());
+ } catch (InvalidItemPathException e) {
throw new ClusterStorageException("Invalid Syskey:"+sysKey);
}
@@ -84,10 +91,10 @@ public class LDAPClusterStorage extends ClusterStorage {
String type = obj.getClusterType();
- EntityPath thisEntity;
+ ItemPath thisEntity;
try {
- thisEntity = new EntityPath(sysKey.intValue());
- } catch (InvalidEntityPathException e) {
+ thisEntity = new ItemPath(sysKey.intValue());
+ } catch (InvalidItemPathException e) {
throw new ClusterStorageException("Invalid Syskey:"+sysKey);
}
@@ -112,10 +119,10 @@ public class LDAPClusterStorage extends ClusterStorage {
throw new ClusterStorageException("Path length was invalid: "+path);
String type = tok.nextToken();
- EntityPath thisEntity;
+ ItemPath thisEntity;
try {
- thisEntity = new EntityPath(sysKey.intValue());
- } catch (InvalidEntityPathException e) {
+ thisEntity = new ItemPath(sysKey.intValue());
+ } catch (InvalidItemPathException e) {
throw new ClusterStorageException("Invalid Syskey:"+sysKey);
}
@@ -146,7 +153,7 @@ public class LDAPClusterStorage extends ClusterStorage {
String type = getClusterType(path);
try
{
- EntityPath thisEntity = new EntityPath(sysKey.intValue());
+ ItemPath thisEntity = new ItemPath(sysKey.intValue());
if (type.equals(PROPERTY))
return ldapStore.getPropertyNames(thisEntity);
else
@@ -160,7 +167,7 @@ public class LDAPClusterStorage extends ClusterStorage {
}
else
throw new ClusterStorageException("Cluster type "+type+" not supported.");
- } catch (InvalidEntityPathException e) {
+ } catch (InvalidItemPathException e) {
throw new ClusterStorageException("Invalid Syskey:"+sysKey);
} catch (ObjectNotFoundException e) {
throw new ClusterStorageException("Entity "+sysKey+" does not exist");