Search in sources :

Example 1 with AttributeRemoveRequest

use of edu.uiuc.ncsa.myproxy.oa4mp.oauth2.cm.util.attributes.AttributeRemoveRequest in project OA4MP by ncsa.

the class RequestFactory method createRequest.

public static AttributeRemoveRequest createRequest(AdminClient aSubj, TypeAttribute typeAttribute, ActionRemove actionRemove, OA2Client cTarget, JSON content) {
    // JSON content = SATFactory.getContent(json);
    if (!content.isArray()) {
        throw new GeneralException("Content must be a list of attributes to get");
    }
    JSONArray array = (JSONArray) content;
    String[] arrayString = (String[]) array.toArray(new String[array.size()]);
    return new AttributeRemoveRequest(aSubj, cTarget, Arrays.asList(arrayString));
}
Also used : GeneralException(edu.uiuc.ncsa.security.core.exceptions.GeneralException) AttributeRemoveRequest(edu.uiuc.ncsa.myproxy.oa4mp.oauth2.cm.util.attributes.AttributeRemoveRequest) JSONArray(net.sf.json.JSONArray)

Aggregations

AttributeRemoveRequest (edu.uiuc.ncsa.myproxy.oa4mp.oauth2.cm.util.attributes.AttributeRemoveRequest)1 GeneralException (edu.uiuc.ncsa.security.core.exceptions.GeneralException)1 JSONArray (net.sf.json.JSONArray)1