public class CrowdRememberMeTokenDAOHibernate extends HibernateDao<InternalCrowdRememberMeToken> implements CrowdRememberMeTokenDAO
batchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSource
sessionFactory
Constructor and Description |
---|
CrowdRememberMeTokenDAOHibernate() |
Modifier and Type | Method and Description |
---|---|
Optional<InternalCrowdRememberMeToken> |
findByIdExclusiveLock(Long id)
Find token by the id, if present
|
Optional<InternalCrowdRememberMeToken> |
findBySeriesAndToken(String series,
String token) |
List<InternalCrowdRememberMeToken> |
findTokensForUser(String username,
long directoryId)
Lists tokens for the given username and the directory id
|
Class<InternalCrowdRememberMeToken> |
getPersistentClass()
All subclasses of HibernateDao must implement this method for
HibernateDao.load(Serializable) to work
correctly. |
void |
refresh(InternalCrowdRememberMeToken token)
Reload the properties from database
|
void |
removeAll()
Removes all remember me tokens present
|
int |
removeAllExpiredTokens(LocalDateTime lastValidTokenCreateTime,
LocalDateTime lastValidUsedBeforeTime)
Removes all tokens having createdTime before the lastValidTokenCreateTime, or usedTime before the lastValidUsedBeforeTime
|
int |
removeTokensForDirectory(long directoryId)
Removes all the tokens for the given directory
|
int |
removeTokensForSeries(String series)
Removes tokens for all the given series
|
int |
removeTokensForUserInDirectory(String username,
long directoryId)
Removes all tokens for a user in the given directory
|
InternalCrowdRememberMeToken |
save(InternalCrowdRememberMeToken token)
Saves the token
|
boolean |
setUsedByRemoteAddress(CrowdRememberMeToken crowdRememberMeToken)
Tries to claim the given token if it is not yet claimed (used)
|
createDeleteQuery, createDeleteQuery, createHibernateQuery, createQuery, createQuery, executeHQLQuery, findAllInternal, findByProperties, findByPropertiesOptional, findByProperty, findByProperty, findByPropertyOptional, findByPropertyOrThrow, load, load, loadOptional, loadReference, loadReference, remove, removeByIdIfPresent, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setClock, setStatelessSessionBatchProcessor, toPredicates, update
setSessionFactory, withStatelessSession
public void removeAll()
CrowdRememberMeTokenDAO
removeAll
in interface CrowdRememberMeTokenDAO
public void refresh(InternalCrowdRememberMeToken token)
CrowdRememberMeTokenDAO
refresh
in interface CrowdRememberMeTokenDAO
token
- token to be refreshedpublic Class<InternalCrowdRememberMeToken> getPersistentClass()
HibernateDao
HibernateDao.load(Serializable)
to work
correctly.getPersistentClass
in class HibernateDao<InternalCrowdRememberMeToken>
public Optional<InternalCrowdRememberMeToken> findByIdExclusiveLock(Long id)
CrowdRememberMeTokenDAO
findByIdExclusiveLock
in interface CrowdRememberMeTokenDAO
public List<InternalCrowdRememberMeToken> findTokensForUser(String username, long directoryId)
CrowdRememberMeTokenDAO
findTokensForUser
in interface CrowdRememberMeTokenDAO
username
- username of the userdirectoryId
- directory id to be searched forpublic InternalCrowdRememberMeToken save(InternalCrowdRememberMeToken token)
CrowdRememberMeTokenDAO
save
in interface CrowdRememberMeTokenDAO
public int removeAllExpiredTokens(LocalDateTime lastValidTokenCreateTime, LocalDateTime lastValidUsedBeforeTime)
CrowdRememberMeTokenDAO
removeAllExpiredTokens
in interface CrowdRememberMeTokenDAO
lastValidTokenCreateTime
- Last valid token create timestamp (exclusive)lastValidUsedBeforeTime
- Last valid token used timestamp (exclusive)public int removeTokensForSeries(String series)
CrowdRememberMeTokenDAO
removeTokensForSeries
in interface CrowdRememberMeTokenDAO
series
- Series to remove all tokens forpublic Optional<InternalCrowdRememberMeToken> findBySeriesAndToken(@Nonnull String series, @Nonnull String token)
findBySeriesAndToken
in interface CrowdRememberMeTokenDAO
series
- Series to match tokentoken
- token value to matchpublic int removeTokensForUserInDirectory(String username, long directoryId)
CrowdRememberMeTokenDAO
removeTokensForUserInDirectory
in interface CrowdRememberMeTokenDAO
username
- username of the userdirectoryId
- directory id to which the user belongspublic int removeTokensForDirectory(long directoryId)
CrowdRememberMeTokenDAO
removeTokensForDirectory
in interface CrowdRememberMeTokenDAO
directoryId
- directory id to which the tokens belongspublic boolean setUsedByRemoteAddress(CrowdRememberMeToken crowdRememberMeToken)
CrowdRememberMeTokenDAO
setUsedByRemoteAddress
in interface CrowdRememberMeTokenDAO
crowdRememberMeToken
- token to be claimedCopyright © 2019 Atlassian. All rights reserved.