List<AbstractAttrValue> values = MappingUtil.getIntValues(resource, mapItem, attributables,
vAttrsToBeRemoved, vAttrsToBeUpdated);
AbstractSchema schema = null;
boolean readOnlyVirSchema = false;
AttributeSchemaType schemaType;
ConfigurableApplicationContext context = ApplicationContextProvider.getApplicationContext();
switch (mapItem.getIntMappingType()) {
case UserSchema:
case RoleSchema:
case MembershipSchema:
SchemaDAO schemaDAO = context.getBean(SchemaDAO.class);
schema = schemaDAO.find(mapItem.getIntAttrName(),
MappingUtil.getIntMappingTypeClass(mapItem.getIntMappingType()));
schemaType = schema == null ? AttributeSchemaType.String : schema.getType();
break;
case UserVirtualSchema:
case RoleVirtualSchema:
case MembershipVirtualSchema:
VirSchemaDAO virSchemaDAO = context.getBean(VirSchemaDAO.class);
AbstractVirSchema virSchema = virSchemaDAO.find(mapItem.getIntAttrName(),
MappingUtil.getIntMappingTypeClass(mapItem.getIntMappingType()));
readOnlyVirSchema = (virSchema != null && virSchema.isReadonly());
schemaType = AttributeSchemaType.String;
break;
default:
schemaType = AttributeSchemaType.String;
}
final String extAttrName = mapItem.getExtAttrName();
LOG.debug("Define mapping for: "
+ "\n* ExtAttrName " + extAttrName
+ "\n* is accountId " + mapItem.isAccountid()
+ "\n* is password " + (mapItem.isPassword() || mapItem.getIntMappingType() == IntMappingType.Password)
+ "\n* mandatory condition " + mapItem.getMandatoryCondition()
+ "\n* Schema " + mapItem.getIntAttrName()
+ "\n* IntMappingType " + mapItem.getIntMappingType().toString()
+ "\n* ClassType " + schemaType.getType().getName()
+ "\n* Values " + values);
List<Object> objValues = new ArrayList<Object>();
for (AbstractAttrValue value : values) {
if (FrameworkUtil.isSupportedAttributeType(schemaType.getType())) {
objValues.add(value.getValue());
} else {
objValues.add(value.getValueAsString());
}
}