org.keycloak.models.map.userSession

## Class MapUserSessionAdapter<K>

- java.lang.Object
- - org.keycloak.models.map.userSession.AbstractUserSessionModel<K>
  - - org.keycloak.models.map.userSession.MapUserSessionAdapter<K>

- All Implemented Interfaces:
    UserSessionModel

      public abstract class MapUserSessionAdapter<K>
      extends AbstractUserSessionModel<K>

  Author:
    Martin Kanis

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.UserSessionModel

      `UserSessionModel.SearchableFields, UserSessionModel.SessionPersistenceState, UserSessionModel.State`

  - ### Field Summary

    - ### Fields inherited from class org.keycloak.models.map.userSession.AbstractUserSessionModel

      `entity, realm, session`

    - ### Fields inherited from interface org.keycloak.models.UserSessionModel

      `CORRESPONDING_SESSION_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MapUserSessionAdapter(KeycloakSession session, RealmModel realm, MapUserSessionEntity<K> entity)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `AuthenticatedClientSessionModel` | `getAuthenticatedClientSessionByClient(String clientUUID)` Returns a client session for the given client UUID.
    `Map<String,AuthenticatedClientSessionModel>` | `getAuthenticatedClientSessions()` Returns map where key is ID of the client (its UUID) and value is ID respective `AuthenticatedClientSessionModel` object.
    `String` | `getAuthMethod()`
    `String` | `getBrokerSessionId()` If created via a broker external login, this is an identifier that can be used to match external broker backchannel logout requests to a UserSession
    `String` | `getBrokerUserId()`
    `String` | `getIpAddress()`
    `int` | `getLastSessionRefresh()`
    `String` | `getLoginUsername()`
    `String` | `getNote(String name)`
    `Map<String,String>` | `getNotes()`
    `RealmModel` | `getRealm()`
    `int` | `getStarted()`
    `UserSessionModel.State` | `getState()`
    `UserModel` | `getUser()`
    `int` | `hashCode()`
    `boolean` | `isOffline()`
    `boolean` | `isRememberMe()`
    `void` | `removeNote(String name)`
    `void` | `restartSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId)`
    `void` | `setLastSessionRefresh(int seconds)`
    `void` | `setNote(String name, String value)`
    `void` | `setState(UserSessionModel.State state)`
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.models.UserSessionModel

      `getId, removeAuthenticatedClientSessions`

- - ### Constructor Detail

    - #### MapUserSessionAdapter

          public MapUserSessionAdapter(KeycloakSession session,
                                       RealmModel realm,
                                       MapUserSessionEntity<K> entity)

  - ### Method Detail

    - #### getRealm

          public RealmModel getRealm()

    - #### getBrokerSessionId

          public String getBrokerSessionId()

      Description copied from interface: `UserSessionModel`
      If created via a broker external login, this is an identifier that can be used to match external broker backchannel logout requests to a UserSession
      Returns:

    - #### getBrokerUserId

          public String getBrokerUserId()

    - #### getUser

          public UserModel getUser()

    - #### getLoginUsername

          public String getLoginUsername()

    - #### getIpAddress

          public String getIpAddress()

    - #### getAuthMethod

          public String getAuthMethod()

    - #### isRememberMe

          public boolean isRememberMe()

    - #### getStarted

          public int getStarted()

    - #### getLastSessionRefresh

          public int getLastSessionRefresh()

    - #### setLastSessionRefresh

          public void setLastSessionRefresh(int seconds)

    - #### isOffline

          public boolean isOffline()

    - #### getAuthenticatedClientSessions

          public Map<String,AuthenticatedClientSessionModel> getAuthenticatedClientSessions()

      Description copied from interface: `UserSessionModel`
      Returns map where key is ID of the client (its UUID) and value is ID respective `AuthenticatedClientSessionModel` object.
      Returns:

    - #### getAuthenticatedClientSessionByClient

          public AuthenticatedClientSessionModel getAuthenticatedClientSessionByClient(String clientUUID)

      Description copied from interface: `UserSessionModel`
      Returns a client session for the given client UUID.
      Returns:

    - #### getNote

          public String getNote(String name)

    - #### setNote

          public void setNote(String name,
                              String value)

    - #### removeNote

          public void removeNote(String name)

    - #### getNotes

          public Map<String,String> getNotes()

    - #### getState

          public UserSessionModel.State getState()

    - #### setState

          public void setState(UserSessionModel.State state)

    - #### restartSession

          public void restartSession(RealmModel realm,
                                     UserModel user,
                                     String loginUsername,
                                     String ipAddress,
                                     String authMethod,
                                     boolean rememberMe,
                                     String brokerSessionId,
                                     String brokerUserId)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

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