try {
// TODO: searches need to be performed against the group display
// name rather than the group key
GcFindGroups groupSearch = new GcFindGroups();
WsQueryFilter filter = new WsQueryFilter();
//is this an exact search or fuzzy
if(method == IGroupConstants.IS){
filter.setQueryFilterType("FIND_BY_GROUP_NAME_EXACT");
}else{
filter.setQueryFilterType("FIND_BY_GROUP_NAME_APPROXIMATE");
}
filter.setGroupName(query);
groupSearch.assignQueryFilter(filter);
WsFindGroupsResults results = groupSearch.execute();
if (results != null && results.getGroupResults() != null) {
for (WsGroup g : results.getGroupResults()) {
if (validKey(g.getName())) {
if (LOGGER.isTraceEnabled()) {