Interface UserSessionModel

All Known Subinterfaces:
OfflineUserSessionModel
All Known Implementing Classes:
PersistentUserSessionAdapter, UserSessionAdapter, UserSessionModelDelegate, UserSessionUpdater

public interface UserSessionModel
Author:
Stian Thorgersen
  • Field Details

    • CORRESPONDING_SESSION_ID

      static final String CORRESPONDING_SESSION_ID
      Represents the corresponding online/offline user session.
      See Also:
  • Method Details

    • getId

      String getId()
    • getRealm

      RealmModel getRealm()
    • getBrokerSessionId

      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
      Returns:
    • getBrokerUserId

      String getBrokerUserId()
    • getUser

      UserModel getUser()
    • getLoginUsername

      String getLoginUsername()
    • getIpAddress

      String getIpAddress()
    • getAuthMethod

      String getAuthMethod()
    • isRememberMe

      boolean isRememberMe()
    • getStarted

      int getStarted()
    • getLastSessionRefresh

      int getLastSessionRefresh()
    • setLastSessionRefresh

      void setLastSessionRefresh(int seconds)
      Set the last session refresh timestamp for the user session. If the timestamp is smaller or equal than the current timestamp, the operation is ignored.
    • isOffline

      boolean isOffline()
    • getAuthenticatedClientSessions

      Map<String,AuthenticatedClientSessionModel> getAuthenticatedClientSessions()
      Returns map where key is ID of the client (its UUID) and value is ID respective AuthenticatedClientSessionModel object.
      Returns:
    • getAuthenticatedClientSessionByClient

      default AuthenticatedClientSessionModel getAuthenticatedClientSessionByClient(String clientUUID)
      Returns a client session for the given client UUID.
      Returns:
    • removeAuthenticatedClientSessions

      void removeAuthenticatedClientSessions(Collection<String> removedClientUUIDS)
      Removes authenticated client sessions for all clients whose UUID is present in removedClientUUIDS parameter.
      Parameters:
      removedClientUUIDS -
    • getNote

      String getNote(String name)
    • setNote

      void setNote(String name, String value)
    • removeNote

      void removeNote(String name)
    • getNotes

      Map<String,String> getNotes()
    • getState

    • setState

      void setState(UserSessionModel.State state)
    • restartSession

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

      default UserSessionModel.SessionPersistenceState getPersistenceState()
      Returns:
      Persistence state of the session