use of edu.internet2.middleware.grouperClient.ws.beans.WsResultMeta in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method makeWsAddMemberResults.
@Override
public WsAddMemberResults makeWsAddMemberResults(String group, WsSubjectLookup lookup, Person personToAdd) {
Person newGroupMember;
WsAddMemberResults wsAddMemberResults = new WsAddMemberResults();
WsResultMeta wsResultMeta = new WsResultMeta();
wsResultMeta.setResultCode(SUCCESS);
wsAddMemberResults.setResultMetadata(wsResultMeta);
Grouping grouping = groupingRepository.findByIncludePathOrExcludePathOrCompositePathOrOwnersPath(group, group, group, group);
if (personToAdd.getUsername() != null) {
newGroupMember = personRepository.findByUsername(personToAdd.getUsername());
} else {
newGroupMember = personRepository.findByUuid(personToAdd.getUuid());
}
if (grouping == null) {
Group groupToAddTo = groupRepository.findByPath(group);
addMember(groupToAddTo, newGroupMember);
} else {
boolean inBasis = grouping.getBasis().isMember(newGroupMember);
boolean inExclude = grouping.getExclude().isMember(newGroupMember);
boolean inInclude = grouping.getInclude().isMember(newGroupMember);
if (group.endsWith(OWNERS)) {
addMember(grouping.getOwners(), newGroupMember);
} else if (group.endsWith(EXCLUDE)) {
if (inBasis) {
addMember(grouping.getExclude(), newGroupMember);
} else if (inInclude) {
deleteMember(grouping.getInclude(), newGroupMember);
}
} else if (group.endsWith(INCLUDE)) {
if (inExclude) {
deleteMember(grouping.getExclude(), newGroupMember);
} else if (!inBasis) {
addMember(grouping.getInclude(), newGroupMember);
}
}
grouping = groupingRepository.findByPath(grouping.getPath());
Group composite = buildComposite(grouping.getInclude(), grouping.getExclude(), grouping.getBasis(), grouping.getPath());
groupRepository.save(composite);
}
return wsAddMemberResults;
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsResultMeta in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method makeWsStemSaveResults.
@Override
public WsStemSaveResults makeWsStemSaveResults(String username, String stemPath) {
WsStemSaveResults wsStemSaveResults = new WsStemSaveResults();
WsStemSaveResult wsStemSaveResult = new WsStemSaveResult();
WsResultMeta wsResultMeta = new WsResultMeta();
wsResultMeta.setResultCode(SUCCESS);
wsStemSaveResult.setResultMetadata(wsResultMeta);
wsStemSaveResults.setResultMetadata(wsResultMeta);
wsStemSaveResults.setResults(new WsStemSaveResult[] { wsStemSaveResult });
return wsStemSaveResults;
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsResultMeta in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method makeWsAssignAttributesResultsForGroup.
@Override
public WsAssignAttributesResults makeWsAssignAttributesResultsForGroup(String attributeAssignType, String attributeAssignOperation, String attributeDefNameName, String ownerGroupName) {
WsAssignAttributesResults wsAssignAttributesResults = new WsAssignAttributesResults();
WsResultMeta wsResultMeta = new WsResultMeta();
wsResultMeta.setResultCode(FAILURE);
Grouping grouping = groupingRepository.findByPath(ownerGroupName);
if (attributeAssignOperation.equals(OPERATION_ASSIGN_ATTRIBUTE)) {
if (setGroupingAttribute(grouping, attributeDefNameName, true)) {
wsResultMeta.setResultCode(SUCCESS);
}
} else if (attributeAssignOperation.equals(OPERATION_REMOVE_ATTRIBUTE)) {
if (setGroupingAttribute(grouping, attributeDefNameName, false)) {
wsResultMeta.setResultCode(SUCCESS);
}
}
wsAssignAttributesResults.setResultMetadata(wsResultMeta);
return wsAssignAttributesResults;
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsResultMeta in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method makeWsDeleteMemberResults.
@Override
public WsDeleteMemberResults makeWsDeleteMemberResults(String group, WsSubjectLookup lookup, Person personToDelete) {
WsDeleteMemberResults wsDeleteMemberResults = new WsDeleteMemberResults();
WsResultMeta wsResultMeta = new WsResultMeta();
wsResultMeta.setResultCode(SUCCESS);
wsDeleteMemberResults.setResultMetadata(wsResultMeta);
Grouping grouping = groupingRepository.findByIncludePathOrExcludePathOrCompositePathOrOwnersPath(group, group, group, group);
if (personToDelete.getUsername() != null) {
personToDelete = personRepository.findByUsername(personToDelete.getUsername());
} else if (personToDelete.getUuid() != null) {
personToDelete = personRepository.findByUuid(personToDelete.getUuid());
}
if (grouping == null) {
Group groupToDeleteFrom = groupRepository.findByPath(group);
deleteMember(groupToDeleteFrom, personToDelete);
} else {
if (group.endsWith(OWNERS)) {
deleteMember(grouping.getOwners(), personToDelete);
} else if (group.endsWith(EXCLUDE)) {
deleteMember(grouping.getExclude(), personToDelete);
} else if (group.endsWith(INCLUDE)) {
deleteMember(grouping.getInclude(), personToDelete);
}
grouping = groupingRepository.findByPath(grouping.getPath());
grouping = groupingRepository.findByPath(grouping.getPath());
Group composite = buildComposite(grouping.getInclude(), grouping.getExclude(), grouping.getBasis(), grouping.getPath());
groupRepository.save(composite);
}
return wsDeleteMemberResults;
}
use of edu.internet2.middleware.grouperClient.ws.beans.WsResultMeta in project uhgroupings by uhawaii-system-its-ti-iam.
the class GrouperFactoryServiceImplLocal method makeWsAddMemberResults.
@Override
public WsAddMemberResults makeWsAddMemberResults(String group, WsSubjectLookup lookup, List<String> newMembers) {
WsAddMemberResults wsAddMemberResults = new WsAddMemberResults();
WsResultMeta wsResultMeta = new WsResultMeta();
wsResultMeta.setResultCode(SUCCESS);
for (String username : newMembers) {
WsResultMeta wsResultMetaData = makeWsAddMemberResults(group, lookup, username).getResultMetadata();
if (wsResultMetaData.getResultCode().equals(FAILURE)) {
wsResultMeta = wsResultMetaData;
}
}
wsAddMemberResults.setResultMetadata(wsResultMeta);
return wsAddMemberResults;
}
Aggregations