class LdapAuthenticationService implements AuthenticationService, UserDirectoryService {

	@Override
	public List<org.geomajas.security.UserInfo> getUsers(UserFilter userFilter) {
		List<org.geomajas.security.UserInfo> users = new ArrayList<org.geomajas.security.UserInfo>();
		if (allUsersDn == null) {
			log.warn("Getting users from LDAP requires configuration of allUsersDn property");
		} else {
			SearchRequest request = createSearchRequest(allUsersDn);
			LdapFilterVisitor visitor = new LdapFilterVisitor();
			Filter ldapFilter = (Filter) userFilter.accept(visitor, null);
			if (ldapFilter != null) {
				Filter f = request.getFilter();
				request.setFilter(Filter.createANDFilter(f, ldapFilter));
			}
			SearchResult result = execute(request, null, null);
			if (result != null) {
				for (SearchResultEntry entry : result.getSearchEntries()) {
					users.add(getUserInfo(entry));
				}
			}
		}
		return users;
	}

}