Package com.atlassian.bamboo.accesstoken
Interface AccessTokenDao
-
- All Superinterfaces:
BambooObjectDao<MutableAccessToken>
- All Known Implementing Classes:
HibernateAccessTokenDao
@Internal public interface AccessTokenDao extends BambooObjectDao<MutableAccessToken>
DAO for AccessToken objects. No Permission checking in DAO- Since:
- 6.10
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
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 name-
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
-
-
-
-
Method Detail
-
findByTokenId
@NotNull @NotNull Optional<MutableAccessToken> findByTokenId(String tokenId)
- Parameters:
tokenId
-- Returns:
- Optional with token if exists, otherwise
Optional.empty()
-
findByUserName
@NotNull @NotNull List<MutableAccessToken> findByUserName(String userName)
Get all user's tokens- Parameters:
userName
-- Returns:
- tokens
-
deleteByUserName
void deleteByUserName(String userName)
Delete all user's tokens- Parameters:
userName
-
-
countByUserName
long countByUserName(String userName)
- 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
long scrollTokensForExport(Consumer<MutableAccessToken> exportXmlConsumer)
Scroll through all AccessToken records and pass them to consumer
-
countTokensWithPermission
long countTokensWithPermission(@NotNull @NotNull AccessTokenPermission accessTokenPermission)
Count number of access tokens with given permission- Parameters:
accessTokenPermission
-- Returns:
-
-