extValues.put(SchemaMappingUtil.getIntAttrName(mapping), object.getAttributeByName(SchemaMappingUtil
.getExtAttrName(mapping)));
}
// search user by attributes specified into the policy
NodeCond searchCondition = null;
for (String schema : policySpec.getAlternativeSearchAttrs()) {
Attribute value = extValues.get(schema);
AttributeCond.Type type;
String expression = null;
if (value == null || value.getValue() == null || value.getValue().isEmpty()) {
type = AttributeCond.Type.ISNULL;
} else {
type = AttributeCond.Type.EQ;
expression = value.getValue().size() > 1
? value.getValue().toString()
: value.getValue().get(0).toString();
}
NodeCond nodeCond;
// just Username or SyncopeUserId can be selected to be used
if ("id".equalsIgnoreCase(schema) || "username".equalsIgnoreCase(schema)) {
final SyncopeUserCond cond = new SyncopeUserCond();