Search in sources :

Example 6 with AMConsoleException

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

the class ResponseProviderAddViewBean method handleButton2Request.

/**
     * Handles create policy request.
     *
     * @param event Request invocation event
     */
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
    boolean forwarded = false;
    submitCycle = true;
    try {
        ResponseProvider provider = createResponseProvider();
        if (provider != null) {
            CachedPolicy cachedPolicy = getCachedPolicy();
            Policy policy = cachedPolicy.getPolicy();
            String name = (String) propertySheetModel.getValue(RESPONSEPROVIDER_NAME);
            policy.addResponseProvider(name, provider);
            backTrail();
            forwardToPolicyViewBean();
            forwarded = true;
        }
    } catch (NameAlreadyExistsException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", getModel().getErrorString(e));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    if (!forwarded) {
        forwardTo();
    }
}
Also used : Policy(com.sun.identity.policy.Policy) CachedPolicy(com.sun.identity.console.policy.model.CachedPolicy) CachedPolicy(com.sun.identity.console.policy.model.CachedPolicy) ResponseProvider(com.sun.identity.policy.interfaces.ResponseProvider) NameAlreadyExistsException(com.sun.identity.policy.NameAlreadyExistsException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 7 with AMConsoleException

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

the class ReferralEditViewBean method getDefaultValues.

protected Set getDefaultValues() {
    Set values = null;
    try {
        CachedPolicy cachedPolicy = getCachedPolicy();
        Policy policy = cachedPolicy.getPolicy();
        String referralName = (String) getPageSessionAttribute(PG_SESSION_REFERRAL_NAME);
        Referral referral = policy.getReferral(referralName);
        values = referral.getValues();
    } catch (NameNotFoundException e) {
        debug.warning("ReferralEditViewBean.getDefaultValues", e);
    } catch (AMConsoleException e) {
        debug.warning("ReferralEditViewBean.getDefaultValues", e);
    }
    return values;
}
Also used : Policy(com.sun.identity.policy.Policy) CachedPolicy(com.sun.identity.console.policy.model.CachedPolicy) Set(java.util.Set) Referral(com.sun.identity.policy.interfaces.Referral) NameNotFoundException(com.sun.identity.policy.NameNotFoundException) CachedPolicy(com.sun.identity.console.policy.model.CachedPolicy) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 8 with AMConsoleException

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

the class ReferralAddViewBean method handleButton2Request.

/**
     * Handles create policy request.
     *
     * @param event Request invocation event
     */
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
    boolean forwarded = false;
    submitCycle = true;
    try {
        Referral referral = createReferral();
        if (referral != null) {
            CachedPolicy cachedPolicy = getCachedPolicy();
            Policy policy = cachedPolicy.getPolicy();
            String name = (String) propertySheetModel.getValue(REFERRAL_NAME);
            policy.addReferral(name, referral);
            backTrail();
            forwardToPolicyViewBean();
            forwarded = true;
        }
    } catch (NameAlreadyExistsException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", getModel().getErrorString(e));
    } catch (InvalidNameException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", getModel().getErrorString(e));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    } finally {
        if (!forwarded) {
            forwardTo();
        }
    }
}
Also used : Policy(com.sun.identity.policy.Policy) CachedPolicy(com.sun.identity.console.policy.model.CachedPolicy) InvalidNameException(com.sun.identity.policy.InvalidNameException) Referral(com.sun.identity.policy.interfaces.Referral) CachedPolicy(com.sun.identity.console.policy.model.CachedPolicy) NameAlreadyExistsException(com.sun.identity.policy.NameAlreadyExistsException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 9 with AMConsoleException

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

the class RuleOpViewBeanBase method isReferralPolicy.

protected boolean isReferralPolicy() {
    try {
        CachedPolicy cachedPolicy = getCachedPolicy();
        Policy policy = cachedPolicy.getPolicy();
        return policy.isReferralPolicy();
    } catch (AMConsoleException e) {
        debug.warning("RuleOpViewBeanBase.isReferralPolicy", e);
        return false;
    }
}
Also used : Policy(com.sun.identity.policy.Policy) CachedPolicy(com.sun.identity.console.policy.model.CachedPolicy) CachedPolicy(com.sun.identity.console.policy.model.CachedPolicy) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 10 with AMConsoleException

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

the class ServerEditGeneralViewBean method handleButton1Request.

/**
     * Handles create site request.
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    String serverName = (String) getPageSessionAttribute(PG_ATTR_SERVER_NAME);
    String parentSite = (serverName.equals(ServerConfiguration.DEFAULT_SERVER_CONFIG)) ? null : (String) getDisplayFieldValue(PARENT_SITE);
    ServerSiteModel model = (ServerSiteModel) getModel();
    try {
        model.modifyServer(serverName, parentSite, getAttributeValues());
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "serverconfig.updated");
    } catch (UnknownPropertyNameException e) {
    // ignore. this cannot happen because property in this page
    // is customized.
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : UnknownPropertyNameException(com.sun.identity.common.configuration.UnknownPropertyNameException) ServerSiteModel(com.sun.identity.console.service.model.ServerSiteModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

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