Search in sources :

Example 21 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class AbstractAuditModel method getEventHandlerDefaultValues.

/**
     * Get the default attribute values for the specified event handler type (schema ID).
     *
     * @param eventHandlerType The name of the event handler type.
     * @return A map of default event handler attribute values.
     * @throws AMConsoleException If an error occurs whilst reading the attributes.
     */
public Map<String, Set<?>> getEventHandlerDefaultValues(String eventHandlerType) throws AMConsoleException {
    try {
        Map<String, Set<?>> defaultValues = new HashMap<>();
        ServiceSchema handlerSchema = getServiceSchema().getSubSchema(eventHandlerType);
        Set attributeSchemas = handlerSchema.getAttributeSchemas();
        for (Object value : attributeSchemas) {
            AttributeSchema as = (AttributeSchema) value;
            Set values = as.getDefaultValues();
            if (values != null) {
                defaultValues.put(as.getName(), values);
            }
        }
        return defaultValues;
    } catch (SSOException | SMSException e) {
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : ServiceSchema(com.sun.identity.sm.ServiceSchema) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet) Set(java.util.Set) HashMap(java.util.HashMap) SMSException(com.sun.identity.sm.SMSException) AttributeSchema(com.sun.identity.sm.AttributeSchema) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 22 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class AbstractAuditModel method getPropertySheetXML.

@Override
public String getPropertySheetXML(String realmName, String viewBeanName, String viewBeanClassName) throws AMConsoleException {
    DelegationConfig dc = DelegationConfig.getInstance();
    boolean readOnly = !dc.hasPermission(realmName, serviceName, PERMISSION_MODIFY, this, viewBeanClassName);
    xmlBuilder.setAllAttributeReadOnly(readOnly);
    xmlBuilder.setSupportSubConfig(true);
    xmlBuilder.setViewBeanName(viewBeanName);
    try {
        return xmlBuilder.getXML();
    } catch (SSOException | SMSException e) {
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : SMSException(com.sun.identity.sm.SMSException) DelegationConfig(com.sun.identity.console.delegation.model.DelegationConfig) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 23 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class CoreAttributesViewBean method handleButton1Request.

/**
     * Handles cancel request.
     *
     * @param event Request invocation event.
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        CoreAttributesModel model = (CoreAttributesModel) getModel();
        Map original = model.getAttributeValues();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
        model.setAttributeValues(ps.getAttributeValues(original, true, model));
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.updated");
        forwardTo();
    } catch (AMConsoleException a) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", a.getMessage());
        forwardTo();
    }
}
Also used : CoreAttributesModel(com.sun.identity.console.authentication.model.CoreAttributesModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Example 24 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class AuthConfigViewBean method cacheValues.

private void cacheValues() throws ModelControlException {
    AuthConfigurationModel acModel = (AuthConfigurationModel) getModel();
    try {
        Map original = acModel.getValues();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
        Map changedValues = (Map) ps.getAttributeValues(original, true, acModel);
        original.putAll(changedValues);
        setPageSessionAttribute(ReorderAuthChainsViewBean.PG_SESSION_TRACKING, (HashMap) changedValues);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : AuthConfigurationModel(com.sun.identity.console.authentication.model.AuthConfigurationModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Example 25 with AMConsoleException

use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.

the class SAMLv2AuthnAuthorityViewBean method getStandardAuthnAuthorityValues.

private Map getStandardAuthnAuthorityValues() {
    Map map = new HashMap();
    try {
        SAMLv2Model model = (SAMLv2Model) getModel();
        map = model.getStandardAuthnAuthorityAttributes(realm, entityName);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    return map;
}
Also used : HashMap(java.util.HashMap) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map) SAMLv2Model(com.sun.identity.console.federation.model.SAMLv2Model)

Aggregations

AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)701 Map (java.util.Map)255 Set (java.util.Set)206 HashMap (java.util.HashMap)193 HashSet (java.util.HashSet)148 SSOException (com.iplanet.sso.SSOException)126 Iterator (java.util.Iterator)122 List (java.util.List)97 SMSException (com.sun.identity.sm.SMSException)83 ArrayList (java.util.ArrayList)78 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)76 IdRepoException (com.sun.identity.idm.IdRepoException)58 SAML2MetaException (com.sun.identity.saml2.meta.SAML2MetaException)47 SAML2MetaManager (com.sun.identity.saml2.meta.SAML2MetaManager)46 AMIdentity (com.sun.identity.idm.AMIdentity)44 SAMLv2Model (com.sun.identity.console.federation.model.SAMLv2Model)41 NameNotFoundException (com.sun.identity.policy.NameNotFoundException)41 CCActionTable (com.sun.web.ui.view.table.CCActionTable)40 TreeSet (java.util.TreeSet)39 CachedPolicy (com.sun.identity.console.policy.model.CachedPolicy)38