Modifier and Type | Field and Description |
---|---|
static String |
IDENTIFIER_HASH_CACHE |
static String |
IDENTIFIER_HASH_CAHE
Deprecated.
|
static String |
RANDOM_HASH_CACHE |
Constructor and Description |
---|
TokenDAOMemory() |
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.
|
Class<Token> |
getPersistentClass() |
Object |
load(long ID) |
Collection<Token> |
loadAll()
TokenDAOPersistence.loadAll() |
void |
remove(long directoryId,
String name)
Remove token.
|
void |
remove(Object persistentObject) |
void |
remove(Token token)
Removes a token.
|
void |
removeAll()
TokenDAOPersistence.removeAll() |
void |
removeAll(long directoryId)
Remove all tokens associated with the given directory id.
|
void |
removeExpiredTokens(Date currentTime,
long maxLifeInSeconds)
Remove all tokens that have expired.
|
void |
save(Object persistentObject) |
void |
saveAll(Collection<Token> tokens)
TokenDAOPersistence.saveAll() |
List<Token> |
search(EntityQuery<? extends Token> query)
Searches for token based on criteria.
|
void |
setCacheManager(CacheManager cacheManager) |
void |
update(Object persistentObject) |
Token |
update(Token token) |
public static final String RANDOM_HASH_CACHE
public static final String IDENTIFIER_HASH_CACHE
@Deprecated public static final String IDENTIFIER_HASH_CAHE
public Token findByRandomHash(String randomHash) throws ObjectNotFoundException
TokenDAO
findByRandomHash
in interface TokenDAO
randomHash
- Random hash.ObjectNotFoundException
- if the token identified by the random hash cannot be found.public Token findByIdentifierHash(String identifierHash) throws ObjectNotFoundException
TokenDAO
findByIdentifierHash
in interface TokenDAO
identifierHash
- Identifier hash.ObjectNotFoundException
- if the token identified by the identifier hash cannot be found.public List<Token> search(EntityQuery<? extends Token> query)
TokenDAO
public void remove(long directoryId, String name)
TokenDAO
public void removeAll(long directoryId)
TokenDAO
public void removeExpiredTokens(Date currentTime, long maxLifeInSeconds)
TokenDAO
removeExpiredTokens
in interface TokenDAO
currentTime
- Current datemaxLifeInSeconds
- Max lifespan for tokens, unless they specific a shorter one.public void save(Object persistentObject)
public void update(Object persistentObject)
public void remove(Object persistentObject)
public Object load(long ID)
public Collection<Token> loadAll()
TokenDAOPersistence.loadAll()
public void saveAll(Collection<Token> tokens)
TokenDAOPersistence.saveAll()
public void removeAll()
TokenDAOPersistence.removeAll()
public void setCacheManager(CacheManager cacheManager)
Copyright © 2013 Atlassian. All Rights Reserved.