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 String` | `contextPath`
    `protected static org.jboss.logging.Logger` | `logger`
    `protected RealmProvider` | `model`
    `protected KeycloakSession` | `session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RealmManager(KeycloakSession session)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `RealmModel` | `createRealm(String name)`
    `RealmModel` | `createRealm(String id, String name)`
    `String` | `getContextPath()`
    `RealmModel` | `getKeycloakAdminstrationRealm()`
    `RealmModel` | `getRealm(String id)`
    `String` | `getRealmAdminApplicationName(RealmModel realm)`
    `String` | `getRealmAdminApplicationName(RealmRepresentation realm)`
    `RealmModel` | `getRealmByName(String name)`
    `KeycloakSession` | `getSession()`
    `RealmModel` | `importRealm(RealmRepresentation rep)`
    `boolean` | `removeRealm(RealmModel realm)`
    `List<UserModel>` | `searchUsers(String searchString, RealmModel realmModel)` Query users based on a search string: "Bill Burke" first and last name "bburke@redhat.com" email "Burke" lastname or username
    `void` | `setContextPath(String contextPath)`
    `protected void` | `setupAdminConsole(RealmModel realm)`
    `protected void` | `setupRealmDefaults(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

    - #### logger

          protected static final org.jboss.logging.Logger logger

    - #### session

          protected KeycloakSession session

    - #### model

          protected RealmProvider model

    - #### contextPath

          protected String contextPath

  - ### Constructor Detail

    - #### RealmManager

          public RealmManager(KeycloakSession session)

  - ### Method Detail

    - #### getContextPath

          public String getContextPath()

    - #### setContextPath

          public void setContextPath(String contextPath)

    - #### 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)

    - #### setupAdminConsole

          protected void setupAdminConsole(RealmModel realm)

    - #### getRealmAdminApplicationName

          public String getRealmAdminApplicationName(RealmModel realm)

    - #### getRealmAdminApplicationName

          public String getRealmAdminApplicationName(RealmRepresentation realm)

    - #### setupRealmDefaults

          protected void setupRealmDefaults(RealmModel realm)

    - #### removeRealm

          public boolean removeRealm(RealmModel realm)

    - #### updateRealmEventsConfig

          public void updateRealmEventsConfig(RealmEventsConfigRepresentation rep,
                                     RealmModel realm)

    - #### importRealm

          public RealmModel importRealm(RealmRepresentation rep)

    - #### searchUsers

          public List<UserModel> searchUsers(String searchString,
                                    RealmModel realmModel)

      Query users based on a search string:

      "Bill Burke" first and last name "bburke@redhat.com" email "Burke" lastname or username
      Parameters:
        `searchString` -
        `realmModel` -
      Returns:

Copyright © 2015. All Rights Reserved.