org.keycloak.models.sessions.mongo

## Class UserSessionAdapter

- java.lang.Object
- - org.keycloak.models.sessions.mongo.AbstractMongoAdapter<MongoUserSessionEntity>
  - - org.keycloak.models.sessions.mongo.UserSessionAdapter

- All Implemented Interfaces:
    UserSessionModel

      public class UserSessionAdapter
      extends AbstractMongoAdapter<MongoUserSessionEntity>
      implements UserSessionModel

  Author:
    Stian Thorgersen

- - ### Field Summary

    - ### Fields inherited from class org.keycloak.models.sessions.mongo.AbstractMongoAdapter

      `invocationContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserSessionAdapter(KeycloakSession keycloakSession, MongoUserSessionProvider provider, MongoUserSessionEntity entity, RealmModel realm, MongoStoreInvocationContext invContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `String` | `getAuthMethod()`
    `List<ClientSessionModel>` | `getClientSessions()`
    `String` | `getId()`
    `String` | `getIpAddress()`
    `int` | `getLastSessionRefresh()`
    `String` | `getLoginUsername()`
    `protected MongoUserSessionEntity` | `getMongoEntity()`
    `int` | `getStarted()`
    `UserModel` | `getUser()`
    `int` | `hashCode()`
    `boolean` | `isRememberMe()`
    `void` | `setAuthMethod(String authMethod)`
    `void` | `setId(String id)`
    `void` | `setIpAddress(String ipAddress)`
    `void` | `setLastSessionRefresh(int seconds)`
    `void` | `setLoginUsername(String loginUsername)`
    `void` | `setRememberMe(boolean rememberMe)`
    `void` | `setStarted(int started)`
    `void` | `setUser(UserModel user)`

    - ### Methods inherited from class org.keycloak.models.sessions.mongo.AbstractMongoAdapter

      `getMongoStore, updateMongoEntity`

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

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

- - ### Constructor Detail

    - #### UserSessionAdapter

          public UserSessionAdapter(KeycloakSession keycloakSession,
                            MongoUserSessionProvider provider,
                            MongoUserSessionEntity entity,
                            RealmModel realm,
                            MongoStoreInvocationContext invContext)

  - ### Method Detail

    - #### getMongoEntity

          protected MongoUserSessionEntity getMongoEntity()

      Specified by:
        `getMongoEntity` in class `AbstractMongoAdapter<MongoUserSessionEntity>`

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `UserSessionModel`

    - #### setId

          public void setId(String id)

      Specified by:
        `setId` in interface `UserSessionModel`

    - #### getUser

          public UserModel getUser()

      Specified by:
        `getUser` in interface `UserSessionModel`

    - #### setUser

          public void setUser(UserModel user)

      Specified by:
        `setUser` in interface `UserSessionModel`

    - #### getLoginUsername

          public String getLoginUsername()

      Specified by:
        `getLoginUsername` in interface `UserSessionModel`

    - #### setLoginUsername

          public void setLoginUsername(String loginUsername)

      Specified by:
        `setLoginUsername` in interface `UserSessionModel`

    - #### getIpAddress

          public String getIpAddress()

      Specified by:
        `getIpAddress` in interface `UserSessionModel`

    - #### setIpAddress

          public void setIpAddress(String ipAddress)

      Specified by:
        `setIpAddress` in interface `UserSessionModel`

    - #### getAuthMethod

          public String getAuthMethod()

      Specified by:
        `getAuthMethod` in interface `UserSessionModel`

    - #### setAuthMethod

          public void setAuthMethod(String authMethod)

      Specified by:
        `setAuthMethod` in interface `UserSessionModel`

    - #### isRememberMe

          public boolean isRememberMe()

      Specified by:
        `isRememberMe` in interface `UserSessionModel`

    - #### setRememberMe

          public void setRememberMe(boolean rememberMe)

      Specified by:
        `setRememberMe` in interface `UserSessionModel`

    - #### getStarted

          public int getStarted()

      Specified by:
        `getStarted` in interface `UserSessionModel`

    - #### setStarted

          public void setStarted(int started)

      Specified by:
        `setStarted` in interface `UserSessionModel`

    - #### getLastSessionRefresh

          public int getLastSessionRefresh()

      Specified by:
        `getLastSessionRefresh` in interface `UserSessionModel`

    - #### setLastSessionRefresh

          public void setLastSessionRefresh(int seconds)

      Specified by:
        `setLastSessionRefresh` in interface `UserSessionModel`

    - #### getClientSessions

          public List<ClientSessionModel> getClientSessions()

      Specified by:
        `getClientSessions` in interface `UserSessionModel`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `AbstractMongoAdapter<MongoUserSessionEntity>`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `AbstractMongoAdapter<MongoUserSessionEntity>`

Copyright © 2014. All Rights Reserved.