com.atlassian.crowd.dao.token
Class TokenDAOMemory

java.lang.Object
  extended by com.atlassian.crowd.dao.token.TokenDAOMemory
All Implemented Interfaces:
TokenDAO

public class TokenDAOMemory
extends java.lang.Object
implements TokenDAO

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)
           
 Token findByID(long ID)
           
 Token findByIdentifierHash(java.lang.String identifierHash)
           
 Token findByRandomHash(java.lang.String randomHash)
           
 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)
           
 void remove(java.lang.Object persistentObject)
           
 void remove(Token token)
           
 void removeAccessedBefore(java.util.Date expiryTime)
           
 void removeAll()
          TokenDAOPersistence.removeAll()
 void removeAll(long directoryId)
           
 void save(java.lang.Object persistentObject)
           
 void saveAll(java.util.Collection<Token> tokens)
          TokenDAOPersistence.saveAll()
 java.util.List<Token> search(EntityQuery query)
           
 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

RANDOM_HASH_CACHE

public static final java.lang.String RANDOM_HASH_CACHE

IDENTIFIER_HASH_CAHE

public static final java.lang.String IDENTIFIER_HASH_CAHE
Constructor Detail

TokenDAOMemory

public TokenDAOMemory()
Method Detail

findByRandomHash

public Token findByRandomHash(java.lang.String randomHash)
                       throws ObjectNotFoundException
Specified by:
findByRandomHash in interface TokenDAO
Throws:
ObjectNotFoundException

findByIdentifierHash

public Token findByIdentifierHash(java.lang.String identifierHash)
                           throws ObjectNotFoundException
Specified by:
findByIdentifierHash in interface TokenDAO
Throws:
ObjectNotFoundException

add

public Token add(Token token)
Specified by:
add in interface TokenDAO

update

public Token update(Token token)
Specified by:
update in interface TokenDAO
Parameters:
token - token to update.
Returns:
updates the last accessed date on the token (sets it to now).

remove

public void remove(Token token)
Specified by:
remove in interface TokenDAO

search

public java.util.List<Token> search(EntityQuery query)
Specified by:
search in interface TokenDAO

findByID

public Token findByID(long ID)
               throws ObjectNotFoundException
Specified by:
findByID in interface TokenDAO
Throws:
ObjectNotFoundException

remove

public void remove(long directoryId,
                   java.lang.String name)
Specified by:
remove in interface TokenDAO

removeAll

public void removeAll(long directoryId)
Specified by:
removeAll in interface TokenDAO

removeAccessedBefore

public void removeAccessedBefore(java.util.Date expiryTime)
Specified by:
removeAccessedBefore in interface TokenDAO

getPersistentClass

public java.lang.Class getPersistentClass()

save

public void save(java.lang.Object persistentObject)

update

public void update(java.lang.Object persistentObject)

remove

public void remove(java.lang.Object persistentObject)

load

public java.lang.Object load(long ID)

loadAll

public java.util.Collection<Token> loadAll()
TokenDAOPersistence.loadAll()

Specified by:
loadAll in interface TokenDAO
Returns:
Collection of all active tokens.

saveAll

public void saveAll(java.util.Collection<Token> tokens)
TokenDAOPersistence.saveAll()

Specified by:
saveAll in interface TokenDAO
Parameters:
tokens - all tokens to add.

removeAll

public void removeAll()
TokenDAOPersistence.removeAll()

Specified by:
removeAll in interface TokenDAO

setCacheManager

public void setCacheManager(CacheManager cacheManager)


Copyright © 2010 Atlassian. All Rights Reserved.