|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.crowd.dao.token.TokenDAOMemory
public class TokenDAOMemory
An in-memory implementation of the TokenDAO. This will use the caching manager. Note: this is not thead-safe!
| Field Summary | |
|---|---|
static java.lang.String |
IDENTIFIER_HASH_CAHE
|
static java.lang.String |
RANDOM_HASH_CACHE
|
| Constructor Summary | |
|---|---|
TokenDAOMemory()
|
|
| Method Summary | |
|---|---|
Token |
add(Token token)
Persists a new token. |
Token |
findByID(long ID)
Finds token by its id. |
Token |
findByIdentifierHash(java.lang.String identifierHash)
Finds token by identifier hash. |
Token |
findByRandomHash(java.lang.String randomHash)
Finds token by random hash. |
java.lang.Class |
getPersistentClass()
|
java.lang.Object |
load(long ID)
|
java.util.Collection<Token> |
loadAll()
TokenDAOPersistence.loadAll() |
void |
remove(long directoryId,
java.lang.String name)
Remove token. |
void |
remove(java.lang.Object persistentObject)
|
void |
remove(Token token)
Removes a token. |
void |
removeAccessedBefore(java.util.Date expiryTime)
Remove all tokens by expiryTime. |
void |
removeAll()
TokenDAOPersistence.removeAll() |
void |
removeAll(long directoryId)
Remove all tokens associated with the given directory id. |
void |
save(java.lang.Object persistentObject)
|
void |
saveAll(java.util.Collection<Token> tokens)
TokenDAOPersistence.saveAll() |
java.util.List<Token> |
search(EntityQuery query)
Searches for token based on criteria. |
void |
setCacheManager(CacheManager cacheManager)
|
void |
update(java.lang.Object persistentObject)
|
Token |
update(Token token)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String RANDOM_HASH_CACHE
public static final java.lang.String IDENTIFIER_HASH_CAHE
| Constructor Detail |
|---|
public TokenDAOMemory()
| Method Detail |
|---|
public Token findByRandomHash(java.lang.String randomHash)
throws ObjectNotFoundException
TokenDAO
findByRandomHash in interface TokenDAOrandomHash - Random hash.
ObjectNotFoundException - if the token identified by the random hash cannot be found.
public Token findByIdentifierHash(java.lang.String identifierHash)
throws ObjectNotFoundException
TokenDAO
findByIdentifierHash in interface TokenDAOidentifierHash - Identifier hash.
ObjectNotFoundException - if the token identified by the identifier hash cannot be found.public Token add(Token token)
TokenDAO
add in interface TokenDAOtoken - Token.
public Token update(Token token)
update in interface TokenDAOtoken - token to update.
public void remove(Token token)
TokenDAO
remove in interface TokenDAOtoken - Token.public java.util.List<Token> search(EntityQuery query)
TokenDAO
search in interface TokenDAOquery - Query.
public Token findByID(long ID)
throws ObjectNotFoundException
TokenDAO
findByID in interface TokenDAOID - id.
ObjectNotFoundException - if the Token cannot be found.
public void remove(long directoryId,
java.lang.String name)
TokenDAO
remove in interface TokenDAOdirectoryId - Directory id.name - User or application name.public void removeAll(long directoryId)
TokenDAO
removeAll in interface TokenDAOdirectoryId - Directory id.public void removeAccessedBefore(java.util.Date expiryTime)
TokenDAO
removeAccessedBefore in interface TokenDAOexpiryTime - Expiry time.public java.lang.Class getPersistentClass()
public void save(java.lang.Object persistentObject)
public void update(java.lang.Object persistentObject)
public void remove(java.lang.Object persistentObject)
public java.lang.Object load(long ID)
public java.util.Collection<Token> loadAll()
TokenDAOPersistence.loadAll()
loadAll in interface TokenDAOpublic void saveAll(java.util.Collection<Token> tokens)
TokenDAOPersistence.saveAll()
saveAll in interface TokenDAOtokens - all tokens to add.public void removeAll()
TokenDAOPersistence.removeAll()
removeAll in interface TokenDAOpublic void setCacheManager(CacheManager cacheManager)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||