}
public LazyPageList findUsers(Query q) throws Exception
{
UserQueryBuilder qb = service_.getIdentitySession().createUserQueryBuilder();
if (q.getUserName() != null)
{
qb.idFilter(q.getUserName());
}
if (q.getEmail() != null)
{
qb.attributeValuesFilter(UserDAOImpl.USER_EMAIL, new String[]{q.getEmail()});
}
if (q.getFirstName() != null)
{
qb.attributeValuesFilter(UserDAOImpl.USER_FIRST_NAME, new String[]{q.getFirstName()});
}
//TODO: from/to login date
if (q.getLastName() != null)
{
qb.attributeValuesFilter(UserDAOImpl.USER_LAST_NAME, new String[]{q.getLastName()});
}
return new LazyPageList(new IDMUserListAccess(this, service_, qb, 20, false), 20);
}