|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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(String identifierHash)
|
Token |
findByRandomHash(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,
String name)
|
void |
remove(Token token)
|
void |
removeAccessedBefore(Date expiryTime)
|
void |
removeAll()
Removes all tokens from all implementations. |
void |
removeAll(long directoryId)
|
List<Token> |
search(EntityQuery<? extends Token> 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(String randomHash) throws org.springframework.dao.DataAccessException, ObjectNotFoundException
findByRandomHash
in interface TokenManager
org.springframework.dao.DataAccessException
ObjectNotFoundException
public Token findByIdentifierHash(String identifierHash) throws ObjectNotFoundException
findByIdentifierHash
in interface TokenManager
ObjectNotFoundException
public Token add(Token token) throws org.springframework.dao.DataAccessException
add
in interface TokenManager
org.springframework.dao.DataAccessException
public Token update(Token token) throws ObjectNotFoundException
update
in interface TokenManager
token
- token to update.
ObjectNotFoundException
- token not found.public void remove(Token token) throws org.springframework.dao.DataAccessException
remove
in interface TokenManager
org.springframework.dao.DataAccessException
public List<Token> search(EntityQuery<? extends Token> query)
search
in interface TokenManager
public Token findByID(long ID) throws org.springframework.dao.DataAccessException, ObjectNotFoundException
findByID
in interface TokenManager
org.springframework.dao.DataAccessException
ObjectNotFoundException
public void remove(long directoryID, String name) throws org.springframework.dao.DataAccessException
remove
in interface TokenManager
org.springframework.dao.DataAccessException
public void removeAll(long directoryId)
removeAll
in interface TokenManager
public void removeAccessedBefore(Date expiryTime)
removeAccessedBefore
in interface TokenManager
public void removeAll()
removeAll
in interface TokenManager
public boolean isUsingDatabaseStorage()
isUsingDatabaseStorage
in interface TokenManager
public void setUsingDatabaseStorage(boolean useDatabaseStorage) throws PropertyManagerException
setUsingDatabaseStorage
in interface TokenManager
useDatabaseStorage
-
PropertyManagerException
public 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 |