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 KeycloakSession` | `identitySession`
    `protected static org.jboss.logging.Logger` | `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RealmManager(KeycloakSession identitySession)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addComposites(RoleModel role, RoleRepresentation roleRep, RealmModel realm)`
    `void` | `addRequiredCredential(RealmModel newRealm, String requiredCred)`
    `protected List<AuthenticationProviderModel>` | `convertAuthenticationProviders(List<AuthenticationProviderRepresentation> authenticationProviders)`
    `protected Map<String,ApplicationModel>` | `createApplications(RealmRepresentation rep, RealmModel realm)`
    `protected void` | `createOAuthClients(RealmRepresentation realmRep, RealmModel realm)`
    `RealmModel` | `createRealm(String name)`
    `RealmModel` | `createRealm(String id, String name)`
    `void` | `createRole(RealmModel newRealm, ApplicationModel app, RoleRepresentation roleRep)`
    `void` | `createRole(RealmModel newRealm, RoleRepresentation roleRep)`
    `UserModel` | `createUser(RealmModel newRealm, UserRepresentation userRep)`
    `static UserCredentialModel` | `fromRepresentation(CredentialRepresentation cred)`
    `void` | `generateRealmKeys(RealmModel realm)`
    `String` | `getContextPath()`
    `RealmModel` | `getKeycloakAdminstrationRealm()`
    `String` | `getMasterRealmAdminApplicationName(RealmModel realm)`
    `RealmModel` | `getRealm(String id)`
    `String` | `getRealmAdminApplicationName(RealmModel realm)`
    `RealmModel` | `getRealmByName(String name)`
    `RealmModel` | `importRealm(RealmRepresentation rep)`
    `void` | `importRealm(RealmRepresentation rep, RealmModel newRealm)`
    `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` | `updateRealm(RealmRepresentation rep, RealmModel realm)`
    `void` | `updateRealmAudit(RealmAuditRepresentation 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

    - #### identitySession

          protected KeycloakSession identitySession

    - #### contextPath

          protected String contextPath

  - ### Constructor Detail

    - #### RealmManager

          public RealmManager(KeycloakSession identitySession)

  - ### Method Detail

    - #### getContextPath

          public String getContextPath()

    - #### setContextPath

          public void setContextPath(String contextPath)

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

    - #### getMasterRealmAdminApplicationName

          public String getMasterRealmAdminApplicationName(RealmModel realm)

    - #### getRealmAdminApplicationName

          public String getRealmAdminApplicationName(RealmModel realm)

    - #### setupRealmDefaults

          protected void setupRealmDefaults(RealmModel realm)

    - #### removeRealm

          public boolean removeRealm(RealmModel realm)

    - #### generateRealmKeys

          public void generateRealmKeys(RealmModel realm)

    - #### updateRealm

          public void updateRealm(RealmRepresentation rep,
                         RealmModel realm)

    - #### updateRealmAudit

          public void updateRealmAudit(RealmAuditRepresentation rep,
                              RealmModel realm)

    - #### importRealm

          public RealmModel importRealm(RealmRepresentation rep)

    - #### importRealm

          public void importRealm(RealmRepresentation rep,
                         RealmModel newRealm)

    - #### addComposites

          public void addComposites(RoleModel role,
                           RoleRepresentation roleRep,
                           RealmModel realm)

    - #### createRole

          public void createRole(RealmModel newRealm,
                        RoleRepresentation roleRep)

    - #### createRole

          public void createRole(RealmModel newRealm,
                        ApplicationModel app,
                        RoleRepresentation roleRep)

    - #### createUser

          public UserModel createUser(RealmModel newRealm,
                             UserRepresentation userRep)

    - #### fromRepresentation

          public static UserCredentialModel fromRepresentation(CredentialRepresentation cred)

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

    - #### addRequiredCredential

          public void addRequiredCredential(RealmModel newRealm,
                                   String requiredCred)

    - #### createApplications

          protected Map<String,ApplicationModel> createApplications(RealmRepresentation rep,
                                                        RealmModel realm)

    - #### createOAuthClients

          protected void createOAuthClients(RealmRepresentation realmRep,
                                RealmModel realm)

    - #### convertAuthenticationProviders

          protected List<AuthenticationProviderModel> convertAuthenticationProviders(List<AuthenticationProviderRepresentation> authenticationProviders)

Copyright © 2014. All Rights Reserved.