public interface ExpirableUserTokenDao
ExpirableUserToken
Modifier and Type | Method and Description |
---|---|
ExpirableUserToken |
add(ExpirableUserToken token)
Persist the given token
|
Optional<ExpirableUserToken> |
findByToken(String token)
Find the token with the given random hash
|
Optional<ExpirableUserToken> |
findToken(long directoryId,
String username)
Returns token for given user.
|
boolean |
removeByDirectoryAndUsername(long directoryId,
String username)
Remove all the tokens matching the username and directory id
|
boolean |
removeByToken(String token)
Removes the token with the given random hash
|
boolean |
removeExpiredTokens(Date expiryDate)
Remove all the tokens whose expiry date is older than the given cutoff date
|
Optional<ExpirableUserToken> findByToken(String token)
token
- a random hashExpirableUserToken add(ExpirableUserToken token) throws ObjectAlreadyExistsException
token
- a tokenObjectAlreadyExistsException
- if a token with the same random hash already existsboolean removeByToken(String token)
token
- a random hashboolean removeExpiredTokens(Date expiryDate)
expiryDate
- a dateboolean removeByDirectoryAndUsername(long directoryId, String username)
directoryId
- directory where the user livesusername
- username to remove tokens for@ExperimentalApi Optional<ExpirableUserToken> findToken(long directoryId, String username)
Copyright © 2020 Atlassian. All rights reserved.