public class TokenDAOHibernate extends HibernateDao<Token> implements TokenDAO
batchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSourcesessionFactory| Constructor and Description |
|---|
TokenDAOHibernate(HQLQueryTranslater hqlQueryTranslater) |
| Modifier and Type | Method and Description |
|---|---|
Token |
add(Token token)
Persists a new token.
|
Token |
findByID(long ID) |
Token |
findByIdentifierHash(String identifierHash)
Finds token by identifier hash.
|
Token |
findByRandomHash(String randomHash)
Finds token by random hash.
|
Class<Token> |
getPersistentClass()
All subclasses of HibernateDao must implement this method for
HibernateDao.load(Serializable) to work
correctly. |
Collection<Token> |
loadAll()
Used when switching implementations.
|
void |
remove(long directoryId,
String name)
Remove token.
|
void |
remove(Token token)
Removes a token.
|
void |
removeAll()
Wipes all tokens from the store.
|
void |
removeAll(long directoryId)
Remove all tokens associated with the given directory id.
|
void |
removeExcept(long directoryId,
String name,
String exclusionToken)
Remove all tokens for the user except for the token
specified by
exclusionToken. |
void |
removeExpiredTokens(Date currentTime,
long maxLifeInSeconds)
Remove all tokens that have expired.
|
void |
saveAll(Collection<Token> tokens)
Used when switching implementations.
|
List<AuthenticationToken> |
search(EntityQuery<? extends AuthenticationToken> query)
Searches for token based on criteria.
|
Token |
update(Token token) |
createDeleteQuery, createDeleteQuery, createQuery, createQuery, executeHQLQuery, executeHQLQuery, findAllInternal, findByProperties, findByPropertiesOptional, findByProperty, findByProperty, findByPropertyOptional, findByPropertyOrThrow, getCountByProperties, load, load, loadOptional, loadReference, loadReference, remove, removeByIdIfPresent, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setClock, setStatelessSessionBatchProcessor, toPredicates, updatesetSessionFactory, withStatelessSessionpublic TokenDAOHibernate(HQLQueryTranslater hqlQueryTranslater)
public Token add(Token token) throws ObjectAlreadyExistsException
SessionTokenStorageadd in interface SessionTokenStoragetoken - Token.ObjectAlreadyExistsException - if a token with the same identifier hash already exists.public Token findByID(long ID) throws ObjectNotFoundException
ObjectNotFoundExceptionpublic Token findByIdentifierHash(String identifierHash) throws ObjectNotFoundException
SessionTokenStoragefindByIdentifierHash in interface SessionTokenStorageidentifierHash - Identifier hash.ObjectNotFoundException - if the token identified by the identifier hash cannot be found.public Token findByRandomHash(String randomHash) throws ObjectNotFoundException
SessionTokenStoragefindByRandomHash in interface SessionTokenStoragerandomHash - Random hash.ObjectNotFoundException - if the token identified by the random hash cannot be found.public Class<Token> getPersistentClass()
HibernateDaoHibernateDao.load(Serializable) to work
correctly.getPersistentClass in class HibernateDao<Token>public Collection<Token> loadAll()
TokenDAOpublic void remove(Token token)
SessionTokenStorageremove in interface SessionTokenStoragetoken - Token.public void remove(long directoryId,
String name)
SessionTokenStorageremove in interface SessionTokenStoragedirectoryId - Directory id.name - User or application name.public void removeExcept(long directoryId,
String name,
String exclusionToken)
SessionTokenStorageexclusionToken.removeExcept in interface SessionTokenStoragedirectoryId - Directory id.name - User or application name.exclusionToken - the random hash of the token to retain, if presentpublic void removeExpiredTokens(Date currentTime, long maxLifeInSeconds)
SessionTokenStorageremoveExpiredTokens in interface SessionTokenStoragecurrentTime - Current datemaxLifeInSeconds - Max lifespan for tokens, unless they specific a shorter one.public void removeAll(long directoryId)
SessionTokenStorageremoveAll in interface SessionTokenStoragedirectoryId - Directory id.public void removeAll()
SessionTokenStorageremoveAll in interface SessionTokenStoragepublic void saveAll(Collection<Token> tokens)
TokenDAOpublic List<AuthenticationToken> search(EntityQuery<? extends AuthenticationToken> query)
SearchableTokenStoragesearch in interface SearchableTokenStoragequery - Query.public Token update(Token token)
update in interface SessionTokenStoragetoken - token to update.Copyright © 2020 Atlassian. All rights reserved.