Search in sources :

Example 1 with ServiceConfigQueryFilterVisitor

use of org.forgerock.openam.sm.ServiceConfigQueryFilterVisitor in project OpenAM by OpenRock.

the class ScriptConfigurationDataStore method get.

@Override
public Set<ScriptConfiguration> get(QueryFilter<String> queryFilter) throws ScriptException {
    final Set<ScriptConfiguration> scriptConfigurations = new LinkedHashSet<>();
    try {
        ServiceConfig config = getSubOrgConfig();
        Set<String> uuids = config.getSubConfigNames();
        for (String uuid : uuids) {
            if (queryFilter.accept(new ServiceConfigQueryFilterVisitor(), config.getSubConfig(uuid))) {
                scriptConfigurations.add(get(uuid));
            }
        }
        config = getSubGlobalConfig();
        uuids = config.getSubConfigNames();
        for (String uuid : uuids) {
            if (queryFilter.accept(new ServiceConfigQueryFilterVisitor(), config.getSubConfig(uuid))) {
                scriptConfigurations.add(get(uuid));
            }
        }
    } catch (SMSException | SSOException e) {
        throw createAndLogError(logger, RETRIEVE_ALL_FAILED, e, realm);
    } catch (UnsupportedOperationException e) {
        throw createAndLogError(logger, ScriptErrorCode.valueOf(e.getMessage()), e);
    }
    return scriptConfigurations;
}
Also used : LinkedHashSet(java.util.LinkedHashSet) ServiceConfigQueryFilterVisitor(org.forgerock.openam.sm.ServiceConfigQueryFilterVisitor) ServiceConfig(com.sun.identity.sm.ServiceConfig) SMSException(com.sun.identity.sm.SMSException) ScriptConfiguration(org.forgerock.openam.scripting.service.ScriptConfiguration) SSOException(com.iplanet.sso.SSOException)

Aggregations

SSOException (com.iplanet.sso.SSOException)1 SMSException (com.sun.identity.sm.SMSException)1 ServiceConfig (com.sun.identity.sm.ServiceConfig)1 LinkedHashSet (java.util.LinkedHashSet)1 ScriptConfiguration (org.forgerock.openam.scripting.service.ScriptConfiguration)1 ServiceConfigQueryFilterVisitor (org.forgerock.openam.sm.ServiceConfigQueryFilterVisitor)1