public class HibernateAccessTokenDao extends BambooHibernateObjectDao<MutableAccessToken> implements AccessTokenDao
Constructor and Description |
---|
HibernateAccessTokenDao() |
Modifier and Type | Method and Description |
---|---|
long |
countByUserName(String userName) |
long |
countTokensWithPermission(AccessTokenPermission accessTokenPermission)
Count number of access tokens with given permission
|
void |
deleteByUserName(String userName)
Delete all user's tokens
|
Optional<MutableAccessToken> |
findByTokenId(String tokenId) |
List<MutableAccessToken> |
findByUserName(String userName)
Get all user's tokens
|
long |
scrollTokensForExport(Consumer<MutableAccessToken> consumer)
Scroll through all AccessToken records and pass them to consumer
|
boolean |
tokenWithNameAndUserNameExists(String userName,
String tokenName)
Check if user has token with name
|
countAll, countWithRestriction, delete, deleteAll, executeCountQuery, findAll, findById, merge, save, saveAll
getCacheAwareHibernateTemplate
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
@NotNull public Optional<MutableAccessToken> findByTokenId(String tokenId)
findByTokenId
in interface AccessTokenDao
Optional.empty()
@NotNull public List<MutableAccessToken> findByUserName(String userName)
AccessTokenDao
findByUserName
in interface AccessTokenDao
public void deleteByUserName(String userName)
AccessTokenDao
deleteByUserName
in interface AccessTokenDao
public long countByUserName(String userName)
countByUserName
in interface AccessTokenDao
public boolean tokenWithNameAndUserNameExists(@NotNull String userName, @NotNull String tokenName)
AccessTokenDao
tokenWithNameAndUserNameExists
in interface AccessTokenDao
public long scrollTokensForExport(@NotNull Consumer<MutableAccessToken> consumer)
AccessTokenDao
scrollTokensForExport
in interface AccessTokenDao
public long countTokensWithPermission(@NotNull AccessTokenPermission accessTokenPermission)
AccessTokenDao
countTokensWithPermission
in interface AccessTokenDao
Copyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.