|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.crowd.model.token.TokenDAOProxy
public class TokenDAOProxy
Proxies the concrete TokenDAO implementations, and allows runtime swapping between implementations, along with copying of data between during swap.
| Constructor Summary | |
|---|---|
TokenDAOProxy(boolean initialUseIsMemory,
TokenDAOPersistence daoMemory,
TokenDAOPersistence daoHibernate,
PropertyManager propertyManager)
|
|
TokenDAOProxy(TokenDAOPersistence daoMemory,
TokenDAOPersistence daoHibernate,
PropertyManager propertyManager)
|
|
| 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()
The class that is being persisted |
boolean |
isUsingHibernateDAO()
Returns true if the memory token manager is in use. |
java.lang.Object |
load(long ID)
Loads a persistnce DAO object from the persistence store. |
protected void |
move(TokenDAOPersistence to,
TokenDAOPersistence from)
Copies tokens from hibernate to in-memory DAO or vice versa, and upon success deletes the tokens from the source. |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event)
On the application stated event, change to the correct token storage that has been stored in the database |
void |
remove(long directoryID,
java.lang.String name)
|
void |
remove(java.lang.Object persistentObject)
Removes the DAO object from the persistence store. |
void |
remove(Token token)
|
void |
removeAccessedBefore(java.util.Date expiryTime)
|
void |
removeAll()
Removes all tokens from all implementations. |
void |
removeAll(long directoryId)
|
void |
save(java.lang.Object persistentObject)
Saves a new DAO object to the persistence store. |
java.util.List<Token> |
search(EntityQuery query)
|
void |
setUsingDatabaseStorage(boolean useDatabaseStorage)
Performs the switch, if necessary. |
void |
switchToHibernate()
If the In-memory DAO is in use, transparently switches to Hibernate DAO. |
void |
switchToMemory()
If the Hibernate DAO is in use, transparently switches to In-memory DAO. |
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 |
| Constructor Detail |
|---|
public TokenDAOProxy(boolean initialUseIsMemory,
TokenDAOPersistence daoMemory,
TokenDAOPersistence daoHibernate,
PropertyManager propertyManager)
public TokenDAOProxy(TokenDAOPersistence daoMemory,
TokenDAOPersistence daoHibernate,
PropertyManager propertyManager)
| Method Detail |
|---|
public Token findByRandomHash(java.lang.String randomHash)
throws org.springframework.dao.DataAccessException,
ObjectNotFoundException
findByRandomHash in interface TokenDAOorg.springframework.dao.DataAccessException
ObjectNotFoundException
public Token findByIdentifierHash(java.lang.String identifierHash)
throws ObjectNotFoundException
findByIdentifierHash in interface TokenDAOObjectNotFoundException
public Token add(Token token)
throws org.springframework.dao.DataAccessException
add in interface TokenDAOorg.springframework.dao.DataAccessException
public Token update(Token token)
throws ObjectNotFoundException
update in interface TokenDAOtoken - token to update.
ObjectNotFoundException
public void remove(Token token)
throws org.springframework.dao.DataAccessException
remove in interface TokenDAOorg.springframework.dao.DataAccessExceptionpublic java.util.List<Token> search(EntityQuery query)
search in interface TokenDAO
public Token findByID(long ID)
throws org.springframework.dao.DataAccessException,
ObjectNotFoundException
findByID in interface TokenDAOorg.springframework.dao.DataAccessException
ObjectNotFoundException
public void remove(long directoryID,
java.lang.String name)
throws org.springframework.dao.DataAccessException
remove in interface TokenDAOorg.springframework.dao.DataAccessExceptionpublic void removeAll(long directoryId)
removeAll in interface TokenDAOpublic void removeAccessedBefore(java.util.Date expiryTime)
removeAccessedBefore in interface TokenDAOpublic void removeAll()
removeAll in interface TokenDAOpublic java.lang.Class getPersistentClass()
ObjectDao
getPersistentClass in interface ObjectDao
public void save(java.lang.Object persistentObject)
throws org.springframework.dao.DataAccessException
ObjectDao
save in interface ObjectDaopersistentObject - The object to save.
org.springframework.dao.DataAccessException - A persistence exception has occurred.
public void update(java.lang.Object persistentObject)
throws org.springframework.dao.DataAccessException
ObjectDao
update in interface ObjectDaopersistentObject - The object to update.
org.springframework.dao.DataAccessException - A persistence exception has occurred.
public void remove(java.lang.Object persistentObject)
throws org.springframework.dao.DataAccessException
ObjectDao
remove in interface ObjectDaopersistentObject - The object to remove.
org.springframework.dao.DataAccessException - A persistence exception has occurred.
public java.lang.Object load(long ID)
throws ObjectNotFoundException
ObjectDao
load in interface ObjectDaoID - The unique identifier of the object to load from the persistence store.
ObjectNotFoundException - if the given object with ID
for the persistent class does not existpublic boolean isUsingHibernateDAO()
public void setUsingDatabaseStorage(boolean useDatabaseStorage)
throws PropertyManagerException
useDatabaseStorage -
PropertyManagerExceptionpublic void switchToMemory()
public void switchToHibernate()
protected void move(TokenDAOPersistence to,
TokenDAOPersistence from)
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListenerevent -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||