case MembershipDerivedSchema:
for (AbstractAttributable attributable : attributables) {
AbstractDerAttr derAttr = attributable.getDerivedAttribute(mappingItem.getIntAttrName());
if (derAttr != null) {
attrValue = (attributable instanceof SyncopeRole)
? new RAttrValue() : new UAttrValue();
attrValue.setStringValue(derAttr.getValue(attributable.getAttributes()));
values.add(attrValue);
}
LOG.debug("Retrieved attribute {}"
+ "\n* IntAttrName {}"
+ "\n* IntMappingType {}"
+ "\n* Attribute values {}",
derAttr, mappingItem.getIntAttrName(), mappingItem.getIntMappingType(), values);
}
break;
case UserId:
case RoleId:
case MembershipId:
for (AbstractAttributable attributable : attributables) {
attrValue = new UAttrValue();
attrValue.setStringValue(attributable.getId().toString());
values.add(attrValue);
}
break;
case Username:
for (AbstractAttributable attributable : attributables) {
if (attributable instanceof SyncopeUser) {
attrValue = new UAttrValue();
attrValue.setStringValue(((SyncopeUser) attributable).getUsername());
values.add(attrValue);
}
}
break;
case RoleName:
for (AbstractAttributable attributable : attributables) {
if (attributable instanceof SyncopeRole) {
attrValue = new RAttrValue();
attrValue.setStringValue(((SyncopeRole) attributable).getName());
values.add(attrValue);
}
}
break;
case RoleOwnerSchema:
for (AbstractAttributable attributable : attributables) {
if (attributable instanceof SyncopeRole) {
SyncopeRole role = (SyncopeRole) attributable;
String roleOwnerValue = null;
if (role.getUserOwner() != null && resource.getUmapping() != null) {
roleOwnerValue = getRoleOwnerValue(resource, role.getUserOwner());
}
if (role.getRoleOwner() != null && resource.getRmapping() != null) {
roleOwnerValue = getRoleOwnerValue(resource, role.getRoleOwner());
}
if (StringUtils.isNotBlank(roleOwnerValue)) {
attrValue = new RAttrValue();
attrValue.setStringValue(roleOwnerValue);
values.add(attrValue);
}
}
}