org.keycloak.models

## Interface UserSessionProvider

- All Superinterfaces:
    Provider
  All Known Implementing Classes:
    JpaUserSessionProvider, MemUserSessionProvider, MongoUserSessionProvider

      public interface UserSessionProvider
      extends Provider

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `UsernameLoginFailureModel` | `addUserLoginFailure(RealmModel realm, String username)`
    `void` | `close()`
    `ClientSessionModel` | `createClientSession(RealmModel realm, ClientModel client, UserSessionModel userSession, String redirectUri, String state, Set<String> roles)`
    `UserSessionModel` | `createUserSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe)`
    `int` | `getActiveUserSessions(RealmModel realm, ClientModel client)`
    `List<UsernameLoginFailureModel>` | `getAllUserLoginFailures(RealmModel realm)`
    `ClientSessionModel` | `getClientSession(RealmModel realm, String id)`
    `UsernameLoginFailureModel` | `getUserLoginFailure(RealmModel realm, String username)`
    `UserSessionModel` | `getUserSession(RealmModel realm, String id)`
    `List<UserSessionModel>` | `getUserSessions(RealmModel realm, ClientModel client)`
    `List<UserSessionModel>` | `getUserSessions(RealmModel realm, ClientModel client, int firstResult, int maxResults)`
    `List<UserSessionModel>` | `getUserSessions(RealmModel realm, UserModel user)`
    `void` | `onClientRemoved(RealmModel realm, ClientModel client)`
    `void` | `onRealmRemoved(RealmModel realm)`
    `void` | `onUserRemoved(RealmModel realm, UserModel user)`
    `void` | `removeExpiredUserSessions(RealmModel realm)`
    `void` | `removeUserSession(RealmModel realm, UserSessionModel session)`
    `void` | `removeUserSessions(RealmModel realm)`
    `void` | `removeUserSessions(RealmModel realm, UserModel user)`

- - ### Method Detail

    - #### createClientSession

          ClientSessionModel createClientSession(RealmModel realm,
                                               ClientModel client,
                                               UserSessionModel userSession,
                                               String redirectUri,
                                               String state,
                                               Set<String> roles)

    - #### getClientSession

          ClientSessionModel getClientSession(RealmModel realm,
                                            String id)

    - #### createUserSession

          UserSessionModel createUserSession(RealmModel realm,
                                           UserModel user,
                                           String loginUsername,
                                           String ipAddress,
                                           String authMethod,
                                           boolean rememberMe)

    - #### getUserSession

          UserSessionModel getUserSession(RealmModel realm,
                                        String id)

    - #### getUserSessions

          List<UserSessionModel> getUserSessions(RealmModel realm,
                                               UserModel user)

    - #### getUserSessions

          List<UserSessionModel> getUserSessions(RealmModel realm,
                                               ClientModel client)

    - #### getUserSessions

          List<UserSessionModel> getUserSessions(RealmModel realm,
                                               ClientModel client,
                                               int firstResult,
                                               int maxResults)

    - #### getActiveUserSessions

          int getActiveUserSessions(RealmModel realm,
                                  ClientModel client)

    - #### removeUserSession

          void removeUserSession(RealmModel realm,
                               UserSessionModel session)

    - #### removeUserSessions

          void removeUserSessions(RealmModel realm,
                                UserModel user)

    - #### removeExpiredUserSessions

          void removeExpiredUserSessions(RealmModel realm)

    - #### removeUserSessions

          void removeUserSessions(RealmModel realm)

    - #### getUserLoginFailure

          UsernameLoginFailureModel getUserLoginFailure(RealmModel realm,
                                                      String username)

    - #### addUserLoginFailure

          UsernameLoginFailureModel addUserLoginFailure(RealmModel realm,
                                                      String username)

    - #### getAllUserLoginFailures

          List<UsernameLoginFailureModel> getAllUserLoginFailures(RealmModel realm)

    - #### onRealmRemoved

          void onRealmRemoved(RealmModel realm)

    - #### onClientRemoved

          void onClientRemoved(RealmModel realm,
                             ClientModel client)

    - #### onUserRemoved

          void onUserRemoved(RealmModel realm,
                           UserModel user)

    - #### close

          void close()

      Specified by:
        `close` in interface `Provider`

Copyright © 2014. All Rights Reserved.