|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.crowd.manager.token.TokenManagerImpl
public class TokenManagerImpl
Proxies the concrete TokenDAO implementations, and allows runtime swapping between implementations, along with copying of data between during swap.
| Constructor Summary | |
|---|---|
TokenManagerImpl(boolean initialUseIsMemory,
TokenDAO daoMemory,
TokenDAO daoHibernate,
PropertyManager propertyManager,
com.atlassian.event.api.EventPublisher eventPublisher)
|
|
TokenManagerImpl(TokenDAO daoMemory,
TokenDAO daoHibernate,
PropertyManager propertyManager,
com.atlassian.event.api.EventPublisher eventPublisher)
|
|
| Method Summary | |
|---|---|
Token |
add(Token token)
|
Token |
findByID(long ID)
|
Token |
findByIdentifierHash(java.lang.String identifierHash)
|
Token |
findByRandomHash(java.lang.String randomHash)
|
boolean |
isUsingDatabaseStorage()
Returns true if the memory token manager is in use. |
protected void |
move(TokenDAO to,
TokenDAO from)
Copies tokens from hibernate to in-memory DAO or vice versa, and upon success deletes the tokens from the source. |
void |
onApplicationStartedEvent(com.atlassian.config.lifecycle.events.ApplicationStartedEvent event)
On the application stated event, change to the correct token storage that has been stored in the database |
void |
onXMLRestoreFinishedEvent(XMLRestoreFinishedEvent event)
|
void |
remove(long directoryID,
java.lang.String name)
|
void |
remove(Token token)
|
void |
removeAccessedBefore(java.util.Date expiryTime)
|
void |
removeAll()
Removes all tokens from all implementations. |
void |
removeAll(long directoryId)
|
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. |
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 TokenManagerImpl(boolean initialUseIsMemory,
TokenDAO daoMemory,
TokenDAO daoHibernate,
PropertyManager propertyManager,
com.atlassian.event.api.EventPublisher eventPublisher)
public TokenManagerImpl(TokenDAO daoMemory,
TokenDAO daoHibernate,
PropertyManager propertyManager,
com.atlassian.event.api.EventPublisher eventPublisher)
| Method Detail |
|---|
public Token findByRandomHash(java.lang.String randomHash)
throws org.springframework.dao.DataAccessException,
ObjectNotFoundException
findByRandomHash in interface TokenManagerorg.springframework.dao.DataAccessException
ObjectNotFoundException
public Token findByIdentifierHash(java.lang.String identifierHash)
throws ObjectNotFoundException
findByIdentifierHash in interface TokenManagerObjectNotFoundException
public Token add(Token token)
throws org.springframework.dao.DataAccessException
add in interface TokenManagerorg.springframework.dao.DataAccessException
public Token update(Token token)
throws ObjectNotFoundException
update in interface TokenManagertoken - token to update.
ObjectNotFoundException - token not found.
public void remove(Token token)
throws org.springframework.dao.DataAccessException
remove in interface TokenManagerorg.springframework.dao.DataAccessExceptionpublic java.util.List<Token> search(EntityQuery query)
search in interface TokenManager
public Token findByID(long ID)
throws org.springframework.dao.DataAccessException,
ObjectNotFoundException
findByID in interface TokenManagerorg.springframework.dao.DataAccessException
ObjectNotFoundException
public void remove(long directoryID,
java.lang.String name)
throws org.springframework.dao.DataAccessException
remove in interface TokenManagerorg.springframework.dao.DataAccessExceptionpublic void removeAll(long directoryId)
removeAll in interface TokenManagerpublic void removeAccessedBefore(java.util.Date expiryTime)
removeAccessedBefore in interface TokenManagerpublic void removeAll()
removeAll in interface TokenManagerpublic boolean isUsingDatabaseStorage()
isUsingDatabaseStorage in interface TokenManager
public void setUsingDatabaseStorage(boolean useDatabaseStorage)
throws PropertyManagerException
setUsingDatabaseStorage in interface TokenManageruseDatabaseStorage -
PropertyManagerExceptionpublic void switchToMemory()
public void switchToHibernate()
protected void move(TokenDAO to,
TokenDAO from)
@EventListener public void onApplicationStartedEvent(com.atlassian.config.lifecycle.events.ApplicationStartedEvent event)
event - the application started event@EventListener public void onXMLRestoreFinishedEvent(XMLRestoreFinishedEvent event)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||