org.keycloak.models.jpa.session

## Class JpaUserSessionPersisterProvider

- java.lang.Object
- - org.keycloak.models.jpa.session.JpaUserSessionPersisterProvider

- All Implemented Interfaces:
    UserSessionPersisterProvider, Provider

      public class JpaUserSessionPersisterProvider
      extends Object
      implements UserSessionPersisterProvider

  Author:
    Marek Posolda

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearDetachedUserSessions()`
    `void` | `close()`
    `void` | `createClientSession(ClientSessionModel clientSession, boolean offline)`
    `void` | `createUserSession(UserSessionModel userSession, boolean offline)`
    `int` | `getUserSessionsCount(boolean offline)`
    `List<UserSessionModel>` | `loadUserSessions(int firstResult, int maxResults, boolean offline)`
    `void` | `onClientRemoved(RealmModel realm, ClientModel client)`
    `void` | `onRealmRemoved(RealmModel realm)`
    `void` | `onUserRemoved(RealmModel realm, UserModel user)`
    `void` | `removeClientSession(String clientSessionId, boolean offline)`
    `void` | `removeUserSession(String userSessionId, boolean offline)`
    `void` | `updateAllTimestamps(int time)`
    `void` | `updateUserSession(UserSessionModel userSession, boolean offline)`

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

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

- - ### Constructor Detail

    - #### JpaUserSessionPersisterProvider

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

  - ### Method Detail

    - #### createUserSession

          public void createUserSession(UserSessionModel userSession,
                                        boolean offline)

      Specified by:
        `createUserSession` in interface `UserSessionPersisterProvider`

    - #### createClientSession

          public void createClientSession(ClientSessionModel clientSession,
                                          boolean offline)

      Specified by:
        `createClientSession` in interface `UserSessionPersisterProvider`

    - #### updateUserSession

          public void updateUserSession(UserSessionModel userSession,
                                        boolean offline)

      Specified by:
        `updateUserSession` in interface `UserSessionPersisterProvider`

    - #### removeUserSession

          public void removeUserSession(String userSessionId,
                                        boolean offline)

      Specified by:
        `removeUserSession` in interface `UserSessionPersisterProvider`

    - #### removeClientSession

          public void removeClientSession(String clientSessionId,
                                          boolean offline)

      Specified by:
        `removeClientSession` in interface `UserSessionPersisterProvider`

    - #### onRealmRemoved

          public void onRealmRemoved(RealmModel realm)

      Specified by:
        `onRealmRemoved` in interface `UserSessionPersisterProvider`

    - #### onClientRemoved

          public void onClientRemoved(RealmModel realm,
                                      ClientModel client)

      Specified by:
        `onClientRemoved` in interface `UserSessionPersisterProvider`

    - #### onUserRemoved

          public void onUserRemoved(RealmModel realm,
                                    UserModel user)

      Specified by:
        `onUserRemoved` in interface `UserSessionPersisterProvider`

    - #### clearDetachedUserSessions

          public void clearDetachedUserSessions()

      Specified by:
        `clearDetachedUserSessions` in interface `UserSessionPersisterProvider`

    - #### updateAllTimestamps

          public void updateAllTimestamps(int time)

      Specified by:
        `updateAllTimestamps` in interface `UserSessionPersisterProvider`

    - #### loadUserSessions

          public List<UserSessionModel> loadUserSessions(int firstResult,
                                                         int maxResults,
                                                         boolean offline)

      Specified by:
        `loadUserSessions` in interface `UserSessionPersisterProvider`

    - #### getUserSessionsCount

          public int getUserSessionsCount(boolean offline)

      Specified by:
        `getUserSessionsCount` in interface `UserSessionPersisterProvider`

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

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