summaryrefslogtreecommitdiff
path: root/src/main/java/com/c2kernel/lookup/RolePath.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/c2kernel/lookup/RolePath.java')
-rw-r--r--src/main/java/com/c2kernel/lookup/RolePath.java35
1 files changed, 10 insertions, 25 deletions
diff --git a/src/main/java/com/c2kernel/lookup/RolePath.java b/src/main/java/com/c2kernel/lookup/RolePath.java
index 0e07012..bd23991 100644
--- a/src/main/java/com/c2kernel/lookup/RolePath.java
+++ b/src/main/java/com/c2kernel/lookup/RolePath.java
@@ -10,15 +10,13 @@
package com.c2kernel.lookup;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Iterator;
import com.c2kernel.common.ObjectCannotBeUpdated;
import com.c2kernel.common.ObjectNotFoundException;
import com.c2kernel.process.Gateway;
import com.c2kernel.utils.Logger;
-import com.novell.ldap.LDAPAttribute;
-import com.novell.ldap.LDAPAttributeSet;
@@ -56,7 +54,7 @@ public class RolePath extends DomainPath
*/
public void setHasJobList(boolean hasJobList) throws ObjectNotFoundException, ObjectCannotBeUpdated {
this.hasJobList = hasJobList;
- Gateway.getLDAPLookup().getRoleManager().setHasJobList(this, hasJobList);
+ Gateway.getLookup().setHasJobList(this, hasJobList);
}
@@ -65,18 +63,17 @@ public class RolePath extends DomainPath
mType = CONTEXT;
}
- @Override
- public Enumeration<AgentPath> getChildren() {
+ public Iterator<Path> getChildren() {
AgentPath[] agents = getAgentsWithRole();
- Vector<AgentPath> children = new Vector<AgentPath>(agents.length);
+ ArrayList<Path> children = new ArrayList<Path>(agents.length);
for (int i = 0; i < agents.length; i++)
children.add(i, agents[i]);
- return children.elements();
+ return children.iterator();
}
public AgentPath[] getAgentsWithRole() {
try {
- return Gateway.getLDAPLookup().getRoleManager().getAgents(this);
+ return Gateway.getLookup().getAgents(this);
} catch (ObjectNotFoundException ex) {
Logger.error("Cannot retrieve agent list. Role "+getName()+" does not exist in LDAP");
return new AgentPath[0];
@@ -84,11 +81,11 @@ public class RolePath extends DomainPath
}
public void addAgent(AgentPath agent) throws ObjectCannotBeUpdated, ObjectNotFoundException {
- Gateway.getLDAPLookup().getRoleManager().addRole(agent, this);
+ Gateway.getLookup().addRole(agent, this);
}
public void removeAgent(AgentPath agent) throws ObjectCannotBeUpdated, ObjectNotFoundException {
- Gateway.getLDAPLookup().getRoleManager().removeRole(agent, this);
+ Gateway.getLookup().removeRole(agent, this);
}
@Override
@@ -99,9 +96,7 @@ public class RolePath extends DomainPath
return "Path - dump(): "+
comp.toString()+
- "}\n dn="+
- getDN()+
- "\n string="+
+ "}\n string="+
toString()+
"\n type="+
mType+
@@ -110,15 +105,5 @@ public class RolePath extends DomainPath
"\n ";
}
- @Override
- public LDAPAttributeSet createAttributeSet()
- {
- LDAPAttributeSet attrs = new LDAPAttributeSet();
- attrs.add(new LDAPAttribute("objectclass","cristalrole"));
- String jobListString = hasJobList?"TRUE":"FALSE";
- attrs.add(new LDAPAttribute("jobList",jobListString));
- attrs.add(new LDAPAttribute("cn", getName()));
- return attrs;
- }
}