summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/c2kernel/entity/transfer/TransferSet.java2
-rw-r--r--src/main/java/com/c2kernel/lookup/AgentPath.java36
-rw-r--r--src/main/java/com/c2kernel/lookup/EntityPath.java36
-rw-r--r--src/main/java/com/c2kernel/lookup/Lookup.java74
-rw-r--r--src/main/java/com/c2kernel/lookup/Path.java29
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPAgentPath.java90
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPEntityPath.java87
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java (renamed from src/main/java/com/c2kernel/lookup/LDAPLookup.java)21
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPLookupUtils.java (renamed from src/main/java/com/c2kernel/lookup/LDAPLookupUtils.java)2
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPPathSet.java (renamed from src/main/java/com/c2kernel/lookup/LDAPPathSet.java)20
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPProperties.java (renamed from src/main/java/com/c2kernel/lookup/LDAPProperties.java)2
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPPropertyManager.java (renamed from src/main/java/com/c2kernel/lookup/LDAPPropertyManager.java)3
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LDAPRoleManager.java (renamed from src/main/java/com/c2kernel/lookup/LDAPRoleManager.java)7
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/LegacyLDAPPropertyManager.java (renamed from src/main/java/com/c2kernel/lookup/LegacyLDAPPropertyManager.java)3
-rw-r--r--src/main/java/com/c2kernel/lookup/ldap/NextKeyManager.java (renamed from src/main/java/com/c2kernel/lookup/NextKeyManager.java)5
-rw-r--r--src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java4
-rw-r--r--src/main/java/com/c2kernel/process/Gateway.java4
17 files changed, 270 insertions, 155 deletions
diff --git a/src/main/java/com/c2kernel/entity/transfer/TransferSet.java b/src/main/java/com/c2kernel/entity/transfer/TransferSet.java
index 5a8fd07..4291b21 100644
--- a/src/main/java/com/c2kernel/entity/transfer/TransferSet.java
+++ b/src/main/java/com/c2kernel/entity/transfer/TransferSet.java
@@ -4,7 +4,7 @@ import java.io.File;
import java.util.ArrayList;
import com.c2kernel.lookup.EntityPath;
-import com.c2kernel.lookup.NextKeyManager;
+import com.c2kernel.lookup.ldap.NextKeyManager;
import com.c2kernel.process.Gateway;
import com.c2kernel.utils.FileStringUtility;
import com.c2kernel.utils.Logger;
diff --git a/src/main/java/com/c2kernel/lookup/AgentPath.java b/src/main/java/com/c2kernel/lookup/AgentPath.java
index 8c83251..c200d75 100644
--- a/src/main/java/com/c2kernel/lookup/AgentPath.java
+++ b/src/main/java/com/c2kernel/lookup/AgentPath.java
@@ -15,11 +15,9 @@ import java.security.NoSuchAlgorithmException;
import org.apache.xerces.impl.dv.util.Base64;
-import com.c2kernel.common.ObjectCannotBeUpdated;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.lookup.ldap.LDAPLookupUtils;
import com.c2kernel.process.Gateway;
-import com.novell.ldap.LDAPAttribute;
-import com.novell.ldap.LDAPAttributeSet;
import com.novell.ldap.LDAPEntry;
@@ -32,8 +30,8 @@ import com.novell.ldap.LDAPEntry;
public class AgentPath extends EntityPath
{
- private String mAgentName=null;
- private String mPassword=null;
+ protected String mAgentName=null;
+ protected String mPassword=null;
public AgentPath(int syskey, String agentName)
throws InvalidAgentPathException,InvalidEntityPathException
@@ -122,33 +120,5 @@ public class AgentPath extends EntityPath
digest.append(Base64.encode(hash));
return digest.toString();
}
-
- @Override
- public LDAPAttributeSet createAttributeSet() throws ObjectCannotBeUpdated
- {
- LDAPAttributeSet attrs = new LDAPAttributeSet();
- attrs.add(new LDAPAttribute("objectclass","cristalagent"));
- attrs.add(new LDAPAttribute("intsyskey",Integer.toString(mSysKey)));
- attrs.add(new LDAPAttribute("cn", getPath()[getPath().length-1]));
- if (mIOR != null)
- attrs.add(new LDAPAttribute("ior", Gateway.getORB().object_to_string(mIOR)));
-
- if (mAgentName!=null && mAgentName.length()>0)
- attrs.add(new LDAPAttribute("uid",mAgentName));
- else
- throw new ObjectCannotBeUpdated("Cannot create agent. No userId specified", "");
-
- if (mPassword!=null && mPassword.length()>0)
- try {
- attrs.add(new LDAPAttribute("userPassword",generateUserPassword(mPassword, "SHA")));
- } catch (NoSuchAlgorithmException ex) {
- throw new ObjectCannotBeUpdated("Cryptographic libraries for password hashing not found.", "");
- }
- else
- throw new ObjectCannotBeUpdated("Cannot create agent. No password given", "");
-
- return attrs;
- }
-
}
diff --git a/src/main/java/com/c2kernel/lookup/EntityPath.java b/src/main/java/com/c2kernel/lookup/EntityPath.java
index 4f9b771..8e93f8f 100644
--- a/src/main/java/com/c2kernel/lookup/EntityPath.java
+++ b/src/main/java/com/c2kernel/lookup/EntityPath.java
@@ -12,11 +12,8 @@ package com.c2kernel.lookup;
import java.util.ArrayList;
-import com.c2kernel.common.ObjectCannotBeUpdated;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.process.Gateway;
-import com.novell.ldap.LDAPAttribute;
-import com.novell.ldap.LDAPAttributeSet;
/**
@@ -34,6 +31,8 @@ public class EntityPath extends Path
// maximum possible int syskey
public static final int maxSysKey = (int)Math.pow(10, elementNo*elementLen)-1;
protected static String mTypeRoot;
+ // ior is stored in here when it is resolved
+ protected org.omg.CORBA.Object mIOR = null;
/*
* From syskey int
* Note no EntityPath constructors allow setting of CONTEXT or ENTITY:
@@ -160,16 +159,27 @@ public class EntityPath extends Path
else
mType = Path.CONTEXT;
}
-
- @Override
- public LDAPAttributeSet createAttributeSet() throws ObjectCannotBeUpdated {
- LDAPAttributeSet attrs = new LDAPAttributeSet();
- attrs.add(new LDAPAttribute("objectclass","cristalentity"));
- attrs.add(new LDAPAttribute("intsyskey",Integer.toString(mSysKey)));
- attrs.add(new LDAPAttribute("cn", getPath()[getPath().length-1]));
- if (mIOR != null)
- attrs.add(new LDAPAttribute("ior", Gateway.getORB().object_to_string(mIOR)));
- return attrs;
+
+ // lookup sets the IOR
+ public void setIOR(org.omg.CORBA.Object IOR) {
+ mIOR = IOR;
+ if (IOR == null) mType = Path.CONTEXT;
+ else mType = Path.ENTITY;
+ }
+
+ /** Queries the lookup for the IOR
+ */
+ public org.omg.CORBA.Object getIOR() {
+ org.omg.CORBA.Object newIOR = null;
+ if (mIOR==null) { // if not cached try to resolve
+ Lookup myLookup = Gateway.getLookup();
+ try {
+ newIOR = myLookup.resolve(this);
+ } catch (ObjectNotFoundException ex) {
+ }
+ setIOR(newIOR);
+ }
+ return mIOR;
}
}
diff --git a/src/main/java/com/c2kernel/lookup/Lookup.java b/src/main/java/com/c2kernel/lookup/Lookup.java
index 0ddc448..060b5de 100644
--- a/src/main/java/com/c2kernel/lookup/Lookup.java
+++ b/src/main/java/com/c2kernel/lookup/Lookup.java
@@ -20,81 +20,41 @@
package com.c2kernel.lookup;
-import java.util.Enumeration;
-
-import org.omg.CORBA.Object;
+import java.util.Iterator;
import com.c2kernel.common.ObjectAlreadyExistsException;
import com.c2kernel.common.ObjectCannotBeUpdated;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.lookup.ldap.NextKeyManager;
public interface Lookup {
- /**
- * @param path
- * @return
- */
- public Class<?> getEntityClass(Path path) throws ObjectNotFoundException;
+ public void install() throws ObjectNotFoundException;
+
+ public void disconnect();
- /**
- * @return
- */
public NextKeyManager getNextKeyManager();
- /**
- * @return
- */
public RoleManager getRoleManager();
- /**
- * @param path
- * @return
- */
- public Object resolve(Path path) throws ObjectNotFoundException;
-
- /**
- * @param path
- * @param name
- * @return
- */
- public Enumeration<Path> search(Path path, String name);
-
- /**
- * @param newPath
- */
- public void add(Path newPath) throws ObjectCannotBeUpdated, ObjectAlreadyExistsException;
+ public Class<?> getEntityClass(Path path) throws ObjectNotFoundException;
- /**
- * @param domainPath
- * @return
- */
- public Enumeration<Path> searchEntities(Path path);
+ public EntityPath resolvePath(DomainPath domainPath) throws InvalidEntityPathException, ObjectNotFoundException;
+
+ public org.omg.CORBA.Object resolve(Path path) throws ObjectNotFoundException;
+
+ public void add(Path newPath) throws ObjectCannotBeUpdated, ObjectAlreadyExistsException;
- /**
- * @param path
- */
public void delete(Path path) throws ObjectCannotBeUpdated;
- /**
- * @param path
- * @return
- */
public boolean exists(Path path);
- /**
- * @param domainPath
- * @return
- */
- public EntityPath resolvePath(DomainPath domainPath) throws InvalidEntityPathException, ObjectNotFoundException;
-
- /**
- *
- */
- public void disconnect();
+ public Iterator<Path> search(Path path, String name);
- /**
- *
- */
- public void install() throws ObjectNotFoundException;
+ public Iterator<Path> search(Path start, String propname, String propvalue);
+
+ public Iterator<Path> searchEntities(Path path);
+
+ public Iterator<Path> searchAliases(DomainPath start);
}
diff --git a/src/main/java/com/c2kernel/lookup/Path.java b/src/main/java/com/c2kernel/lookup/Path.java
index 3ede4b6..3390007 100644
--- a/src/main/java/com/c2kernel/lookup/Path.java
+++ b/src/main/java/com/c2kernel/lookup/Path.java
@@ -15,10 +15,8 @@ import java.util.ArrayList;
import java.util.Enumeration;
import java.util.StringTokenizer;
-import com.c2kernel.common.ObjectCannotBeUpdated;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.process.Gateway;
-import com.novell.ldap.LDAPAttributeSet;
import com.novell.ldap.LDAPConnection;
import com.novell.ldap.LDAPSearchConstraints;
@@ -50,8 +48,6 @@ public abstract class Path implements Serializable
// int syskey (only valid for entity SystemPaths)
protected int mSysKey = INVALID;
- // ior is stored in here when it is resolved
- protected org.omg.CORBA.Object mIOR = null;
//
// needed for unusual subclass constructors
@@ -140,13 +136,6 @@ public abstract class Path implements Serializable
mSysKey = INVALID;
}
- // lookup sets the IOR
- public void setIOR(org.omg.CORBA.Object IOR) {
- mIOR = IOR;
- if (IOR == null) mType = Path.CONTEXT;
- else mType = Path.ENTITY;
- }
-
/* clone another path object
*/
public void setPath(Path path)
@@ -230,22 +219,6 @@ public abstract class Path implements Serializable
return Gateway.getLookup().exists(this);
}
- /** Queries the lookup for the IOR
- */
-
- public org.omg.CORBA.Object getIOR() {
- org.omg.CORBA.Object newIOR = null;
- if (mIOR==null) { // if not cached try to resolve
- Lookup myLookup = Gateway.getLookup();
- try {
- newIOR = myLookup.resolve(this);
- } catch (ObjectNotFoundException ex) {
- }
- setIOR(newIOR);
- }
- return mIOR;
- }
-
@Override
public String toString() {
return getString();
@@ -280,7 +253,7 @@ public abstract class Path implements Serializable
public abstract EntityPath getEntity() throws ObjectNotFoundException;
- public abstract LDAPAttributeSet createAttributeSet() throws ObjectCannotBeUpdated;
+ //public abstract LDAPAttributeSet createAttributeSet() throws ObjectCannotBeUpdated;
@Override
public boolean equals( Object path )
diff --git a/src/main/java/com/c2kernel/lookup/ldap/LDAPAgentPath.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPAgentPath.java
new file mode 100644
index 0000000..bae2d4f
--- /dev/null
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPAgentPath.java
@@ -0,0 +1,90 @@
+/*
+ * LDAPAgentPath.java
+ *
+ * Copyright (c) 2013, The CRISTAL Consortium. All rights reserved.
+ *
+ * CRISTAL kernel is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see:
+ * http://www.gnu.org/licenses/
+ */
+
+package com.c2kernel.lookup.ldap;
+
+import java.security.NoSuchAlgorithmException;
+
+import com.c2kernel.common.ObjectCannotBeUpdated;
+import com.c2kernel.lookup.AgentPath;
+import com.c2kernel.lookup.EntityPath;
+import com.c2kernel.lookup.InvalidAgentPathException;
+import com.c2kernel.lookup.InvalidEntityPathException;
+import com.c2kernel.process.Gateway;
+import com.novell.ldap.LDAPAttribute;
+import com.novell.ldap.LDAPAttributeSet;
+
+public class LDAPAgentPath extends AgentPath {
+
+ /**
+ * @param syskey
+ * @param agentName
+ * @throws InvalidAgentPathException
+ * @throws InvalidEntityPathException
+ */
+ public LDAPAgentPath(int syskey, String agentName)
+ throws InvalidAgentPathException, InvalidEntityPathException {
+ super(syskey, agentName);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param syskey
+ * @throws InvalidEntityPathException
+ */
+ public LDAPAgentPath(int syskey) throws InvalidEntityPathException {
+ super(syskey);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param entity
+ */
+ public LDAPAgentPath(EntityPath entity) {
+ super(entity);
+ // TODO Auto-generated constructor stub
+ }
+ @Override
+ public LDAPAttributeSet createAttributeSet() throws ObjectCannotBeUpdated
+ {
+ LDAPAttributeSet attrs = new LDAPAttributeSet();
+ attrs.add(new LDAPAttribute("objectclass","cristalagent"));
+ attrs.add(new LDAPAttribute("intsyskey",Integer.toString(mSysKey)));
+ attrs.add(new LDAPAttribute("cn", getPath()[getPath().length-1]));
+ if (mIOR != null)
+ attrs.add(new LDAPAttribute("ior", Gateway.getORB().object_to_string(mIOR)));
+
+ if (mAgentName!=null && mAgentName.length()>0)
+ attrs.add(new LDAPAttribute("uid",mAgentName));
+ else
+ throw new ObjectCannotBeUpdated("Cannot create agent. No userId specified", "");
+
+ if (mPassword!=null && mPassword.length()>0)
+ try {
+ attrs.add(new LDAPAttribute("userPassword",AgentPath.generateUserPassword(mPassword, "SHA")));
+ } catch (NoSuchAlgorithmException ex) {
+ throw new ObjectCannotBeUpdated("Cryptographic libraries for password hashing not found.", "");
+ }
+ else
+ throw new ObjectCannotBeUpdated("Cannot create agent. No password given", "");
+
+ return attrs;
+ }
+}
diff --git a/src/main/java/com/c2kernel/lookup/ldap/LDAPEntityPath.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPEntityPath.java
new file mode 100644
index 0000000..9e27525
--- /dev/null
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPEntityPath.java
@@ -0,0 +1,87 @@
+/*
+ * LDAPEntityPath.java
+ *
+ * Copyright (c) 2013, The CRISTAL Consortium. All rights reserved.
+ *
+ * CRISTAL kernel is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see:
+ * http://www.gnu.org/licenses/
+ */
+
+package com.c2kernel.lookup.ldap;
+
+import com.c2kernel.common.ObjectCannotBeUpdated;
+import com.c2kernel.lookup.EntityPath;
+import com.c2kernel.lookup.InvalidEntityPathException;
+import com.c2kernel.process.Gateway;
+import com.novell.ldap.LDAPAttribute;
+import com.novell.ldap.LDAPAttributeSet;
+
+public class LDAPEntityPath extends EntityPath {
+
+ /**
+ * @param syskey
+ * @throws InvalidEntityPathException
+ */
+ public LDAPEntityPath(int syskey) throws InvalidEntityPathException {
+ super(syskey);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ *
+ */
+ public LDAPEntityPath() {
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param path
+ * @throws InvalidEntityPathException
+ */
+ public LDAPEntityPath(String[] path) throws InvalidEntityPathException {
+ super(path);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param path
+ * @throws InvalidEntityPathException
+ */
+ public LDAPEntityPath(String path) throws InvalidEntityPathException {
+ super(path);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param parent
+ * @param child
+ * @throws InvalidEntityPathException
+ */
+ public LDAPEntityPath(EntityPath parent, String child)
+ throws InvalidEntityPathException {
+ super(parent, child);
+ // TODO Auto-generated constructor stub
+ }
+
+ @Override
+ public LDAPAttributeSet createAttributeSet() throws ObjectCannotBeUpdated {
+ LDAPAttributeSet attrs = new LDAPAttributeSet();
+ attrs.add(new LDAPAttribute("objectclass","cristalentity"));
+ attrs.add(new LDAPAttribute("intsyskey",Integer.toString(mSysKey)));
+ attrs.add(new LDAPAttribute("cn", getPath()[getPath().length-1]));
+ if (mIOR != null)
+ attrs.add(new LDAPAttribute("ior", Gateway.getORB().object_to_string(mIOR)));
+ return attrs;
+ }
+}
diff --git a/src/main/java/com/c2kernel/lookup/LDAPLookup.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java
index ab5992c..3ca1749 100644
--- a/src/main/java/com/c2kernel/lookup/LDAPLookup.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPLookup.java
@@ -3,7 +3,7 @@
* author: Florida Estrella
*/
-package com.c2kernel.lookup;
+package com.c2kernel.lookup.ldap;
import java.util.StringTokenizer;
@@ -14,6 +14,13 @@ import com.c2kernel.entity.TraceableEntity;
import com.c2kernel.entity.agent.ActiveEntity;
import com.c2kernel.entity.proxy.EntityProxyManager;
import com.c2kernel.entity.proxy.ProxyMessage;
+import com.c2kernel.lookup.AgentPath;
+import com.c2kernel.lookup.DomainPath;
+import com.c2kernel.lookup.EntityPath;
+import com.c2kernel.lookup.InvalidEntityPathException;
+import com.c2kernel.lookup.Lookup;
+import com.c2kernel.lookup.Path;
+import com.c2kernel.lookup.RolePath;
import com.c2kernel.process.Gateway;
import com.c2kernel.utils.Logger;
import com.c2kernel.utils.Resource;
@@ -296,7 +303,7 @@ public class LDAPLookup implements Lookup
}
}
}
- public void createBootTree()
+ private void createBootTree()
{
Logger.msg(8,"Initializing LDAP Boot tree");
@@ -336,7 +343,8 @@ public class LDAPLookup implements Lookup
return search(start.getFullDN(),"cn="+LDAPLookupUtils.escapeSearchFilter(filter));
}
- public LDAPPathSet search(Path start, String propname, String propvalue)
+ @Override
+ public LDAPPathSet search(Path start, String propname, String propvalue)
{
String val = propname+":"+propvalue;
Logger.msg(8,"LDAPLookup::search() From " + start.getDN() + " for cristalprop=" + val );
@@ -380,7 +388,8 @@ public class LDAPLookup implements Lookup
return search(start.getFullDN(), LDAPConnection.SCOPE_SUB, "objectClass=cristalentity", searchCons);
}
- public LDAPPathSet searchAliases(DomainPath start) {
+ @Override
+ public LDAPPathSet searchAliases(DomainPath start) {
LDAPSearchConstraints searchCons = new LDAPSearchConstraints();
searchCons.setBatchSize(0);
searchCons.setDereference(LDAPSearchConstraints.DEREF_NEVER);
@@ -469,6 +478,8 @@ public class LDAPLookup implements Lookup
entityPath.setDN(dn);
}
thisPath = entityPath;
+ //set IOR if we have one
+ if (ior!=null) entityPath.setIOR(ior);
}
else
throw new ObjectNotFoundException("Entity found outside entity tree");
@@ -478,8 +489,6 @@ public class LDAPLookup implements Lookup
throw new ObjectNotFoundException("Unrecognised LDAP entry. Not a cristal entry");
}
- //set IOR if we have one
- if (ior!=null) thisPath.setIOR(ior);
return thisPath;
}
}
diff --git a/src/main/java/com/c2kernel/lookup/LDAPLookupUtils.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPLookupUtils.java
index d8a4394..acf74e0 100644
--- a/src/main/java/com/c2kernel/lookup/LDAPLookupUtils.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPLookupUtils.java
@@ -2,7 +2,7 @@
* Lookup helper class.
*/
-package com.c2kernel.lookup;
+package com.c2kernel.lookup.ldap;
//import netscape.ldap.*;
//import netscape.ldap.util.*;
diff --git a/src/main/java/com/c2kernel/lookup/LDAPPathSet.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPPathSet.java
index 1ebd97d..ffd8010 100644
--- a/src/main/java/com/c2kernel/lookup/LDAPPathSet.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPPathSet.java
@@ -1,7 +1,8 @@
-package com.c2kernel.lookup;
+package com.c2kernel.lookup.ldap;
-import java.util.Enumeration;
+import java.util.Iterator;
+import com.c2kernel.lookup.Path;
import com.c2kernel.process.Gateway;
import com.c2kernel.utils.Logger;
import com.novell.ldap.LDAPEntry;
@@ -19,7 +20,7 @@ import com.novell.ldap.LDAPSearchResults;
-public class LDAPPathSet implements Enumeration<Path> {
+public class LDAPPathSet implements Iterator<Path> {
LDAPSearchResults results;
LDAPEntry nextEntry;
@@ -32,7 +33,7 @@ public class LDAPPathSet implements Enumeration<Path> {
}
@Override
- public boolean hasMoreElements() {
+ public boolean hasNext() {
if (results == null) return false;
if (nextEntry != null) return true;
if (results.hasMore())
@@ -49,7 +50,7 @@ public class LDAPPathSet implements Enumeration<Path> {
}
@Override
- public Path nextElement() {
+ public Path next() {
if (results == null) return null;
try {
if (nextEntry == null)
@@ -61,12 +62,17 @@ public class LDAPPathSet implements Enumeration<Path> {
Logger.error("Error loading next path");
Logger.error(ex);
nextEntry = null;
- if (hasMoreElements()) {
+ if (hasNext()) {
Logger.error("Skipping to next entry");
- return nextElement();
+ return next();
}
else
return null;
}
}
+
+ @Override
+ public void remove() {
+ throw new RuntimeException("Not implemented");
+ }
}
diff --git a/src/main/java/com/c2kernel/lookup/LDAPProperties.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPProperties.java
index a9ae699..3f48935 100644
--- a/src/main/java/com/c2kernel/lookup/LDAPProperties.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPProperties.java
@@ -2,7 +2,7 @@
* Directory Lookup Service
*/
-package com.c2kernel.lookup;
+package com.c2kernel.lookup.ldap;
import java.math.BigInteger;
import java.security.SecureRandom;
diff --git a/src/main/java/com/c2kernel/lookup/LDAPPropertyManager.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPPropertyManager.java
index 57ed17d..2332fb5 100644
--- a/src/main/java/com/c2kernel/lookup/LDAPPropertyManager.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPPropertyManager.java
@@ -1,10 +1,11 @@
-package com.c2kernel.lookup;
+package com.c2kernel.lookup.ldap;
import java.util.ArrayList;
import java.util.Enumeration;
import com.c2kernel.common.ObjectCannotBeUpdated;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.lookup.EntityPath;
import com.c2kernel.property.Property;
import com.c2kernel.utils.Logger;
import com.novell.ldap.LDAPAttribute;
diff --git a/src/main/java/com/c2kernel/lookup/LDAPRoleManager.java b/src/main/java/com/c2kernel/lookup/ldap/LDAPRoleManager.java
index e046550..816d1c4 100644
--- a/src/main/java/com/c2kernel/lookup/LDAPRoleManager.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/LDAPRoleManager.java
@@ -1,4 +1,4 @@
-package com.c2kernel.lookup;
+package com.c2kernel.lookup.ldap;
import java.util.ArrayList;
import java.util.Enumeration;
@@ -6,6 +6,11 @@ import java.util.Enumeration;
import com.c2kernel.common.ObjectAlreadyExistsException;
import com.c2kernel.common.ObjectCannotBeUpdated;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.lookup.AgentPath;
+import com.c2kernel.lookup.InvalidEntityPathException;
+import com.c2kernel.lookup.Path;
+import com.c2kernel.lookup.RoleManager;
+import com.c2kernel.lookup.RolePath;
import com.c2kernel.utils.Logger;
import com.novell.ldap.LDAPConnection;
import com.novell.ldap.LDAPEntry;
diff --git a/src/main/java/com/c2kernel/lookup/LegacyLDAPPropertyManager.java b/src/main/java/com/c2kernel/lookup/ldap/LegacyLDAPPropertyManager.java
index 638c694..cf4892d 100644
--- a/src/main/java/com/c2kernel/lookup/LegacyLDAPPropertyManager.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/LegacyLDAPPropertyManager.java
@@ -1,7 +1,8 @@
-package com.c2kernel.lookup;
+package com.c2kernel.lookup.ldap;
import com.c2kernel.common.ObjectCannotBeUpdated;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.lookup.EntityPath;
import com.c2kernel.property.Property;
import com.c2kernel.utils.Logger;
import com.novell.ldap.LDAPAttribute;
diff --git a/src/main/java/com/c2kernel/lookup/NextKeyManager.java b/src/main/java/com/c2kernel/lookup/ldap/NextKeyManager.java
index fd873fd..305fe65 100644
--- a/src/main/java/com/c2kernel/lookup/NextKeyManager.java
+++ b/src/main/java/com/c2kernel/lookup/ldap/NextKeyManager.java
@@ -1,7 +1,10 @@
-package com.c2kernel.lookup;
+package com.c2kernel.lookup.ldap;
import com.c2kernel.common.ObjectCannotBeUpdated;
import com.c2kernel.common.ObjectNotFoundException;
+import com.c2kernel.lookup.AgentPath;
+import com.c2kernel.lookup.EntityPath;
+import com.c2kernel.lookup.InvalidEntityPathException;
import com.novell.ldap.LDAPEntry;
/**************************************************************************
diff --git a/src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java b/src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java
index 8e35fae..a482f75 100644
--- a/src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java
+++ b/src/main/java/com/c2kernel/persistency/LDAPClusterStorage.java
@@ -6,8 +6,8 @@ import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.entity.C2KLocalObject;
import com.c2kernel.lookup.EntityPath;
import com.c2kernel.lookup.InvalidEntityPathException;
-import com.c2kernel.lookup.LDAPLookup;
-import com.c2kernel.lookup.LDAPPropertyManager;
+import com.c2kernel.lookup.ldap.LDAPLookup;
+import com.c2kernel.lookup.ldap.LDAPPropertyManager;
import com.c2kernel.process.Gateway;
import com.c2kernel.property.Property;
import com.c2kernel.utils.Logger;
diff --git a/src/main/java/com/c2kernel/process/Gateway.java b/src/main/java/com/c2kernel/process/Gateway.java
index 14d1d8f..afdff12 100644
--- a/src/main/java/com/c2kernel/process/Gateway.java
+++ b/src/main/java/com/c2kernel/process/Gateway.java
@@ -15,9 +15,9 @@ import com.c2kernel.entity.CorbaServer;
import com.c2kernel.entity.proxy.AgentProxy;
import com.c2kernel.entity.proxy.EntityProxyManager;
import com.c2kernel.lookup.AgentPath;
-import com.c2kernel.lookup.LDAPLookup;
-import com.c2kernel.lookup.LDAPProperties;
import com.c2kernel.lookup.Lookup;
+import com.c2kernel.lookup.ldap.LDAPLookup;
+import com.c2kernel.lookup.ldap.LDAPProperties;
import com.c2kernel.persistency.ClusterStorageException;
import com.c2kernel.persistency.TransactionManager;
import com.c2kernel.process.module.ModuleManager;