|
||||||||||
| 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. This class is thread-safe.
| Field Summary | |
|---|---|
static String |
IDENTIFIER_HASH_CACHE
|
static String |
IDENTIFIER_HASH_CAHE
Deprecated. |
static String |
RANDOM_HASH_CACHE
|
| Constructor Summary | |
|---|---|
TokenDAOMemory(CacheManager cacheManager)
|
|
| Method Summary | |
|---|---|
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 |
removeExcept(long directoryId,
String name,
String exclusionToken)
Remove all tokens for the user except for the token specified by exclusionToken. |
void |
removeExpiredTokens(Date currentTime,
long maxLifeInSeconds)
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String RANDOM_HASH_CACHE
public static final String IDENTIFIER_HASH_CACHE
@Deprecated public static final String IDENTIFIER_HASH_CAHE
| Constructor Detail |
|---|
public TokenDAOMemory(CacheManager cacheManager)
| Method Detail |
|---|
public Token findByRandomHash(String randomHash)
throws ObjectNotFoundException
SessionTokenStorage
findByRandomHash in interface SessionTokenStoragerandomHash - Random hash.
ObjectNotFoundException - if the token identified by the random hash cannot be found.
public Token findByIdentifierHash(String identifierHash)
throws ObjectNotFoundException
SessionTokenStorage
findByIdentifierHash in interface SessionTokenStorageidentifierHash - Identifier hash.
ObjectNotFoundException - if the token identified by the identifier hash cannot be found.
public Token add(Token token)
throws ObjectAlreadyExistsException
SessionTokenStorage
add in interface SessionTokenStoragetoken - Token.
ObjectAlreadyExistsException - if a token with the same identifier hash already exists.public Token update(Token token)
update in interface SessionTokenStoragetoken - token to update.
public void remove(Token token)
SessionTokenStorage
remove in interface SessionTokenStoragetoken - Token.public List<Token> search(EntityQuery<? extends Token> query)
SearchableTokenStorage
search in interface SearchableTokenStoragequery - Query.
public void remove(long directoryId,
String name)
SessionTokenStorage
remove in interface SessionTokenStoragedirectoryId - Directory id.name - User or application name.
public void removeExcept(long directoryId,
String name,
String exclusionToken)
SessionTokenStorageexclusionToken.
removeExcept in interface SessionTokenStoragedirectoryId - Directory id.name - User or application name.exclusionToken - the random hash of the token to retain, if presentpublic void removeAll(long directoryId)
SessionTokenStorage
removeAll in interface SessionTokenStoragedirectoryId - Directory id.
public void removeExpiredTokens(Date currentTime,
long maxLifeInSeconds)
SessionTokenStorage
removeExpiredTokens in interface SessionTokenStoragecurrentTime - Current datemaxLifeInSeconds - Max lifespan for tokens, unless they specific a shorter one.public Collection<Token> loadAll()
TokenDAO
loadAll in interface TokenDAOpublic void saveAll(Collection<Token> tokens)
TokenDAO
saveAll in interface TokenDAOtokens - all tokens to add.public void removeAll()
SessionTokenStorage
removeAll in interface SessionTokenStorage
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||