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, MongoStoreInvocationContext invocationContext)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClientModel` | `addClient(RealmModel realm, String clientId)`
    `ClientModel` | `addClient(RealmModel realm, String id, String clientId)`
    `RoleModel` | `addClientRole(RealmModel realm, ClientModel client, String name)`
    `RoleModel` | `addClientRole(RealmModel realm, ClientModel client, String id, String name)`
    `RoleModel` | `addRealmRole(RealmModel realm, String name)`
    `RoleModel` | `addRealmRole(RealmModel realm, String id, String name)`
    `void` | `addTopLevelGroup(RealmModel realm, GroupModel subGroup)`
    `void` | `close()`
    `GroupModel` | `createGroup(RealmModel realm, String name)`
    `GroupModel` | `createGroup(RealmModel realm, String id, String name)`
    `RealmModel` | `createRealm(String name)`
    `RealmModel` | `createRealm(String id, String name)`
    `ClientModel` | `getClientByClientId(String clientId, RealmModel realm)`
    `ClientModel` | `getClientById(String id, RealmModel realm)`
    `RoleModel` | `getClientRole(RealmModel realm, ClientModel client, String name)`
    `Set<RoleModel>` | `getClientRoles(RealmModel realm, ClientModel client)`
    `List<ClientModel>` | `getClients(RealmModel realm)`
    `ClientTemplateModel` | `getClientTemplateById(String id, RealmModel realm)`
    `GroupModel` | `getGroupById(String id, RealmModel realm)`
    `List<GroupModel>` | `getGroups(RealmModel realm)`
    `MigrationModel` | `getMigrationModel()`
    `protected MongoStore` | `getMongoStore()`
    `RealmModel` | `getRealm(String id)`
    `RealmModel` | `getRealmByName(String name)`
    `RoleModel` | `getRealmRole(RealmModel realm, String name)`
    `Set<RoleModel>` | `getRealmRoles(RealmModel realm)`
    `List<RealmModel>` | `getRealms()`
    `RoleModel` | `getRoleById(String id, RealmModel realm)`
    `List<GroupModel>` | `getTopLevelGroups(RealmModel realm)`
    `void` | `moveGroup(RealmModel realm, GroupModel group, GroupModel toParent)`
    `boolean` | `removeClient(String id, RealmModel realm)`
    `boolean` | `removeGroup(RealmModel realm, GroupModel group)`
    `boolean` | `removeRealm(String id)`
    `boolean` | `removeRole(RealmModel realm, RoleModel role)`

    - ### 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,
                                    MongoStoreInvocationContext invocationContext)

  - ### Method Detail

    - #### close

          public void close()

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

    - #### getMigrationModel

          public MigrationModel getMigrationModel()

      Specified by:
        `getMigrationModel` in interface `RealmProvider`

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

    - #### getGroupById

          public GroupModel getGroupById(String id,
                                         RealmModel realm)

      Specified by:
        `getGroupById` in interface `RealmProvider`

    - #### moveGroup

          public void moveGroup(RealmModel realm,
                                GroupModel group,
                                GroupModel toParent)

      Specified by:
        `moveGroup` in interface `RealmProvider`

    - #### getGroups

          public List<GroupModel> getGroups(RealmModel realm)

      Specified by:
        `getGroups` in interface `RealmProvider`

    - #### getTopLevelGroups

          public List<GroupModel> getTopLevelGroups(RealmModel realm)

      Specified by:
        `getTopLevelGroups` in interface `RealmProvider`

    - #### removeGroup

          public boolean removeGroup(RealmModel realm,
                                     GroupModel group)

      Specified by:
        `removeGroup` in interface `RealmProvider`

    - #### createGroup

          public GroupModel createGroup(RealmModel realm,
                                        String name)

      Specified by:
        `createGroup` in interface `RealmProvider`

    - #### createGroup

          public GroupModel createGroup(RealmModel realm,
                                        String id,
                                        String name)

      Specified by:
        `createGroup` in interface `RealmProvider`

    - #### addTopLevelGroup

          public void addTopLevelGroup(RealmModel realm,
                                       GroupModel subGroup)

      Specified by:
        `addTopLevelGroup` in interface `RealmProvider`

    - #### getClientById

          public ClientModel getClientById(String id,
                                           RealmModel realm)

      Specified by:
        `getClientById` in interface `RealmProvider`

    - #### addClient

          public ClientModel addClient(RealmModel realm,
                                       String clientId)

      Specified by:
        `addClient` in interface `RealmProvider`

    - #### addClient

          public ClientModel addClient(RealmModel realm,
                                       String id,
                                       String clientId)

      Specified by:
        `addClient` in interface `RealmProvider`

    - #### getClients

          public List<ClientModel> getClients(RealmModel realm)

      Specified by:
        `getClients` in interface `RealmProvider`

    - #### addRealmRole

          public RoleModel addRealmRole(RealmModel realm,
                                        String name)

      Specified by:
        `addRealmRole` in interface `RealmProvider`

    - #### addRealmRole

          public RoleModel addRealmRole(RealmModel realm,
                                        String id,
                                        String name)

      Specified by:
        `addRealmRole` in interface `RealmProvider`

    - #### getRealmRoles

          public Set<RoleModel> getRealmRoles(RealmModel realm)

      Specified by:
        `getRealmRoles` in interface `RealmProvider`

    - #### getClientRoles

          public Set<RoleModel> getClientRoles(RealmModel realm,
                                               ClientModel client)

      Specified by:
        `getClientRoles` in interface `RealmProvider`

    - #### getRealmRole

          public RoleModel getRealmRole(RealmModel realm,
                                        String name)

      Specified by:
        `getRealmRole` in interface `RealmProvider`

    - #### getClientRole

          public RoleModel getClientRole(RealmModel realm,
                                         ClientModel client,
                                         String name)

      Specified by:
        `getClientRole` in interface `RealmProvider`

    - #### addClientRole

          public RoleModel addClientRole(RealmModel realm,
                                         ClientModel client,
                                         String name)

      Specified by:
        `addClientRole` in interface `RealmProvider`

    - #### addClientRole

          public RoleModel addClientRole(RealmModel realm,
                                         ClientModel client,
                                         String id,
                                         String name)

      Specified by:
        `addClientRole` in interface `RealmProvider`

    - #### removeRole

          public boolean removeRole(RealmModel realm,
                                    RoleModel role)

      Specified by:
        `removeRole` in interface `RealmProvider`

    - #### removeClient

          public boolean removeClient(String id,
                                      RealmModel realm)

      Specified by:
        `removeClient` in interface `RealmProvider`

    - #### getClientByClientId

          public ClientModel getClientByClientId(String clientId,
                                                 RealmModel realm)

      Specified by:
        `getClientByClientId` in interface `RealmProvider`

    - #### getClientTemplateById

          public ClientTemplateModel getClientTemplateById(String id,
                                                           RealmModel realm)

      Specified by:
        `getClientTemplateById` in interface `RealmProvider`

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