Interface ClientTokenStorageService
public interface ClientTokenStorageService
-
Method Summary
Modifier and TypeMethodDescriptionvoidgetAccessTokensExpiringBefore(Instant timestamp) getByIdOrFail(String id) getRefreshTokensExpiringBefore(Instant timestamp) save(ClientTokenEntity clientTokenEntity) Creates or updates theClientTokenEntity
-
Method Details
-
save
@Nonnull ClientTokenEntity save(@Nonnull ClientTokenEntity clientTokenEntity) throws TokenNotFoundException Creates or updates theClientTokenEntity- Parameters:
clientTokenEntity- the entity to create- Returns:
- The saved entity, with the ID if created
- Throws:
TokenNotFoundException- if the token for the given id wasn't found
-
delete
- Parameters:
id- of theClientTokenEntityto delete- Throws:
TokenNotFoundException- if the token for the given id wasn't found
-
getById
- Parameters:
id- of theClientTokenEntityfrom the store- Returns:
- The
ClientTokenEntityfrom the store for the id, orOptional.empty()
-
getByIdOrFail
- Parameters:
id- of theClientTokenEntityfrom the store- Returns:
- The
ClientTokenEntityfrom the store for the id - Throws:
TokenNotFoundException- if the token for the given id wasn't found
-
getAccessTokensExpiringBefore
- Returns:
- All the saved
ClientTokenEntityaccess tokens expiring before the timestamp, or an empty list
-
getRefreshTokensExpiringBefore
- Returns:
- All the saved
ClientTokenEntityrefresh tokens expiring before the timestamp, or an empty list
-