// ---------------------------------
// Get sync policy specification
// ---------------------------------
final SyncPolicy policy = syncTask.getResource().getSyncPolicy();
final SyncPolicySpec policySpec = policy != null
? (SyncPolicySpec) policy.getSpecification()
: null;
// ---------------------------------
final List<Long> result = new ArrayList<Long>();
if (policySpec != null && !policySpec.getAlternativeSearchAttrs().isEmpty()) {
// search external attribute name/value
// about each specified name
final ConnectorObject object = delta.getObject();
final Map<String, Attribute> extValues = new HashMap<String, Attribute>();
for (SchemaMapping mapping : syncTask.getResource().getMappings()) {
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;