class LDAPUserGroupCallbackImpl extends AbstractLDAPUserGroupInfo implements UserGroupCallback {

    @Override
    public List<String> getGroupsForUser(String userId) {
        String roleContext = getConfigProperty(USER_ROLES_CTX, getConfigProperty(ROLE_CTX));
        String roleFilter = getConfigProperty(USER_ROLES_FILTER);
        String roleAttributeId = getConfigProperty(ROLE_ATTR_ID, DEFAULT_ROLE_ATTR_ID);

        String userDn = userId;
        if (!isUserIdDn()) {
            String userContext = getConfigProperty(USER_CTX);
            String userFilter = getConfigProperty(USER_FILTER);

            SearchResult searchResult = ldapSearcher.search(userContext, userFilter, userId).getSingleSearchResult();
            userDn = searchResult.getNameInNamespace();
        }

        List<String> result = ldapSearcher.search(roleContext, roleFilter, userDn).getAttributeResults(roleAttributeId);
        
        return result.stream().map(r-> unescapeIllegalChars(r)).collect(Collectors.toList());
    }

    public  LDAPUserGroupCallbackImpl(boolean activate);
    public  LDAPUserGroupCallbackImpl(Properties config);

}