Search in sources :

Example 1 with ScriptingDataStore

use of org.forgerock.openam.scripting.datastore.ScriptingDataStore in project OpenAM by OpenRock.

the class ScriptingGuiceModule method configure.

@Override
protected void configure() {
    bind(ScriptValidator.class).to(StandardScriptValidator.class);
    bind(Logger.class).annotatedWith(Names.named("ScriptLogger")).toInstance(logger);
    install(new FactoryModuleBuilder().implement(new TypeLiteral<ScriptingService>() {
    }, ScriptConfigurationService.class).build(new TypeLiteral<ScriptingServiceFactory>() {
    }));
    install(new FactoryModuleBuilder().implement(new TypeLiteral<ScriptingDataStore>() {
    }, ScriptConfigurationDataStore.class).build(new TypeLiteral<ScriptingDataStoreFactory>() {
    }));
    bind(StandardScriptEngineManager.class).annotatedWith(Names.named(AUTHENTICATION_SERVER_SIDE.name())).toInstance(new StandardScriptEngineManager());
    bind(StandardScriptEngineManager.class).annotatedWith(Names.named(POLICY_CONDITION.name())).toInstance(new StandardScriptEngineManager());
    bind(StandardScriptEngineManager.class).annotatedWith(Names.named(OIDC_CLAIMS.name())).toInstance(new StandardScriptEngineManager());
    bind(RestletHttpClient.class).annotatedWith(Names.named(SupportedScriptingLanguage.JAVASCRIPT.name())).to(JavaScriptHttpClient.class);
    bind(RestletHttpClient.class).annotatedWith(Names.named(SupportedScriptingLanguage.GROOVY.name())).to(GroovyHttpClient.class);
    try {
        bind(Client.class).annotatedWith(Names.named("ScriptingHttpClient")).toInstance(new Client(new HttpClientHandler()));
    } catch (HttpApplicationException e) {
        logger.error("Failed to create HttpClientHandler", e);
    }
}
Also used : StandardScriptEngineManager(org.forgerock.openam.scripting.StandardScriptEngineManager) ScriptingService(org.forgerock.openam.scripting.service.ScriptingService) TypeLiteral(com.google.inject.TypeLiteral) FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder) ScriptingDataStore(org.forgerock.openam.scripting.datastore.ScriptingDataStore) StandardScriptValidator(org.forgerock.openam.scripting.StandardScriptValidator) ScriptValidator(org.forgerock.openam.scripting.ScriptValidator) RestletHttpClient(org.forgerock.http.client.RestletHttpClient) JavaScriptHttpClient(org.forgerock.openam.scripting.api.http.JavaScriptHttpClient) Client(org.forgerock.http.Client) GroovyHttpClient(org.forgerock.openam.scripting.api.http.GroovyHttpClient) HttpClientHandler(org.forgerock.http.handler.HttpClientHandler) HttpApplicationException(org.forgerock.http.HttpApplicationException)

Aggregations

TypeLiteral (com.google.inject.TypeLiteral)1 FactoryModuleBuilder (com.google.inject.assistedinject.FactoryModuleBuilder)1 Client (org.forgerock.http.Client)1 HttpApplicationException (org.forgerock.http.HttpApplicationException)1 RestletHttpClient (org.forgerock.http.client.RestletHttpClient)1 HttpClientHandler (org.forgerock.http.handler.HttpClientHandler)1 ScriptValidator (org.forgerock.openam.scripting.ScriptValidator)1 StandardScriptEngineManager (org.forgerock.openam.scripting.StandardScriptEngineManager)1 StandardScriptValidator (org.forgerock.openam.scripting.StandardScriptValidator)1 GroovyHttpClient (org.forgerock.openam.scripting.api.http.GroovyHttpClient)1 JavaScriptHttpClient (org.forgerock.openam.scripting.api.http.JavaScriptHttpClient)1 ScriptingDataStore (org.forgerock.openam.scripting.datastore.ScriptingDataStore)1 ScriptingService (org.forgerock.openam.scripting.service.ScriptingService)1