com.atlassian.crowd.model.token
Interface TokenDAOPersistence

All Superinterfaces:
ObjectDao, TokenDAO
All Known Implementing Classes:
TokenDAOHibernate, TokenDAOMemory

public interface TokenDAOPersistence
extends TokenDAO

Provides methods for loading and saving tokens. Used when swapping TokenDAO implementations at runtime.


Method Summary
 java.util.Collection<Token> loadAll()
          Used when switching implementations.
 void removeAll()
          Wipes all tokens from the store.
 void saveAll(java.util.Collection<Token> tokens)
          Used when switching implementations.
 
Methods inherited from interface com.atlassian.crowd.model.token.TokenDAO
add, findByID, findByIdentifierHash, findByRandomHash, remove, remove, removeAccessedBefore, removeAll, search, update
 
Methods inherited from interface com.atlassian.crowd.util.persistence.hibernate.ObjectDao
getPersistentClass, load, remove, save, update
 

Method Detail

loadAll

java.util.Collection<Token> loadAll()
Used when switching implementations. Synchronisation is the caller's responsibility; don't allow calls to other methods while this is in progress if you need to guarantee that the data are complete. TokenDAOProxy

Returns:
Collection of all active tokens.
Throws:
org.springframework.dao.DataAccessException - If the tokens could not be retrieved.

saveAll

void saveAll(java.util.Collection<Token> tokens)
Used when switching implementations. Synchronization is the caller's reponsibility; don't allow calls to other methods while this is in progress if you need to guarantee that the data are complete. TokenDAOProxy

Parameters:
tokens - all tokens to add.
Throws:
org.springframework.dao.DataAccessException

removeAll

void removeAll()
Wipes all tokens from the store. Called after a successful loadAll() and persist into another store.

Specified by:
removeAll in interface TokenDAO
Throws:
org.springframework.dao.DataAccessException


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.