com.atlassian.crowd.model.token
Class TokenDAOMemory

java.lang.Object
  extended by com.atlassian.crowd.model.token.TokenDAOMemory
All Implemented Interfaces:
TokenDAO, TokenDAOPersistence, ObjectDao

public class TokenDAOMemory
extends java.lang.Object
implements TokenDAOPersistence

An in-memory implementation of the TokenDAO. This will use the caching manager


Field Summary
protected static java.lang.String CACHE_NAME
           
 
Constructor Summary
TokenDAOMemory()
           
 
Method Summary
 Token add(Token token)
           
 Token findByID(long ID)
           
 Token findByKey(java.lang.String key)
           
 java.lang.Class getPersistentClass()
          The class that is being persisted
 java.lang.Object load(long ID)
          Loads a persistnce DAO object from the persistence store.
 java.util.Collection loadAll()
          TokenDAOPersistence.loadAll()
 void remove(java.lang.Object persistentObject)
          Removes the DAO object from the persistence store.
 void remove(Token token)
           
 void removeAll()
          TokenDAOPersistence.removeAll()
 void removeAll(long directoryID, java.lang.String name)
           
 void save(java.lang.Object persistentObject)
          Saves a new DAO object to the persistence store.
 void saveAll(java.util.Collection tokens)
          TokenDAOPersistence.saveAll()
 java.util.List<Token> search(SearchContext searchContext)
           
 void setCacheManager(CacheManager cacheManager)
           
 void update(java.lang.Object persistentObject)
          Updates an existing DAO object, if the object does not exist it will be added to the persistence store.
 Token update(Token token)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_NAME

protected static final java.lang.String CACHE_NAME
Constructor Detail

TokenDAOMemory

public TokenDAOMemory()
Method Detail

findByKey

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

add

public Token add(Token token)
          throws org.springframework.dao.DataAccessException
Specified by:
add in interface TokenDAO
Throws:
org.springframework.dao.DataAccessException

update

public Token update(Token token)
             throws org.springframework.dao.DataAccessException
Specified by:
update in interface TokenDAO
Throws:
org.springframework.dao.DataAccessException

remove

public void remove(Token token)
            throws org.springframework.dao.DataAccessException
Specified by:
remove in interface TokenDAO
Throws:
org.springframework.dao.DataAccessException

search

public java.util.List<Token> search(SearchContext searchContext)
                             throws org.springframework.dao.DataAccessException
Specified by:
search in interface TokenDAO
Throws:
org.springframework.dao.DataAccessException

findByID

public Token findByID(long ID)
               throws org.springframework.dao.DataAccessException,
                      ObjectNotFoundException
Specified by:
findByID in interface TokenDAO
Throws:
org.springframework.dao.DataAccessException
ObjectNotFoundException

removeAll

public void removeAll(long directoryID,
                      java.lang.String name)
               throws org.springframework.dao.DataAccessException
Specified by:
removeAll in interface TokenDAO
Throws:
org.springframework.dao.DataAccessException

getPersistentClass

public java.lang.Class getPersistentClass()
Description copied from interface: ObjectDao
The class that is being persisted

Specified by:
getPersistentClass in interface ObjectDao
Returns:
Class

save

public void save(java.lang.Object persistentObject)
          throws org.springframework.dao.DataAccessException
Description copied from interface: ObjectDao
Saves a new DAO object to the persistence store.

Specified by:
save in interface ObjectDao
Parameters:
persistentObject - The object to save.
Throws:
org.springframework.dao.DataAccessException - A persistence exception has occurred.

update

public void update(java.lang.Object persistentObject)
            throws org.springframework.dao.DataAccessException
Description copied from interface: ObjectDao
Updates an existing DAO object, if the object does not exist it will be added to the persistence store.

Specified by:
update in interface ObjectDao
Parameters:
persistentObject - The object to update.
Throws:
org.springframework.dao.DataAccessException - A persistence exception has occurred.

remove

public void remove(java.lang.Object persistentObject)
            throws org.springframework.dao.DataAccessException
Description copied from interface: ObjectDao
Removes the DAO object from the persistence store.

Specified by:
remove in interface ObjectDao
Parameters:
persistentObject - The object to remove.
Throws:
org.springframework.dao.DataAccessException - A persistence exception has occurred.

load

public java.lang.Object load(long ID)
Description copied from interface: ObjectDao
Loads a persistnce DAO object from the persistence store.

Specified by:
load in interface ObjectDao
Parameters:
ID - The unique identifier of the object to load from the persistence store.
Returns:
Object The populated object from the database

setCacheManager

public void setCacheManager(CacheManager cacheManager)

loadAll

public java.util.Collection loadAll()
TokenDAOPersistence.loadAll()

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

saveAll

public void saveAll(java.util.Collection tokens)
             throws org.springframework.dao.DataAccessException
TokenDAOPersistence.saveAll()

Specified by:
saveAll in interface TokenDAOPersistence
Throws:
org.springframework.dao.DataAccessException

removeAll

public void removeAll()
TokenDAOPersistence.removeAll()

Specified by:
removeAll in interface TokenDAOPersistence


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.