Search in sources :

Example 11 with AMConsoleException

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

the class PolicyModelImpl method getResponseProviderTypeName.

/**
     * Returns response provider type name of a response provider.
     *
     * @param realmName Name of realm.
     * @param provider response provider instance.
     * @return response provider type name of a response provider.
     */
public String getResponseProviderTypeName(String realmName, ResponseProvider provider) {
    String typeName = null;
    try {
        PolicyManager policyMgr = getPolicyManager(realmName);
        if (policyMgr != null) {
            ResponseProviderTypeManager mgr = policyMgr.getResponseProviderTypeManager();
            typeName = mgr.getResponseProviderTypeName(provider);
        }
    } catch (AMConsoleException e) {
        debug.warning("PolicyModelImpl.getResponseProviderTypeName", e);
    }
    return typeName;
}
Also used : PolicyManager(com.sun.identity.policy.PolicyManager) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) ResponseProviderTypeManager(com.sun.identity.policy.ResponseProviderTypeManager)

Example 12 with AMConsoleException

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

the class PolicyModelImpl method createPolicy.

/**
     * Creates a policy.
     *
     * @param realmName Name of realm.
     * @param policy Policy object.
     * @throws AMConsoleException if policy cannot be created.
     */
public void createPolicy(String realmName, Policy policy) throws AMConsoleException {
    try {
        String[] params = { realmName, policy.getName() };
        logEvent("ATTEMPT_CREATE_POLICY", params);
        PolicyManager policyManager = getPolicyManager(realmName);
        policyManager.addPolicy(policy);
        logEvent("SUCCEED_CREATE_POLICY", params);
    } catch (PolicyException e) {
        String strError = getErrorString(e);
        String[] params = { realmName, policy.getName(), strError };
        logEvent("POLICY_EXCEPTION_CREATE_POLICY", params);
        throw new AMConsoleException(getErrorString(e));
    } catch (SSOException e) {
        String strError = getErrorString(e);
        String[] params = { realmName, policy.getName(), strError };
        logEvent("SSO_EXCEPTION_CREATE_POLICY", params);
        throw new AMConsoleException(getErrorString(e));
    }
}
Also used : PolicyManager(com.sun.identity.policy.PolicyManager) PolicyException(com.sun.identity.policy.PolicyException) SSOException(com.iplanet.sso.SSOException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 13 with AMConsoleException

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

the class PolicyModelImpl method getSubjectViewBeanURL.

/**
     * Returns properties view bean URL of a subject.
     *
     * @param realmName Name of realm.
     * @param subject Subject instance.
     * @return properties view bean URL of a subject.
     */
public String getSubjectViewBeanURL(String realmName, Subject subject) {
    String url = null;
    try {
        PolicyManager policyMgr = getPolicyManager(realmName);
        if (policyMgr != null) {
            SubjectTypeManager subjectTypeMgr = policyMgr.getSubjectTypeManager();
            url = subjectTypeMgr.getViewBeanURL(subject);
        }
    } catch (AMConsoleException e) {
        debug.warning("PolicyModelImpl.getSubjectViewBeanURL", e);
    }
    return url;
}
Also used : PolicyManager(com.sun.identity.policy.PolicyManager) SubjectTypeManager(com.sun.identity.policy.SubjectTypeManager) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 14 with AMConsoleException

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

the class PolicyModelImpl method getConditionViewBeanURL.

/**
     * Returns properties view bean URL of a condition.
     *
     * @param realmName Name of realm.
     * @param condition Condition Object.
     * @return properties view bean URL of a condition.
     */
public String getConditionViewBeanURL(String realmName, Condition condition) {
    String url = null;
    try {
        PolicyManager policyMgr = getPolicyManager(realmName);
        if (policyMgr != null) {
            ConditionTypeManager conditionTypeMgr = policyMgr.getConditionTypeManager();
            url = conditionTypeMgr.getViewBeanURL(condition);
        }
    } catch (AMConsoleException e) {
        debug.warning("PolicyModelImpl.getConditionViewBeanURL", e);
    }
    return url;
}
Also used : PolicyManager(com.sun.identity.policy.PolicyManager) ConditionTypeManager(com.sun.identity.policy.ConditionTypeManager) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 15 with AMConsoleException

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

the class PolicyModelImpl method getConditionViewBeanURL.

/**
     * Returns properties view bean URL of a condition.
     *
     * @param realmName Name of realm.
     * @param conditionTypeName Name of Condition Type.
     * @return properties view bean URL of a condition.
     */
public String getConditionViewBeanURL(String realmName, String conditionTypeName) {
    String url = null;
    try {
        PolicyManager policyMgr = getPolicyManager(realmName);
        if (policyMgr != null) {
            ConditionTypeManager condTypeMgr = policyMgr.getConditionTypeManager();
            Condition condition = condTypeMgr.getCondition(conditionTypeName);
            url = condTypeMgr.getViewBeanURL(condition);
        }
    } catch (AMConsoleException e) {
        debug.warning("PolicyModelImpl.getConditionViewBeanURL", e);
    } catch (NameNotFoundException e) {
        debug.warning("PolicyModelImpl.getConditionViewBeanURL", e);
    } catch (PolicyException e) {
        debug.warning("PolicyModelImpl.getConditionViewBeanURL", e);
    }
    return url;
}
Also used : Condition(com.sun.identity.policy.interfaces.Condition) PolicyManager(com.sun.identity.policy.PolicyManager) ConditionTypeManager(com.sun.identity.policy.ConditionTypeManager) NameNotFoundException(com.sun.identity.policy.NameNotFoundException) PolicyException(com.sun.identity.policy.PolicyException) 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