Package com.atlassian.bamboo.accesstoken
Interface AccessTokenDao
- All Superinterfaces:
BambooObjectDao<MutableAccessToken>
- All Known Implementing Classes:
HibernateAccessTokenDao
DAO for AccessToken objects. No Permission checking in DAO
- Since:
- 6.10
-
Method Summary
Modifier and TypeMethodDescriptionlong
countByUserName
(String userName) long
countTokensWithPermission
(@NotNull AccessTokenPermission accessTokenPermission) Count number of access tokens with given permissionvoid
deleteByUserName
(String userName) Delete all user's tokens@NotNull Optional<MutableAccessToken>
findByTokenId
(String tokenId) @NotNull List<MutableAccessToken>
findByUserName
(String userName) Get all user's tokenslong
scrollTokensForExport
(Consumer<MutableAccessToken> exportXmlConsumer) Scroll through all AccessToken records and pass them to consumerboolean
tokenWithNameAndUserNameExists
(@NotNull String userName, @NotNull String tokenName) Check if user has token with nameMethods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
-
Method Details
-
findByTokenId
- Parameters:
tokenId
-- Returns:
- Optional with token if exists, otherwise
Optional.empty()
-
findByUserName
Get all user's tokens- Parameters:
userName
-- Returns:
- tokens
-
deleteByUserName
Delete all user's tokens- Parameters:
userName
-
-
countByUserName
- Parameters:
userName
-- Returns:
- number of user's tokens
-
tokenWithNameAndUserNameExists
boolean tokenWithNameAndUserNameExists(@NotNull @NotNull String userName, @NotNull @NotNull String tokenName) Check if user has token with name- Parameters:
userName
-tokenName
-- Returns:
- true if token for user name and token name already exists
-
scrollTokensForExport
Scroll through all AccessToken records and pass them to consumer -
countTokensWithPermission
Count number of access tokens with given permission- Parameters:
accessTokenPermission
-- Returns:
-