org.keycloak.services

## Class DefaultKeycloakSession

- java.lang.Object
- - org.keycloak.services.DefaultKeycloakSession

- All Implemented Interfaces:
    KeycloakSession

      public class DefaultKeycloakSession
      extends Object
      implements KeycloakSession

  Author:
    Stian Thorgersen

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultKeycloakSession(DefaultKeycloakSessionFactory factory)`

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

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

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

- - ### Constructor Detail

    - #### DefaultKeycloakSession

          public DefaultKeycloakSession(DefaultKeycloakSessionFactory factory)

  - ### Method Detail

    - #### enlistForClose

          public void enlistForClose(Provider provider)

      Specified by:
        `enlistForClose` in interface `KeycloakSession`

    - #### getTransaction

          public KeycloakTransactionManager getTransaction()

      Specified by:
        `getTransaction` in interface `KeycloakSession`

    - #### getKeycloakSessionFactory

          public KeycloakSessionFactory getKeycloakSessionFactory()

      Specified by:
        `getKeycloakSessionFactory` in interface `KeycloakSession`

    - #### userStorage

          public UserProvider userStorage()

      Description copied from interface: `KeycloakSession`
      Keycloak user storage. Non-federated, but possibly cache (if it is on) view of users.
      Specified by:
        `userStorage` in interface `KeycloakSession`

    - #### getProvider

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

      Specified by:
        `getProvider` in interface `KeycloakSession`

    - #### getProvider

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

      Specified by:
        `getProvider` in interface `KeycloakSession`

    - #### listProviderIds

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

      Specified by:
        `listProviderIds` in interface `KeycloakSession`

    - #### getAllProviders

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

      Specified by:
        `getAllProviders` in interface `KeycloakSession`

    - #### realms

          public RealmProvider realms()

      Description copied from interface: `KeycloakSession`
      Returns a managed provider instance. Will start a provider transaction. This transaction is managed by the KeycloakSession transaction.
      Specified by:
        `realms` in interface `KeycloakSession`
      Returns:

    - #### users

          public UserFederationManager users()

      Description copied from interface: `KeycloakSession`
      Possibly both cached and federated view of users depending on configuration.
      Specified by:
        `users` in interface `KeycloakSession`
      Returns:

    - #### sessions

          public UserSessionProvider sessions()

      Description copied from interface: `KeycloakSession`
      Returns a managed provider instance. Will start a provider transaction. This transaction is managed by the KeycloakSession transaction.
      Specified by:
        `sessions` in interface `KeycloakSession`
      Returns:

    - #### close

          public void close()

      Specified by:
        `close` in interface `KeycloakSession`

Copyright © 2014. All Rights Reserved.