public synchronized void removeRole(Role r) {
   if (isDataEditable(ResUnit.Role)) {
     disconnectResources(r);
     for (Role role : getRoles()) {
       Role owner = role.getOwnerRole();
       if ((owner != null) && owner.getID().equals(r.getID())) {
         role.setOwnerRole((Role) null);
         getDataSource(ResUnit.Role).update(role);
       }
     }
     delRole(r);
     getDataSource(ResUnit.Role).delete(r);
   }
 }
 public Map<String, String> getRoleIdentifiers() {
   Map<String, String> idMap = new Hashtable<String, String>();
   for (Role r : getRoles()) {
     idMap.put(r.getID(), r.getName());
   }
   return idMap;
 }
 public Set<Participant> resolveParticipantsFromResourceName(String anyName) {
   Set<Participant> pSet = new HashSet<Participant>();
   Participant p = getParticipantFromUserID(anyName);
   if (p != null) {
     pSet.add(p);
     return pSet;
   }
   Role r = getRoleByName(anyName);
   if (r != null) {
     pSet.addAll(getRoleParticipants(r.getID()));
     return pSet;
   }
   Position pos = getPositionByLabel(anyName);
   if (pos != null) {
     pSet.addAll(getPositionParticipants(pos.getID()));
     return pSet;
   }
   OrgGroup o = getOrgGroupByLabel(anyName);
   if (o != null) {
     pSet.addAll(getOrgGroupParticipants(o.getID()));
     return pSet;
   }
   Capability c = getCapabilityByLabel(anyName);
   if (c != null) {
     pSet.addAll(getCapabilityParticipants(c.getID()));
   }
   return pSet;
 }
 public String getParticpantsWithRoleAsXML(String roleName) {
   String result = "<participants/>";
   if (roleName != null) {
     Role r = getRoleByName(roleName);
     if (r != null) {
       result = getRoleParticipantsAsXML(r.getID());
     }
   }
   return result;
 }
 public Set<Participant> getParticipantsWithRole(String roleName) {
   Set<Participant> result = null;
   if (roleName != null) {
     Role r = getRoleByName(roleName);
     if (r != null) {
       result = getRoleParticipants(r.getID());
     }
   }
   return result;
 }
 public boolean isKnownRole(Role r) {
   return isKnownRole(r.getID());
 }
 public void delRole(Role r) {
   roleMap.remove(r.getID());
   setChangeStamp(ResUnit.Role);
 }
 public void putRole(Role r) {
   roleMap.put(r.getID(), r);
   setChangeStamp(ResUnit.Role);
 }