Class JdbcAccountTokenRepository
java.lang.Object
com.irurueta.authserver.authorization.infrastructure.persistence.account.JdbcAccountTokenRepository
- All Implemented Interfaces:
AccountTokenRepository
@Repository
public class JdbcAccountTokenRepository
extends Object
implements AccountTokenRepository
AccountTokenRepository over the account_tokens table.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AccountTokenRowMapperMaps a row to a token.private static final StringStatement that marks a token as used and returns it, only when it is unused and not expired.private static final StringQuery returning a token only when it is unused and not expired, without changing it.private static final StringStatement storing a token.private final org.springframework.jdbc.core.simple.JdbcClientJDBC client used to run the statements. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdeleteExpired(Instant now) findUsable(String hashedToken, String purpose, Instant now) voidstore(AccountToken token)
-
Field Details
-
INSERT_TOKEN
Statement storing a token.- See Also:
-
FIND_USABLE_TOKEN
Query returning a token only when it is unused and not expired, without changing it.- See Also:
-
CONSUME_TOKEN
Statement that marks a token as used and returns it, only when it is unused and not expired.- See Also:
-
jdbcClient
private final org.springframework.jdbc.core.simple.JdbcClient jdbcClientJDBC client used to run the statements. -
accountTokenRowMapper
Maps a row to a token.
-
-
Constructor Details
-
JdbcAccountTokenRepository
public JdbcAccountTokenRepository()
-
-
Method Details
-
store
- Specified by:
storein interfaceAccountTokenRepository
-
findUsable
- Specified by:
findUsablein interfaceAccountTokenRepository
-
consume
- Specified by:
consumein interfaceAccountTokenRepository
-
deleteExpired
- Specified by:
deleteExpiredin interfaceAccountTokenRepository
-