public class ExpirableUserTokenDaoHibernate extends HibernateDao implements ExpirableUserTokenDao
ExpirableUserTokenDao
batchFinder, batchProcessor, logger, sessionFactory
Constructor and Description |
---|
ExpirableUserTokenDaoHibernate() |
Modifier and Type | Method and Description |
---|---|
ExpirableUserToken |
add(ExpirableUserToken token)
Persist the given token
|
Optional<ExpirableUserToken> |
findByToken(String token)
Find the token with the given random hash
|
Class |
getPersistentClass()
All subclasses of HibernateDao must implement this method for
HibernateDao.load(long) to work correctly. |
boolean |
removeByDirectoryAndUsername(long directoryId,
String username)
Remove all the tokens matching the username and directory id
|
boolean |
removeByToken(String token)
Removes the token with the given random hash
|
boolean |
removeExpiredTokens(Date cutoffDate)
Remove all the tokens whose expiry date is older than the given cutoff date
|
createHibernateQuery, load, load, loadReference, loadReference, remove, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setSessionFactory, update
public ExpirableUserToken add(ExpirableUserToken token) throws ObjectAlreadyExistsException
ExpirableUserTokenDao
add
in interface ExpirableUserTokenDao
token
- a tokenObjectAlreadyExistsException
- if a token with the same random hash already existspublic Optional<ExpirableUserToken> findByToken(String token)
ExpirableUserTokenDao
findByToken
in interface ExpirableUserTokenDao
token
- a random hashpublic boolean removeByToken(String token)
ExpirableUserTokenDao
removeByToken
in interface ExpirableUserTokenDao
token
- a random hashpublic boolean removeExpiredTokens(Date cutoffDate)
ExpirableUserTokenDao
removeExpiredTokens
in interface ExpirableUserTokenDao
cutoffDate
- a datepublic boolean removeByDirectoryAndUsername(long directoryId, String username)
ExpirableUserTokenDao
removeByDirectoryAndUsername
in interface ExpirableUserTokenDao
directoryId
- directory where the user livesusername
- username to remove tokens forpublic Class getPersistentClass()
HibernateDao
HibernateDao.load(long)
to work correctly.getPersistentClass
in class HibernateDao
Copyright © 2016 Atlassian. All rights reserved.