org.keycloak.models

## Interface KeycloakSession

- All Known Implementing Classes:
    DefaultKeycloakSession

      public interface KeycloakSession

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `enlistForClose(Provider provider)`
    `<T extends Provider> Set<T>` | `getAllProviders(Class<T> clazz)`
    `KeycloakSessionFactory` | `getKeycloakSessionFactory()`
    `<T extends Provider> T` | `getProvider(Class<T> clazz)`
    `<T extends Provider> T` | `getProvider(Class<T> clazz, String id)`
    `KeycloakTransactionManager` | `getTransaction()`
    `<T extends Provider> Set<String>` | `listProviderIds(Class<T> clazz)`
    `RealmProvider` | `realms()` Returns a managed provider instance.
    `UserSessionProvider` | `sessions()` Returns a managed provider instance.
    `UserFederationManager` | `users()` Possibly both cached and federated view of users depending on configuration.
    `UserProvider` | `userStorage()` Keycloak user storage.

- - ### Method Detail

    - #### getTransaction

          KeycloakTransactionManager getTransaction()

    - #### getProvider

          <T extends Provider> T getProvider(Class<T> clazz)

    - #### getProvider

          <T extends Provider> T getProvider(Class<T> clazz,
                                           String id)

    - #### listProviderIds

          <T extends Provider> Set<String> listProviderIds(Class<T> clazz)

    - #### getAllProviders

          <T extends Provider> Set<T> getAllProviders(Class<T> clazz)

    - #### enlistForClose

          void enlistForClose(Provider provider)

    - #### getKeycloakSessionFactory

          KeycloakSessionFactory getKeycloakSessionFactory()

    - #### realms

          RealmProvider realms()

      Returns a managed provider instance. Will start a provider transaction. This transaction is managed by the KeycloakSession transaction.
      Returns:
      Throws:
        `IllegalStateException` - if transaction is not active

    - #### sessions

          UserSessionProvider sessions()

      Returns a managed provider instance. Will start a provider transaction. This transaction is managed by the KeycloakSession transaction.
      Returns:
      Throws:
        `IllegalStateException` - if transaction is not active

    - #### close

          void close()

    - #### users

          UserFederationManager users()

      Possibly both cached and federated view of users depending on configuration.
      Returns:

    - #### userStorage

          UserProvider userStorage()

      Keycloak user storage. Non-federated, but possibly cache (if it is on) view of users.

Copyright © 2015. All rights reserved.