use of edu.internet2.middleware.grouperClient.api.GcGetAttributeAssignments in project uhgroupings by uhawaii-system-its-ti-iam.
the class TestGroupingAssignmentService method grouperTest.
@Test
public void grouperTest() {
List<String> groupPaths = groupingAssignmentService.getGroupPaths(username[0]);
List<String> groupings = new ArrayList<>();
List<String> groupings2 = new ArrayList<>();
if (groupPaths.size() > 0) {
List<WsAttributeAssign> attributes = new ArrayList<>();
for (String path : groupPaths) {
WsGetAttributeAssignmentsResults trioGroups = new GcGetAttributeAssignments().addAttributeDefNameName(TRIO).assignAttributeAssignType(ASSIGN_TYPE_GROUP).addOwnerGroupName(path).execute();
if (trioGroups.getWsAttributeAssigns() != null) {
Collections.addAll(attributes, trioGroups.getWsAttributeAssigns());
}
}
if (attributes.size() > 0) {
groupings.addAll(attributes.stream().map(WsAttributeAssign::getOwnerGroupName).collect(Collectors.toList()));
}
assertNotNull(groupings);
// ////////////////////////////////////////////////////////////////////////////////
GcGetAttributeAssignments trioGroups2 = new GcGetAttributeAssignments().addAttributeDefNameName(TRIO).assignAttributeAssignType(ASSIGN_TYPE_GROUP);
groupPaths.forEach(trioGroups2::addOwnerGroupName);
WsGetAttributeAssignmentsResults attributeAssignmentsResults2 = trioGroups2.execute();
assertNotNull(attributeAssignmentsResults2);
WsAttributeAssign[] wsGroups2 = attributeAssignmentsResults2.getWsAttributeAssigns();
if (wsGroups2 != null && wsGroups2.length > 0) {
for (WsAttributeAssign grouping : wsGroups2) {
groupings2.add(grouping.getOwnerGroupName());
}
}
}
assertNotNull(groupings2);
}
use of edu.internet2.middleware.grouperClient.api.GcGetAttributeAssignments in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImpl method makeWsGetAttributeAssignmentsResultsTrio.
@Override
public List<WsGetAttributeAssignmentsResults> makeWsGetAttributeAssignmentsResultsTrio(String assignType, String attributeDefNameName, List<String> ownerGroupNames) {
List<WsGetAttributeAssignmentsResults> attributeAssignmentsResultList = new ArrayList<>();
Iterator iterator = ownerGroupNames.iterator();
for (int i = 0; i < ownerGroupNames.size(); i += ATTRIBUTES_ASSIGN_ID_SIZE) {
GcGetAttributeAssignments attributeAssignments = new GcGetAttributeAssignments().addAttributeDefNameName(attributeDefNameName).assignAttributeAssignType(assignType);
for (int j = 0; j < ATTRIBUTES_ASSIGN_ID_SIZE; j++) {
if (iterator.hasNext()) {
attributeAssignments.addOwnerGroupName(iterator.next().toString());
} else {
break;
}
}
attributeAssignmentsResultList.add(attributeAssignments.execute());
}
return attributeAssignmentsResultList;
}
Aggregations