public interface TokenDAO
Token
Modifier and Type | Method and Description |
---|---|
Token |
add(Token token)
Persists a new token.
|
Token |
findByIdentifierHash(String identifierHash)
Finds token by identifier hash.
|
Token |
findByRandomHash(String randomHash)
Finds token by random hash.
|
Collection<Token> |
loadAll()
Used when switching implementations.
|
void |
remove(long directoryId,
String name)
Remove token.
|
void |
remove(Token token)
Removes a token.
|
void |
removeAll()
Wipes all tokens from the store.
|
void |
removeAll(long directoryId)
Remove all tokens associated with the given directory id.
|
void |
removeExpiredTokens(Date currentTime,
long maxLifeSeconds)
Remove all tokens that have expired.
|
void |
saveAll(Collection<Token> tokens)
Used when switching implementations.
|
List<Token> |
search(EntityQuery<? extends Token> query)
Searches for token based on criteria.
|
Token |
update(Token token) |
Token findByRandomHash(String randomHash) throws ObjectNotFoundException
randomHash
- Random hash.ObjectNotFoundException
- if the token identified by the random hash cannot be found.Token findByIdentifierHash(String identifierHash) throws ObjectNotFoundException
identifierHash
- Identifier hash.ObjectNotFoundException
- if the token identified by the identifier hash cannot be found.Token add(Token token)
token
- Token.Token update(Token token) throws ObjectNotFoundException
token
- token to update.ObjectNotFoundException
void remove(Token token)
token
- Token.List<Token> search(EntityQuery<? extends Token> query)
query
- Query.void remove(long directoryId, String name)
directoryId
- Directory id.name
- User or application name.void removeAll(long directoryId)
directoryId
- Directory id.void removeExpiredTokens(Date currentTime, long maxLifeSeconds)
currentTime
- Current datemaxLifeSeconds
- Max lifespan for tokens, unless they specific a shorter one.void removeAll()
org.springframework.dao.DataAccessException
Collection<Token> loadAll()
org.springframework.dao.DataAccessException
- If the tokens could not be retrieved.void saveAll(Collection<Token> tokens)
tokens
- all tokens to add.org.springframework.dao.DataAccessException
Copyright © 2013 Atlassian. All Rights Reserved.