org.keycloak.services.managers

## Class RealmManager

- java.lang.Object
- - org.keycloak.services.managers.RealmManager

-     public class RealmManager
      extends Object

  Per request object
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected RealmProvider` | `model`
    `protected KeycloakSession` | `session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RealmManager(KeycloakSession session)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addQueryCompositeRoles(ClientModel realmAccess)`
    `protected void` | `createDefaultClientScopes(RealmModel realm)`
    `RealmModel` | `createRealm(String name)`
    `RealmModel` | `createRealm(String id, String name)`
    `RealmModel` | `getKeycloakAdminstrationRealm()`
    `RealmModel` | `getRealm(String id)`
    `String` | `getRealmAdminClientId(RealmModel realm)`
    `String` | `getRealmAdminClientId(RealmRepresentation realm)`
    `RealmModel` | `getRealmByName(String name)`
    `KeycloakSession` | `getSession()`
    `RealmModel` | `importRealm(RealmRepresentation rep)`
    `RealmModel` | `importRealm(RealmRepresentation rep, boolean skipUserDependent)` if "skipUserDependent" is true, then import of any models, which needs users already imported in DB, will be skipped.
    `boolean` | `removeRealm(RealmModel realm)`
    `void` | `setupAdminCli(RealmModel realm)`
    `protected void` | `setupAdminConsole(RealmModel realm)`
    `protected void` | `setupAdminConsoleLocaleMapper(RealmModel realm)`
    `protected void` | `setupAuthenticationFlows(RealmModel realm)`
    `void` | `setupBrokerService(RealmModel realm)`
    `void` | `setupClientServiceAccountsAndAuthorizationOnImport(RealmRepresentation rep, boolean skipUserDependent)`
    `void` | `setupImpersonationService(RealmModel realm)`
    `void` | `setupMasterAdminManagement(RealmModel realm)`
    `protected void` | `setupRealmDefaults(RealmModel realm)`
    `protected void` | `setupRequiredActions(RealmModel realm)`
    `void` | `updateRealmEventsConfig(RealmEventsConfigRepresentation rep, RealmModel realm)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### session

          protected KeycloakSession session

    - #### model

          protected RealmProvider model

  - ### Constructor Detail

    - #### RealmManager

          public RealmManager(KeycloakSession session)

  - ### Method Detail

    - #### getSession

          public KeycloakSession getSession()

    - #### getKeycloakAdminstrationRealm

          public RealmModel getKeycloakAdminstrationRealm()

    - #### getRealm

          public RealmModel getRealm(String id)

    - #### getRealmByName

          public RealmModel getRealmByName(String name)

    - #### createRealm

          public RealmModel createRealm(String name)

    - #### createRealm

          public RealmModel createRealm(String id,
                                        String name)

    - #### setupAuthenticationFlows

          protected void setupAuthenticationFlows(RealmModel realm)

    - #### setupRequiredActions

          protected void setupRequiredActions(RealmModel realm)

    - #### createDefaultClientScopes

          protected void createDefaultClientScopes(RealmModel realm)

    - #### setupAdminConsole

          protected void setupAdminConsole(RealmModel realm)

    - #### setupAdminConsoleLocaleMapper

          protected void setupAdminConsoleLocaleMapper(RealmModel realm)

    - #### setupAdminCli

          public void setupAdminCli(RealmModel realm)

    - #### addQueryCompositeRoles

          public void addQueryCompositeRoles(ClientModel realmAccess)

    - #### getRealmAdminClientId

          public String getRealmAdminClientId(RealmModel realm)

    - #### getRealmAdminClientId

          public String getRealmAdminClientId(RealmRepresentation realm)

    - #### setupRealmDefaults

          protected void setupRealmDefaults(RealmModel realm)

    - #### removeRealm

          public boolean removeRealm(RealmModel realm)

    - #### updateRealmEventsConfig

          public void updateRealmEventsConfig(RealmEventsConfigRepresentation rep,
                                              RealmModel realm)

    - #### setupMasterAdminManagement

          public void setupMasterAdminManagement(RealmModel realm)

    - #### setupImpersonationService

          public void setupImpersonationService(RealmModel realm)

    - #### setupBrokerService

          public void setupBrokerService(RealmModel realm)

    - #### importRealm

          public RealmModel importRealm(RealmRepresentation rep)

    - #### importRealm

          public RealmModel importRealm(RealmRepresentation rep,
                                        boolean skipUserDependent)

      if "skipUserDependent" is true, then import of any models, which needs users already imported in DB, will be skipped. For example authorization

    - #### setupClientServiceAccountsAndAuthorizationOnImport

          public void setupClientServiceAccountsAndAuthorizationOnImport(RealmRepresentation rep,
                                                                         boolean skipUserDependent)

Copyright © 2021 JBoss by Red Hat. All rights reserved.