use of edu.hawaii.its.api.type.Group in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method buildComposite.
// //////////////////////////////////////////////////////////////////////////////
// Helper methods
// //////////////////////////////////////////////////////////////////////////////
private Group buildComposite(Group include, Group exclude, Group basis, String path) {
Group basisMinusExclude = removeExcludedMembers(basis, exclude);
Group compositeGroup = addIncludedMembers(include, basisMinusExclude);
compositeGroup.setPath(path);
return compositeGroup;
}
use of edu.hawaii.its.api.type.Group in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupingAssignmentServiceImpl method adminLists.
// returns an adminLists object containing the list of all admins and all groupings
@Override
public AdminListsHolder adminLists(String adminUsername) {
AdminListsHolder info = new AdminListsHolder();
List<Grouping> groupings;
if (memberAttributeService.isSuperuser(adminUsername)) {
WsGetAttributeAssignmentsResults attributeAssignmentsResults = grouperFS.makeWsGetAttributeAssignmentsResultsTrio(ASSIGN_TYPE_GROUP, TRIO);
List<WsGroup> groups = new ArrayList<>(Arrays.asList(attributeAssignmentsResults.getWsGroups()));
List<String> groupPaths = groups.stream().map(WsGroup::getName).collect(Collectors.toList());
Group admin = getMembers(adminUsername, GROUPING_ADMINS);
groupings = helperService.makeGroupings(groupPaths);
info.setAdminGroup(admin);
info.setAllGroupings(groupings);
}
return info;
}
use of edu.hawaii.its.api.type.Group in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method addIncludedMembers.
private Group addIncludedMembers(Group include, Group basis) {
Group unionGroup = new Group();
List<Person> unionList = new ArrayList<>();
unionList.addAll(include.getMembers());
unionList.addAll(basis.getMembers());
// remove duplicates
Set<Person> s = new TreeSet<>();
s.addAll(unionList);
unionGroup.setMembers(Arrays.asList(s.toArray(new Person[s.size()])));
return unionGroup;
}
use of edu.hawaii.its.api.type.Group in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method removeExcludedMembers.
private Group removeExcludedMembers(Group basisPlusInclude, Group exclude) {
Group basisPlusIncludeMinusExcludeGroup = new Group();
ArrayList<Person> newBasisPlusInclude = new ArrayList<>();
newBasisPlusInclude.addAll(basisPlusInclude.getMembers());
newBasisPlusInclude.removeAll(exclude.getMembers());
basisPlusIncludeMinusExcludeGroup.setMembers(newBasisPlusInclude);
return basisPlusIncludeMinusExcludeGroup;
}
use of edu.hawaii.its.api.type.Group in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method makeWsGetGroupsResults.
@Override
public WsGetGroupsResults makeWsGetGroupsResults(String username, WsStemLookup stemLookup, StemScope stemScope) {
WsGetGroupsResults wsGetGroupsResults = new WsGetGroupsResults();
WsGetGroupsResult wsGetGroupsResult = new WsGetGroupsResult();
WsGroup[] groups;
List<WsGroup> wsGroupList = new ArrayList<>();
List<Group> groupList = groupRepository.findByMembersUsername(username);
for (Group group : groupList) {
WsGroup g = new WsGroup();
g.setName(group.getPath());
wsGroupList.add(g);
}
groups = wsGroupList.toArray(new WsGroup[wsGroupList.size()]);
wsGetGroupsResult.setWsGroups(groups);
wsGetGroupsResults.setResults(new WsGetGroupsResult[] { wsGetGroupsResult });
return wsGetGroupsResults;
}
Aggregations