org.keycloak.models.mongo.keycloak.adapters

## Class UserSessionAdapter

- java.lang.Object
- - org.keycloak.models.mongo.keycloak.adapters.AbstractMongoAdapter<MongoUserSessionEntity>
  - - org.keycloak.models.mongo.keycloak.adapters.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.mongo.keycloak.adapters.AbstractMongoAdapter

      `invocationContext`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserSessionAdapter(MongoUserSessionEntity entity, RealmAdapter realm, MongoStoreInvocationContext invContext)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `associateClient(ClientModel client)`
    `List<ClientModel>` | `getClientAssociations()`
    `String` | `getId()`
    `String` | `getIpAddress()`
    `int` | `getLastSessionRefresh()`
    `protected MongoUserSessionEntity` | `getMongoEntity()`
    `int` | `getStarted()`
    `UserModel` | `getUser()`
    `void` | `removeAssociatedClient(ClientModel client)`
    `void` | `setId(String id)`
    `void` | `setIpAddress(String ipAddress)`
    `void` | `setLastSessionRefresh(int seconds)`
    `void` | `setStarted(int started)`
    `void` | `setUser(UserModel user)`

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

      `equals, getMongoStore, hashCode, updateMongoEntity`

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

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

- - ### Constructor Detail

    - #### UserSessionAdapter

          public UserSessionAdapter(MongoUserSessionEntity entity,
                            RealmAdapter 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`

    - #### getIpAddress

          public String getIpAddress()

      Specified by:
        `getIpAddress` in interface `UserSessionModel`

    - #### setIpAddress

          public void setIpAddress(String ipAddress)

      Specified by:
        `setIpAddress` 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`

    - #### associateClient

          public void associateClient(ClientModel client)

      Specified by:
        `associateClient` in interface `UserSessionModel`

    - #### getClientAssociations

          public List<ClientModel> getClientAssociations()

      Specified by:
        `getClientAssociations` in interface `UserSessionModel`

    - #### removeAssociatedClient

          public void removeAssociatedClient(ClientModel client)

      Specified by:
        `removeAssociatedClient` in interface `UserSessionModel`

Copyright © 2014. All Rights Reserved.