Class HvlSessionRedisServiceImpl
java.lang.Object
tr.com.havelsan.javarch.oauth.session.server.redis.service.HvlSessionRedisServiceImpl
- All Implemented Interfaces:
HvlSessionService
The class which implements
HvlSessionService
-
Constructor Summary
ConstructorDescriptionHvlSessionRedisServiceImpl
(HvlSessionDataProvider sessionDataProvider) Instantiates a new HvlSessionService. -
Method Summary
Modifier and TypeMethodDescriptiontr.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 attemptvoid
Clean user (via identifier) session data on key-value data store (redis etc.)void
closeAll()
Clean all session datavoid
Clean all session data associated with username parametervoid
closeAll
(@NotNull @Valid tr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession securitySession) Clean all session data associated with session parametervoid
Clean all session data by uservoid
closeAllIdentifiers
(@NotNull List<@NotBlank String> identifierList) Clean all session data associated with list of identifiervoid
closeAllSessions
(@NotNull List<@NotNull tr.com.havelsan.javarch.session.common.model.HvlSession> sessionList) Clean all session data associated with list of sessionvoid
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 controlvoid
closeAllUsers
(@NotNull List<@NotBlank String> usernameList) Clean all session data associated with list of username parametervoid
closeByUser
(@NotBlank String identifier) Clean user (via identifier) session data on key-value data store (redis etc.)Count by current user long.Exist session.List<tr.com.havelsan.javarch.session.common.model.HvlSession>
findAllByUsername
(@NotBlank String username) Get all user session data associated with username parametertr.com.havelsan.javarch.security.session.provider.model.HvlSecuritySession
Get user session datatr.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
Renew session time.
-
Constructor Details
-
HvlSessionRedisServiceImpl
Instantiates a new HvlSessionService.- Parameters:
sessionDataProvider
- the session data provider
-
-
Method Details
-
begin
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
securitySession
- the session- Returns:
- the hvl session
- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
renewTtl
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
identifier
- the identifiersystem
- the system- Returns:
- the hvl session
- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
getWithRenewTtl
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
identifier
- the identifiersystem
- the system- Returns:
- the hvl security session
- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
close
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
identifier
- the identifier- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
closeByUser
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
identifier
- the identifier- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
closeAll
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) public void closeAll() throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportExceptionClean all session data- Specified by:
closeAll
in interfaceHvlSessionService
- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
closeAllByUser
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) public void closeAllByUser() throws tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportExceptionClean all session data by user- Specified by:
closeAllByUser
in interfaceHvlSessionService
- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
closeAll
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
username
- the username- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
closeAll
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
securitySession
- the session- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
closeAllUsers
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
usernameList
- the username list- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
closeAllIdentifiers
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
identifierList
- the identifier list- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
closeAllSessions
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
sessionList
- the session list- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
closeAllSessionsByUser
@Transactional(rollbackFor=tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException.class) 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 interfaceHvlSessionService
- Parameters:
sessionList
- the session list- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
get
@Transactional(readOnly=true) 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 interfaceHvlSessionService
- Parameters:
identifier
- the identifiersystem
- the system- Returns:
- the session
- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
exist
Exist session.- Specified by:
exist
in interfaceHvlSessionService
- Parameters:
identifier
- the identifier- Returns:
- the boolean
-
findAllByUsername
@Transactional(readOnly=true) 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 interfaceHvlSessionService
- Parameters:
username
- the username- Returns:
- the session list
- Throws:
tr.com.havelsan.javarch.session.data.support.exception.HvlSessionSupportException
- the hvl session support exception
-
queryPage
@Transactional(readOnly=true) 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 interfaceHvlSessionService
- 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
Count by current user long.- Specified by:
countByCurrentUser
in interfaceHvlSessionService
- Returns:
- the long
-