Search in sources :

Example 1 with ResponseProviderTypeManager

use of com.sun.identity.policy.ResponseProviderTypeManager in project OpenAM by OpenRock.

the class PolicyModelImpl method getResponseProviderViewBeanURL.

/**
     * Returns properties view bean URL of a response provider.
     *
     * @param realmName Name of realm.
     * @param typeName Name of response provider Type.
     * @return properties view bean URL of a response provider.
     */
public String getResponseProviderViewBeanURL(String realmName, String typeName) {
    String url = null;
    try {
        PolicyManager policyMgr = getPolicyManager(realmName);
        if (policyMgr != null) {
            ResponseProviderTypeManager mgr = policyMgr.getResponseProviderTypeManager();
            ResponseProvider provider = mgr.getResponseProvider(typeName);
            url = mgr.getViewBeanURL(provider);
        }
    } catch (AMConsoleException e) {
        debug.warning("PolicyModelImpl.getResponseProviderViewBeanURL", e);
    } catch (NameNotFoundException e) {
        debug.warning("PolicyModelImpl.getResponseProviderViewBeanURL", e);
    } catch (PolicyException e) {
        debug.warning("PolicyModelImpl.getResponseProviderViewBeanURL", e);
    }
    return url;
}
Also used : PolicyManager(com.sun.identity.policy.PolicyManager) NameNotFoundException(com.sun.identity.policy.NameNotFoundException) PolicyException(com.sun.identity.policy.PolicyException) ResponseProvider(com.sun.identity.policy.interfaces.ResponseProvider) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) ResponseProviderTypeManager(com.sun.identity.policy.ResponseProviderTypeManager)

Example 2 with ResponseProviderTypeManager

use of com.sun.identity.policy.ResponseProviderTypeManager in project OpenAM by OpenRock.

the class PolicyModelImpl method getResponseProviderViewBeanURL.

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

Example 3 with ResponseProviderTypeManager

use of com.sun.identity.policy.ResponseProviderTypeManager in project OpenAM by OpenRock.

the class PolicyModelImpl method createResponseProvider.

/**
     * Returns a response provider object.
     *
     * @param realmName Name of Realm.
     * @param providerType Name of response provider type.
     * @param values Values of the response provider.
     * @return response provider object.
     * @throws AMConsoleException if response provider cannot be created.
     */
public ResponseProvider createResponseProvider(String realmName, String providerType, Map values) throws AMConsoleException {
    ResponseProvider provider = null;
    try {
        PolicyManager policyMgr = getPolicyManager(realmName);
        if (policyMgr != null) {
            ResponseProviderTypeManager mgr = policyMgr.getResponseProviderTypeManager();
            provider = mgr.getResponseProvider(providerType);
            provider.setProperties(values);
        }
    } catch (NameNotFoundException e) {
        throw new AMConsoleException(getErrorString(e));
    } catch (PolicyException e) {
        throw new AMConsoleException(getErrorString(e));
    }
    return provider;
}
Also used : PolicyManager(com.sun.identity.policy.PolicyManager) NameNotFoundException(com.sun.identity.policy.NameNotFoundException) PolicyException(com.sun.identity.policy.PolicyException) ResponseProvider(com.sun.identity.policy.interfaces.ResponseProvider) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) ResponseProviderTypeManager(com.sun.identity.policy.ResponseProviderTypeManager)

Example 4 with ResponseProviderTypeManager

use of com.sun.identity.policy.ResponseProviderTypeManager 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 5 with ResponseProviderTypeManager

use of com.sun.identity.policy.ResponseProviderTypeManager in project OpenAM by OpenRock.

the class PolicyModelImpl method getResponseProviderInstance.

private ResponseProvider getResponseProviderInstance(String realmName, String typeName) {
    ResponseProvider provider = null;
    try {
        PolicyManager policyMgr = getPolicyManager(realmName);
        if (policyMgr != null) {
            ResponseProviderTypeManager mgr = policyMgr.getResponseProviderTypeManager();
            provider = mgr.getResponseProvider(typeName);
        }
    } catch (AMConsoleException e) {
        debug.warning("PolicyModelImpl.getResponseProviderInstance", e);
    } catch (NameNotFoundException e) {
        debug.warning("PolicyModelImpl.getResponseProviderInstance", e);
    } catch (PolicyException e) {
        debug.warning("PolicyModelImpl.getResponseProviderInstance", e);
    }
    return provider;
}
Also used : PolicyManager(com.sun.identity.policy.PolicyManager) NameNotFoundException(com.sun.identity.policy.NameNotFoundException) PolicyException(com.sun.identity.policy.PolicyException) ResponseProvider(com.sun.identity.policy.interfaces.ResponseProvider) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) ResponseProviderTypeManager(com.sun.identity.policy.ResponseProviderTypeManager)

Aggregations

AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)6 PolicyManager (com.sun.identity.policy.PolicyManager)6 ResponseProviderTypeManager (com.sun.identity.policy.ResponseProviderTypeManager)6 NameNotFoundException (com.sun.identity.policy.NameNotFoundException)4 PolicyException (com.sun.identity.policy.PolicyException)4 ResponseProvider (com.sun.identity.policy.interfaces.ResponseProvider)3 SSOException (com.iplanet.sso.SSOException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 Set (java.util.Set)1