Interface SessionHandler

  • All Known Implementing Classes:
    SessionHandlerImpl

    public interface SessionHandler
    Handler for user sessions, containing methods to manage them
    • Method Detail

      • checkAccessClientAccess

        AccessClient checkAccessClientAccess​(boolean forLogin,
                                             Network network,
                                             String channelName,
                                             String remoteAddress,
                                             String accessClientToken)
        Checks the access for a user for a channel / network using the specified access client token.
      • checkOidcAccessToken

        OidcAccessToken checkOidcAccessToken​(Network network,
                                             String remoteAddress,
                                             String accessToken)
        Checks the access for a user for a network using the specified OAuth2 / OpenID Connect access token. The channel is always BuiltInChannel.OIDC.
      • clearPinCreationToken

        void clearPinCreationToken​(Session session)
        Removes the PIN creation token for the given session, if any
      • create

        Session create​(SessionHandler.CreateSessionParameters params)
        Creates a new session according to the given session data and timeout.
        See the Javadoc for LoginServiceLocal#doLogin(TimeInterval, Long, Long, String, String).
        See Also:
        LoginServiceLocal#doLogin(TimeInterval, Long, Long, String, String)
      • getIfValid

        Session getIfValid​(String remoteAddress,
                           String sessionToken)
        Returns an active session by remote address and session token. If the session has expired or doesn't match the remote address, returns null
      • getPinCreationToken

        String getPinCreationToken​(Session session)
        Returns the token that can be used to create a device PIN without informing the current password / PIN. The token is valid for 6 hours since the session is created.
      • getSessionTimeout

        TimeInterval getSessionTimeout​(Session session)
        Returns the timeout for a given session
      • invalidate

        boolean invalidate​(String remoteAddress,
                           String sessionToken)
        Invalidates the session with the given token, under the given remote address, returning whether the sessions was actually invalidated.
      • purgeExpired

        int purgeExpired()
        Purges all expired sessions. Should run outside a transaction.
      • remove

        int remove​(Collection<String> tokens)
        Removes (both from the shared map and from the database) sessions with the given tokens, returning the number of actually deleted sessions
      • remove

        boolean remove​(Session session)
        Removes (both from the shared map and from the database) the given session, returning true if was actually removed
      • replace

        String replace​(Session session)
        Replaces an existing session token
      • setProperties

        void setProperties​(Session session,
                           SessionProperties properties)
        Updates the properties of the given session
      • updateTimeout

        void updateTimeout​(String sessionToken,
                           TimeInterval interval)
        Updates the expiration time of the session with the given token