Search in sources :

Example 11 with EntitlementListener

use of com.sun.identity.entitlement.EntitlementListener in project OpenAM by OpenRock.

the class OpenSSOEntitlementListener method getListeners.

private List<EntitlementListener> getListeners() throws EntitlementException {
    List<EntitlementListener> listeners = new ArrayList<EntitlementListener>();
    try {
        AttributeSchema as = getAttributeSchema();
        Set<String> values = as.getDefaultValues();
        if (values != null) {
            for (String v : values) {
                listeners.add(new EntitlementListener(new JSONObject(v)));
            }
        }
    } catch (JSONException e) {
        throw new EntitlementException(426, e);
    } catch (SMSException e) {
        throw new EntitlementException(426, e);
    } catch (SSOException e) {
        throw new EntitlementException(427, e);
    }
    return listeners;
}
Also used : EntitlementException(com.sun.identity.entitlement.EntitlementException) JSONObject(org.json.JSONObject) SMSException(com.sun.identity.sm.SMSException) ArrayList(java.util.ArrayList) AttributeSchema(com.sun.identity.sm.AttributeSchema) JSONException(org.json.JSONException) SSOException(com.iplanet.sso.SSOException) EntitlementListener(com.sun.identity.entitlement.EntitlementListener)

Aggregations

EntitlementListener (com.sun.identity.entitlement.EntitlementListener)11 EntitlementException (com.sun.identity.entitlement.EntitlementException)6 MalformedURLException (java.net.MalformedURLException)6 JSONObject (org.json.JSONObject)6 UniformInterfaceException (com.sun.jersey.api.client.UniformInterfaceException)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)5 EncodingException (org.owasp.esapi.errors.EncodingException)5 Test (org.testng.annotations.Test)5 URL (java.net.URL)4 HashSet (java.util.HashSet)4 JSONException (org.json.JSONException)4 Form (com.sun.jersey.api.representation.Form)3 SSOException (com.iplanet.sso.SSOException)2 AttributeSchema (com.sun.identity.sm.AttributeSchema)2 SMSException (com.sun.identity.sm.SMSException)2 Subject (javax.security.auth.Subject)2 Produces (javax.ws.rs.Produces)2 ArrayList (java.util.ArrayList)1 Set (java.util.Set)1 GET (javax.ws.rs.GET)1