Search in sources :

Example 1 with SAML2TokenRepository

use of org.forgerock.openam.federation.saml2.SAML2TokenRepository in project OpenAM by OpenRock.

the class CoreGuiceModule method getSAML2TokenRepository.

@Provides
@Singleton
SAML2TokenRepository getSAML2TokenRepository() {
    final String DEFAULT_REPOSITORY_CLASS = "org.forgerock.openam.cts.impl.SAML2CTSPersistentStore";
    final String REPOSITORY_CLASS_PROPERTY = "com.sun.identity.saml2.plugins.SAML2RepositoryImpl";
    final String CTS_SAML2_REPOSITORY_CLASS_NAME = SystemPropertiesManager.get(REPOSITORY_CLASS_PROPERTY, DEFAULT_REPOSITORY_CLASS);
    SAML2TokenRepository result;
    try {
        // Use Guice to create class to get all of its dependency goodness
        result = InjectorHolder.getInstance(Class.forName(CTS_SAML2_REPOSITORY_CLASS_NAME).asSubclass(SAML2TokenRepository.class));
    } catch (ClassNotFoundException e) {
        throw new IllegalStateException(e);
    }
    return result;
}
Also used : SAML2TokenRepository(org.forgerock.openam.federation.saml2.SAML2TokenRepository) Singleton(javax.inject.Singleton) Provides(com.google.inject.Provides)

Aggregations

Provides (com.google.inject.Provides)1 Singleton (javax.inject.Singleton)1 SAML2TokenRepository (org.forgerock.openam.federation.saml2.SAML2TokenRepository)1