Skip to content

Instantly share code, notes, and snippets.

@ilgrosso
Last active September 25, 2019 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilgrosso/e6f19ffa919c8eaea8359a8ed215c0f0 to your computer and use it in GitHub Desktop.
Save ilgrosso/e6f19ffa919c8eaea8359a8ed215c0f0 to your computer and use it in GitHub Desktop.
LdapIncrementalPullCorrelationRule
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.core.persistence.api.dao.PullCorrelationRule;
import org.apache.syncope.core.persistence.api.dao.search.AttributeCond;
import org.apache.syncope.core.persistence.api.dao.search.SearchCond;
import org.apache.syncope.core.persistence.api.entity.resource.Provision;
import org.identityconnectors.framework.common.objects.SyncDelta;
public class GFSLdapPullRule implements PullCorrelationRule {
@Override
public SearchCond getSearchCond(SyncDelta syncDelta, Provision provision) {
AttributeCond cond = new AttributeCond();
cond.setSchema("_schema_in_Syncope_che_mappa_uid");
cond.setType(AttributeCond.Type.EQ);
String dn = syncDelta.getObject().getName().getNameValue();
String uid = StringUtils.substringAfter(StringUtils.substringBefore(dn, ",ou=People"), "uid=");
cond.setExpression(uid);
return SearchCond.getLeafCond(cond);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment