GcGetMembers gcGetMembers = new GcGetMembers();
gcGetMembers.addGroupName(group.getLocalKey());
gcGetMembers.assignIncludeSubjectDetail(true);
gcGetMembers.addSourceId("g:gsa");
WsGetMembersResults results = gcGetMembers.execute();
if (results == null || results.getResults() == null
|| results.getResults().length == 0
|| results.getResults()[0].getWsSubjects() == null) {
if (LOGGER.isDebugEnabled()) {
LOGGER
.debug("No group-type members found for group with key "
+ group.getKey());
}
return Collections.<IEntityGroup> emptyList().iterator();
}
final List<IEntityGroup> members = new ArrayList<IEntityGroup>();
WsSubject[] subjects = results.getResults()[0].getWsSubjects();
for (WsSubject wsSubject : subjects) {
if (validKey(wsSubject.getName())) {
WsGroup wsGroup = findGroupFromKey(wsSubject
.getName());