Search in sources :

Example 1 with WsAttributeDefName

use of edu.internet2.middleware.grouperClient.ws.beans.WsAttributeDefName in project uhgroupings by uhawaii-system-its-ti-iam.

the class GroupingAssignmentServiceImpl method setGroupingAttributes.

// sets the attributes of a grouping in grouper or the database to match the attributes of the supplied grouping
public Grouping setGroupingAttributes(Grouping grouping) {
    logger.info("setGroupingAttributes; grouping: " + grouping + ";");
    boolean listservOn = false;
    boolean optInOn = false;
    boolean optOutOn = false;
    WsGetAttributeAssignmentsResults wsGetAttributeAssignmentsResults = grouperFS.makeWsGetAttributeAssignmentsResultsForGroup(ASSIGN_TYPE_GROUP, grouping.getPath());
    WsAttributeDefName[] attributeDefNames = wsGetAttributeAssignmentsResults.getWsAttributeDefNames();
    if (attributeDefNames != null && attributeDefNames.length > 0) {
        for (WsAttributeDefName defName : attributeDefNames) {
            String name = defName.getName();
            if (name.equals(LISTSERV)) {
                listservOn = true;
            } else if (name.equals(OPT_IN)) {
                optInOn = true;
            } else if (name.equals(OPT_OUT)) {
                optOutOn = true;
            }
        }
    }
    grouping.setListservOn(listservOn);
    grouping.setOptInOn(optInOn);
    grouping.setOptOutOn(optOutOn);
    return grouping;
}
Also used : WsAttributeDefName(edu.internet2.middleware.grouperClient.ws.beans.WsAttributeDefName) WsGetAttributeAssignmentsResults(edu.internet2.middleware.grouperClient.ws.beans.WsGetAttributeAssignmentsResults)

Example 2 with WsAttributeDefName

use of edu.internet2.middleware.grouperClient.ws.beans.WsAttributeDefName in project uhgroupings by uhawaii-system-its-ti-iam.

the class GrouperFactoryServiceImplLocal method addAssignmentResults.

private WsGetAttributeAssignmentsResults addAssignmentResults(WsGetAttributeAssignmentsResults wsGetAttributeAssignmentsResults, String attributeName) {
    List<WsAttributeDefName> wsAttributeDefNames = new ArrayList<>();
    List<WsAttributeAssign> wsAttributeAssigns = new ArrayList<>();
    if (wsGetAttributeAssignmentsResults.getWsAttributeAssigns() != null) {
        Collections.addAll(wsAttributeAssigns, wsGetAttributeAssignmentsResults.getWsAttributeAssigns());
    }
    if (wsGetAttributeAssignmentsResults.getWsAttributeDefNames() != null) {
        Collections.addAll(wsAttributeDefNames, wsGetAttributeAssignmentsResults.getWsAttributeDefNames());
    }
    WsAttributeAssign wsAttributeAssign = new WsAttributeAssign();
    WsAttributeDefName wsAttributeDefName = new WsAttributeDefName();
    wsAttributeDefName.setName(attributeName);
    wsAttributeAssign.setAttributeDefNameName(attributeName);
    wsAttributeAssigns.add(wsAttributeAssign);
    wsAttributeDefNames.add(wsAttributeDefName);
    wsGetAttributeAssignmentsResults.setWsAttributeDefNames(wsAttributeDefNames.toArray(new WsAttributeDefName[wsAttributeDefNames.size()]));
    wsGetAttributeAssignmentsResults.setWsAttributeAssigns(wsAttributeAssigns.toArray(new WsAttributeAssign[wsAttributeAssigns.size()]));
    return wsGetAttributeAssignmentsResults;
}
Also used : WsAttributeDefName(edu.internet2.middleware.grouperClient.ws.beans.WsAttributeDefName) ArrayList(java.util.ArrayList) WsAttributeAssign(edu.internet2.middleware.grouperClient.ws.beans.WsAttributeAssign)

Aggregations

WsAttributeDefName (edu.internet2.middleware.grouperClient.ws.beans.WsAttributeDefName)2 WsAttributeAssign (edu.internet2.middleware.grouperClient.ws.beans.WsAttributeAssign)1 WsGetAttributeAssignmentsResults (edu.internet2.middleware.grouperClient.ws.beans.WsGetAttributeAssignmentsResults)1 ArrayList (java.util.ArrayList)1