summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/lookup/RolePath.java
diff options
context:
space:
mode:
authorabranson <andrew.branson@cern.ch>2011-08-04 00:42:34 +0200
committerabranson <andrew.branson@cern.ch>2011-08-04 00:42:34 +0200
commit0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (patch)
tree5f6e5d9ae75193e67e6f3b3dfa488960c5cde1d5 /source/com/c2kernel/lookup/RolePath.java
parent036cbdba66f804743c4c838ed598d6972c4b3e17 (diff)
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
Diffstat (limited to 'source/com/c2kernel/lookup/RolePath.java')
-rw-r--r--source/com/c2kernel/lookup/RolePath.java38
1 files changed, 21 insertions, 17 deletions
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<AgentPath> getChildren() {
AgentPath[] agents = getAgentsWithRole();
Vector<AgentPath> children = new Vector<AgentPath>(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<mPath.length; i++)
- comp.append("'").append(mPath[i]).append("' ");
-
+ for (String element : mPath)
+ comp.append("'").append(element).append("' ");
+
return "Path - dump(): "+
comp.toString()+
"}\n dn="+
@@ -102,9 +105,10 @@ public class RolePath extends DomainPath
"\n name="+
getName()+
"\n ";
- }
-
- public LDAPAttributeSet createAttributeSet()
+ }
+
+ @Override
+ public LDAPAttributeSet createAttributeSet()
{
LDAPAttributeSet attrs = new LDAPAttributeSet();
attrs.add(new LDAPAttribute("objectclass","cristalrole"));