Search in sources :

Example 1 with RoleStorageProviderModel

use of org.keycloak.storage.role.RoleStorageProviderModel in project keycloak by keycloak.

the class RoleStorageManager method getStorageProvider.

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

Aggregations

ComponentModel (org.keycloak.component.ComponentModel)1 ModelException (org.keycloak.models.ModelException)1 RoleStorageProvider (org.keycloak.storage.role.RoleStorageProvider)1 RoleStorageProviderFactory (org.keycloak.storage.role.RoleStorageProviderFactory)1 RoleStorageProviderModel (org.keycloak.storage.role.RoleStorageProviderModel)1