use of edu.internet2.middleware.grouperClient.ws.beans.WsGroup 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.internet2.middleware.grouperClient.ws.beans.WsGroup in project uhgroupings by uhawaii-system-its-ti-iam.
the class GroupingFactoryServiceImpl method getGroupId.
// returns the uid for a group in grouper
private String getGroupId(String groupPath) {
WsFindGroupsResults results = grouperFactoryService.makeWsFindGroupsResults(groupPath);
WsGroup result = results.getGroupResults()[0];
return result.getUuid();
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsGroup 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;
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsGroup in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method removeGroupsWithoutOptIn.
private WsGetAttributeAssignmentsResults removeGroupsWithoutOptIn(WsGetAttributeAssignmentsResults wsGetAttributeAssignmentsResults) {
List<WsGroup> wsGroupList = Arrays.asList(wsGetAttributeAssignmentsResults.getWsGroups());
List<WsGroup> wsGroupsWithOptIn = new ArrayList<>();
List<WsAttributeAssign> wsAttributeAssignList = Arrays.asList(wsGetAttributeAssignmentsResults.getWsAttributeAssigns());
List<WsAttributeAssign> wsAttributeAssignsWithOptIn = new ArrayList<>();
for (WsGroup wsGroup : wsGroupList) {
Grouping grouping = groupingRepository.findByPath(wsGroup.getName());
if (grouping.isOptInOn()) {
wsGroupsWithOptIn.add(wsGroup);
}
}
for (WsAttributeAssign wsAttributeAssign : wsAttributeAssignList) {
Grouping grouping = groupingRepository.findByPath(wsAttributeAssign.getOwnerGroupName());
if (grouping.isOptInOn()) {
wsAttributeAssignsWithOptIn.add(wsAttributeAssign);
}
}
wsGetAttributeAssignmentsResults.setWsAttributeAssigns(wsAttributeAssignsWithOptIn.toArray(new WsAttributeAssign[wsAttributeAssignsWithOptIn.size()]));
wsGetAttributeAssignmentsResults.setWsGroups(wsGroupsWithOptIn.toArray(new WsGroup[wsGroupsWithOptIn.size()]));
return wsGetAttributeAssignmentsResults;
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsGroup in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImpl method addCompositeGroup.
@Override
public WsGroupSaveResults addCompositeGroup(String username, String parentGroupPath, String compositeType, String leftGroupPath, String rightGroupPath) {
WsGroupToSave groupToSave = new WsGroupToSave();
WsGroup group = new WsGroup();
WsGroupDetail wsGroupDetail = new WsGroupDetail();
// get the left and right groups from the database/grouper
WsGroup leftGroup = makeWsFindGroupsResults(leftGroupPath).getGroupResults()[0];
WsGroup rightGroup = makeWsFindGroupsResults(rightGroupPath).getGroupResults()[0];
wsGroupDetail.setCompositeType(compositeType);
wsGroupDetail.setLeftGroup(leftGroup);
wsGroupDetail.setRightGroup(rightGroup);
group.setName(parentGroupPath);
group.setDetail(wsGroupDetail);
groupToSave.setWsGroup(group);
WsSubjectLookup lookup = makeWsSubjectLookup(username);
return new GcGroupSave().addGroupToSave(groupToSave).assignActAsSubject(lookup).execute();
}
Aggregations