Search in sources :

Example 1 with ClientStorageProviderFactory

use of org.keycloak.storage.client.ClientStorageProviderFactory in project keycloak by keycloak.

the class ClientStorageManager method getStorageProvider.

public static ClientStorageProvider getStorageProvider(KeycloakSession session, RealmModel realm, String componentId) {
    ComponentModel model = realm.getComponent(componentId);
    if (model == null)
        return null;
    ClientStorageProviderModel storageModel = new ClientStorageProviderModel(model);
    ClientStorageProviderFactory factory = (ClientStorageProviderFactory) session.getKeycloakSessionFactory().getProviderFactory(ClientStorageProvider.class, model.getProviderId());
    if (factory == null) {
        throw new ModelException("Could not find ClientStorageProviderFactory for: " + model.getProviderId());
    }
    return getStorageProviderInstance(session, storageModel, factory);
}
Also used : ClientStorageProvider(org.keycloak.storage.client.ClientStorageProvider) ModelException(org.keycloak.models.ModelException) ClientStorageProviderFactory(org.keycloak.storage.client.ClientStorageProviderFactory) ComponentModel(org.keycloak.component.ComponentModel) ClientStorageProviderModel(org.keycloak.storage.client.ClientStorageProviderModel)

Aggregations

ComponentModel (org.keycloak.component.ComponentModel)1 ModelException (org.keycloak.models.ModelException)1 ClientStorageProvider (org.keycloak.storage.client.ClientStorageProvider)1 ClientStorageProviderFactory (org.keycloak.storage.client.ClientStorageProviderFactory)1 ClientStorageProviderModel (org.keycloak.storage.client.ClientStorageProviderModel)1