Last active
September 25, 2019 13:24
-
-
Save ilgrosso/e6f19ffa919c8eaea8359a8ed215c0f0 to your computer and use it in GitHub Desktop.
LdapIncrementalPullCorrelationRule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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