org.keycloak.models.jpa

## Class JpaRealmProvider

- java.lang.Object
- - org.keycloak.models.jpa.JpaRealmProvider

- All Implemented Interfaces:
    RealmProvider, Provider

      public class JpaRealmProvider
      extends Object
      implements RealmProvider

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected javax.persistence.EntityManager` | `em`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JpaRealmProvider(KeycloakSession session, javax.persistence.EntityManager em)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `RealmModel` | `createRealm(String name)`
    `RealmModel` | `createRealm(String id, String name)`
    `ApplicationModel` | `getApplicationById(String id, RealmModel realm)`
    `OAuthClientModel` | `getOAuthClientById(String id, RealmModel realm)`
    `RealmModel` | `getRealm(String id)`
    `RealmModel` | `getRealmByName(String name)`
    `List<RealmModel>` | `getRealms()`
    `RoleModel` | `getRoleById(String id, RealmModel realm)`
    `boolean` | `removeRealm(String id)`

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

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

- - ### Field Detail

    - #### em

          protected javax.persistence.EntityManager em

  - ### Constructor Detail

    - #### JpaRealmProvider

          public JpaRealmProvider(KeycloakSession session,
                          javax.persistence.EntityManager em)

  - ### Method Detail

    - #### createRealm

          public RealmModel createRealm(String name)

      Specified by:
        `createRealm` in interface `RealmProvider`

    - #### createRealm

          public RealmModel createRealm(String id,
                               String name)

      Specified by:
        `createRealm` in interface `RealmProvider`

    - #### getRealm

          public RealmModel getRealm(String id)

      Specified by:
        `getRealm` in interface `RealmProvider`

    - #### getRealms

          public List<RealmModel> getRealms()

      Specified by:
        `getRealms` in interface `RealmProvider`

    - #### getRealmByName

          public RealmModel getRealmByName(String name)

      Specified by:
        `getRealmByName` in interface `RealmProvider`

    - #### removeRealm

          public boolean removeRealm(String id)

      Specified by:
        `removeRealm` in interface `RealmProvider`

    - #### close

          public void close()

      Specified by:
        `close` in interface `RealmProvider`
      Specified by:
        `close` in interface `Provider`

    - #### getRoleById

          public RoleModel getRoleById(String id,
                              RealmModel realm)

      Specified by:
        `getRoleById` in interface `RealmProvider`

    - #### getApplicationById

          public ApplicationModel getApplicationById(String id,
                                            RealmModel realm)

      Specified by:
        `getApplicationById` in interface `RealmProvider`

    - #### getOAuthClientById

          public OAuthClientModel getOAuthClientById(String id,
                                            RealmModel realm)

      Specified by:
        `getOAuthClientById` in interface `RealmProvider`

Copyright © 2015. All Rights Reserved.