im working on a little java-program that synchronizes active directory users with users in my db. therefor, i am using modelmapper. seems to be working fine and is also pretty fast.
anyway i added a converter to my mapping configuration. shows no markers, and i checked the syntax, so it should be fine. but when i fire the syncer to see if hes mapping everything correctly, nothing happens. i mean, the objects get mapped correctly but not the property i set the converter for.
i already went into debug-mode, the convert method is not even entered, not once
so heres my modelmapper-propertymapconfiguration
private PropertyMap<ActiveDirectoryUser, User> createUserMap = new PropertyMap<ActiveDirectoryUser, User>() {
protected void configure() {
map(source.getCn(), destination.getFullName());
map(source.getsAMAccountName(), destination.getLoginName());
map(source.getMail(), destination.getEmail());
map(source.isEnabled(), destination.isActive());
using(new ModelmapperMemberOfToIsAdminConverter(Arrays.asList(ConfigApp.get(ConfigKeys.AD_DISTINGUISHEDNAME_ADMINS).split(";")))
).map(source.getGroupMembership(), destination.isAdmin());
};
};
and theres my converter:
package ch.itp.absencemanagersync.synchronize;
import java.util.ArrayList;
import java.util.List;
import org.modelmapper.AbstractConverter;
public class ModelmapperMemberOfToIsAdminConverter extends AbstractConverter<ArrayList<String>, Boolean>{
private List<String> comparisonList;
protected ModelmapperMemberOfToIsAdminConverter(List<String> blablablist){
comparisonList = blablablist;
}
@Override
protected Boolean convert(ArrayList<String> source) {
//empty for now, will do some logic here later
//for testing, always return true
return true;
}
}
so if i run the syncer, in theory, every user in my db should turn admin, but that doesnt happen i dont know what im doing wrong here, any help is appreciated^^
ps: dont worry about the Arrays.asList shit in the config, thats working just fine
greetings,
mike