@Override
public List<Group> findGroupByQueryCriteria(Object query, Page page) {
List<Group> groupList = new ArrayList<Group>();
// Query is a GroupQueryImpl instance
GroupQueryImpl groupQuery = (GroupQueryImpl) query;
StringBuilder searchQuery = new StringBuilder();
if(StringUtils.isNotEmpty(groupQuery.getId())) {
searchQuery.append("(cn=").append(groupQuery.getId()).append(")");
} else if(StringUtils.isNotEmpty(groupQuery.getName())) {
searchQuery.append("(cn=").append(groupQuery.getName()).append(")");
} else if(StringUtils.isNotEmpty(groupQuery.getUserId())) {
searchQuery.append("(uniqueMember= uid=").append(groupQuery.getUserId()).append("," + USER_ENTRY + ")");
} else {
searchQuery.append("(cn=*)");
}
LdapConnection connection = LDAPConnectionUtil.openConnection(connectionParams);