org.keycloak.models.mongo.keycloak.adapters

## Class MongoRealmProvider

- java.lang.Object
- - org.keycloak.models.mongo.keycloak.adapters.MongoRealmProvider

- All Implemented Interfaces:
    RealmProvider, Provider

      public class MongoRealmProvider
      extends Object
      implements RealmProvider

  Author:
    Marek Posolda

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MongoRealmProvider(KeycloakSession session, MongoStore mongoStore, MongoStoreInvocationContext invocationContext)`

  - ### 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)`
    `protected MongoStore` | `getMongoStore()`
    `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`

- - ### Constructor Detail

    - #### MongoRealmProvider

          public MongoRealmProvider(KeycloakSession session,
                            MongoStore mongoStore,
                            MongoStoreInvocationContext invocationContext)

  - ### Method Detail

    - #### close

          public void close()

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

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

    - #### getMongoStore

          protected MongoStore getMongoStore()

    - #### 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 © 2014. All Rights Reserved.