gm.setMappedGroup((String) e.getValue());
wsm.getGroupMap().add(gm);
}
} else if (addPrincipals != null) {
for (Map.Entry e : addPrincipals.entrySet()) {
PrincipalMap pm = wsm.createChild(PrincipalMap.class);
pm.setEisPrincipal((String) e.getKey());
pm.setMappedPrincipal((String) e.getValue());
wsm.getPrincipalMap().add(pm);
}
}
if (removeGroups != null) {
for (String rg : removeGroups) {
for (GroupMap gm : existingUserGroups) {
if (gm.getEisGroup().equals(rg)) {
wsm.getGroupMap().remove(gm);
}
}
}
} else if (removePrincipals != null) {
for (String rp : removePrincipals) {
for (PrincipalMap pm : existingPrincipals) {
if (pm.getEisPrincipal().equals(rp)) {
wsm.getPrincipalMap().remove(pm);
}
}
}
}