Class HvlSessionRedisServiceImpl

java.lang.Object
tr.com.havelsan.javarch.oauth.session.server.redis.service.HvlSessionRedisServiceImpl
All Implemented Interfaces:
HvlSessionService

@Service @Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) public class HvlSessionRedisServiceImpl extends Object implements HvlSessionService
The class which implements HvlSessionService
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiates a new HvlSessionService.
  • Method Summary

    Modifier and Type
    Method
    Description
    tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession
    begin(@NotNull @Valid tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession securitySession)
    Stores user required session data on key-value data store (redis etc.) after success login attempt
    void
    close(@NotBlank String identifier)
    Clean user (via identifier) session data on key-value data store (redis etc.)
    void
    Clean all session data
    void
    closeAll(@NotBlank String username)
    Clean all session data associated with username parameter
    void
    closeAll(@NotNull @Valid tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession securitySession)
    Clean all session data associated with session parameter
    void
    Clean all session data by user
    void
    closeAllIdentifiers(@NotNull List<@NotBlank String> identifierList)
    Clean all session data associated with list of identifier
    void
    closeAllSessions(@NotNull List<@NotNull tr.com.havelsan.javarch.session.common.model.HvlSession> sessionList)
    Clean all session data associated with list of session
    void
    closeAllSessionsByUser(@NotNull List<@NotNull tr.com.havelsan.javarch.session.common.model.HvlSession> sessionList)
    Clean all session data associated with list of session with current user control
    void
    closeAllUsers(@NotNull List<@NotBlank String> usernameList)
    Clean all session data associated with list of username parameter
    void
    closeByUser(@NotBlank String identifier)
    Clean user (via identifier) session data on key-value data store (redis etc.)
    Count by current user long.
    exist(@NotBlank String identifier)
    Exist session.
    List<tr.com.havelsan.javarch.session.common.model.HvlSession>
    findAllByUsername(@NotBlank String username)
    Get all user session data associated with username parameter
    tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession
    get(@NotBlank String identifier, boolean system)
    Get user session data
    tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession
    getWithRenewTtl(@NotBlank String identifier, boolean system)
    Get security session with renewing ttl.
    tr.com.havelsan.javarch.data.commons.pageable.HvlPage<tr.com.havelsan.javarch.session.common.model.HvlSession>
    queryPage(@NotNull HvlSessionQueryModel sessionQueryModel)
    Query page hvl page.
    tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession
    renewTtl(@NotBlank String identifier, boolean system)
    Renew session time.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HvlSessionRedisServiceImpl

      public HvlSessionRedisServiceImpl(HvlSessionDataProvider sessionDataProvider)
      Instantiates a new HvlSessionService.
      Parameters:
      sessionDataProvider - the session data provider
  • Method Details

    • begin

      public tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession begin(@NotNull @Valid @NotNull @Valid tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession securitySession) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Stores user required session data on key-value data store (redis etc.) after success login attempt
      Specified by:
      begin in interface HvlSessionService
      Parameters:
      securitySession - the session
      Returns:
      the hvl session
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • renewTtl

      public tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession renewTtl(@NotBlank @NotBlank String identifier, boolean system) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Renew session time.
      Specified by:
      renewTtl in interface HvlSessionService
      Parameters:
      identifier - the identifier
      system - the system
      Returns:
      the hvl session
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • getWithRenewTtl

      public tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession getWithRenewTtl(@NotBlank @NotBlank String identifier, boolean system) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Get security session with renewing ttl.
      Specified by:
      getWithRenewTtl in interface HvlSessionService
      Parameters:
      identifier - the identifier
      system - the system
      Returns:
      the hvl security session
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • close

      public void close(@NotBlank @NotBlank String identifier) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Clean user (via identifier) session data on key-value data store (redis etc.)
      Specified by:
      close in interface HvlSessionService
      Parameters:
      identifier - the identifier
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • closeByUser

      public void closeByUser(@NotBlank @NotBlank String identifier) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Clean user (via identifier) session data on key-value data store (redis etc.)
      Specified by:
      closeByUser in interface HvlSessionService
      Parameters:
      identifier - the identifier
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • closeAll

      public void closeAll() throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Clean all session data
      Specified by:
      closeAll in interface HvlSessionService
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • closeAllByUser

      public void closeAllByUser() throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Clean all session data by user
      Specified by:
      closeAllByUser in interface HvlSessionService
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • closeAll

      public void closeAll(@NotBlank @NotBlank String username) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Clean all session data associated with username parameter
      Specified by:
      closeAll in interface HvlSessionService
      Parameters:
      username - the username
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • closeAll

      public void closeAll(@NotNull @Valid @NotNull @Valid tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession securitySession) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Clean all session data associated with session parameter
      Specified by:
      closeAll in interface HvlSessionService
      Parameters:
      securitySession - the session
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • closeAllUsers

      public void closeAllUsers(@NotNull @NotNull List<@NotBlank String> usernameList) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Clean all session data associated with list of username parameter
      Specified by:
      closeAllUsers in interface HvlSessionService
      Parameters:
      usernameList - the username list
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • closeAllIdentifiers

      public void closeAllIdentifiers(@NotNull @NotNull List<@NotBlank String> identifierList) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Clean all session data associated with list of identifier
      Specified by:
      closeAllIdentifiers in interface HvlSessionService
      Parameters:
      identifierList - the identifier list
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • closeAllSessions

      public void closeAllSessions(@NotNull @NotNull List<@NotNull tr.com.havelsan.javarch.session.common.model.HvlSession> sessionList) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Clean all session data associated with list of session
      Specified by:
      closeAllSessions in interface HvlSessionService
      Parameters:
      sessionList - the session list
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • closeAllSessionsByUser

      public void closeAllSessionsByUser(@NotNull @NotNull List<@NotNull tr.com.havelsan.javarch.session.common.model.HvlSession> sessionList) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Clean all session data associated with list of session with current user control
      Specified by:
      closeAllSessionsByUser in interface HvlSessionService
      Parameters:
      sessionList - the session list
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • get

      public tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession get(@NotBlank @NotBlank String identifier, boolean system) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Get user session data
      Specified by:
      get in interface HvlSessionService
      Parameters:
      identifier - the identifier
      system - the system
      Returns:
      the session
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • exist

      public Boolean exist(@NotBlank @NotBlank String identifier)
      Exist session.
      Specified by:
      exist in interface HvlSessionService
      Parameters:
      identifier - the identifier
      Returns:
      the boolean
    • findAllByUsername

      public List<tr.com.havelsan.javarch.session.common.model.HvlSession> findAllByUsername(@NotBlank @NotBlank String username) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Get all user session data associated with username parameter
      Specified by:
      findAllByUsername in interface HvlSessionService
      Parameters:
      username - the username
      Returns:
      the session list
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • queryPage

      public tr.com.havelsan.javarch.data.commons.pageable.HvlPage<tr.com.havelsan.javarch.session.common.model.HvlSession> queryPage(@NotNull @NotNull HvlSessionQueryModel sessionQueryModel) throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
      Query page hvl page.
      Specified by:
      queryPage in interface HvlSessionService
      Parameters:
      sessionQueryModel - the session query model
      Returns:
      the page
      Throws:
      tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException - the hvl session support exception
    • countByCurrentUser

      public Long countByCurrentUser()
      Count by current user long.
      Specified by:
      countByCurrentUser in interface HvlSessionService
      Returns:
      the long