public Set<AbstractResource> getRoleParticipantsWithCapability(String rid, String cid) { Set<AbstractResource> resourceSet = new HashSet<AbstractResource>(); Role role = getRole(rid); if (role != null) { // filter role members by capability if (cid != null) { Capability cap = getCapability(cid); if (cap != null) { for (AbstractResource member : role.getResources()) { if (((Participant) member).getCapabilities().contains(cap)) { resourceSet.add(member); } } } } else resourceSet = role.getResources(); // no cid means don't filter } return resourceSet; }
public Set<Participant> getParticipantsInDescendantRoles(Role owner) { Set<Participant> result = new HashSet<Participant>(); Set<Role> roleSet = getRoles(); for (Role role : roleSet) { if (role.ultimatelyBelongsTo(owner)) { result.addAll(castToParticipantSet(role.getResources())); } } return result; }
public Set<Participant> getRoleParticipants(String rid) { Role r = roleMap.get(rid); return (r != null) ? castToParticipantSet(r.getResources()) : null; }