From 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 Mon Sep 17 00:00:00 2001 From: abranson Date: Thu, 4 Aug 2011 00:42:34 +0200 Subject: More code cleanup: Refactored Entity Proxy Subscription to handle generics better Rewrote RemoteMap to use TreeMap instead of the internal array for order. It now sorts its keys by number if they parse, else as strings. Removed a no-longer-in-progress outcome form class --- source/com/c2kernel/lookup/RolePath.java | 38 ++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 17 deletions(-) (limited to 'source/com/c2kernel/lookup/RolePath.java') diff --git a/source/com/c2kernel/lookup/RolePath.java b/source/com/c2kernel/lookup/RolePath.java index 672bdbf..e6593ea 100644 --- a/source/com/c2kernel/lookup/RolePath.java +++ b/source/com/c2kernel/lookup/RolePath.java @@ -33,10 +33,10 @@ public class RolePath extends DomainPath */ private boolean hasJobList = false; - + public RolePath(String roleName) { super(new DomainPath("agent"), roleName); - } + } public RolePath(String roleName, boolean jobList) { this(roleName); @@ -56,19 +56,21 @@ public class RolePath extends DomainPath this.hasJobList = hasJobList; } - - public void checkType() { + + @Override + public void checkType() { mType = CONTEXT; } - - public Enumeration getChildren() { + + @Override + public Enumeration getChildren() { AgentPath[] agents = getAgentsWithRole(); Vector children = new Vector(agents.length); for (int i = 0; i < agents.length; i++) children.add(i, agents[i]); return children.elements(); } - + public AgentPath[] getAgentsWithRole() { try { return Gateway.getLDAPLookup().getRoleManager().getAgents(this); @@ -77,20 +79,21 @@ public class RolePath extends DomainPath return new AgentPath[0]; } } - + public void addAgent(AgentPath agent) throws ObjectCannotBeUpdated, ObjectNotFoundException { Gateway.getLDAPLookup().getRoleManager().addRole(agent, this); } - + public void removeAgent(AgentPath agent) throws ObjectCannotBeUpdated, ObjectNotFoundException { Gateway.getLDAPLookup().getRoleManager().removeRole(agent, this); } - - public String dump() { + + @Override + public String dump() { StringBuffer comp = new StringBuffer("Components: { "); - for (int i=0; i