Package com.atlassian.confluence.user
Class DefaultUserVerificationTokenManager
- java.lang.Object
-
- com.atlassian.confluence.user.DefaultUserVerificationTokenManager
-
- All Implemented Interfaces:
UserVerificationTokenManager
public class DefaultUserVerificationTokenManager extends Object implements UserVerificationTokenManager
-
-
Constructor Summary
Constructors Constructor Description DefaultUserVerificationTokenManager(UserVerificationTokenDao tokenStore, com.atlassian.core.util.Clock clock)
Deprecated.since 8.1.2DefaultUserVerificationTokenManager(UserVerificationTokenDao tokenStore, com.atlassian.core.util.Clock clock, com.atlassian.security.random.SecureTokenGenerator secureTokenGenerator)
Deprecated.since 8.1.2DefaultUserVerificationTokenManager(UserVerificationTokenDao tokenStore, com.atlassian.core.util.Clock clock, com.atlassian.security.random.SecureTokenGenerator secureTokenGenerator, com.atlassian.event.api.EventPublisher eventPublisher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
clearAllExpiredTokens()
void
clearToken(String userName)
Clear the token regardless of the token typevoid
clearToken(String userName, UserVerificationTokenType tokenType)
String
generateAndSaveToken(String userName, UserVerificationTokenType tokenType)
boolean
hasOutdatedUserToken(String userName, UserVerificationTokenType tokenType)
boolean
hasToken(String userName, UserVerificationTokenType tokenType)
boolean
hasValidUserToken(String userName, UserVerificationTokenType tokenType, String token)
boolean
isFresh(UserVerificationToken token)
Check if the token is fresh
-
-
-
Constructor Detail
-
DefaultUserVerificationTokenManager
@Deprecated public DefaultUserVerificationTokenManager(UserVerificationTokenDao tokenStore, com.atlassian.core.util.Clock clock)
Deprecated.since 8.1.2
-
DefaultUserVerificationTokenManager
@Deprecated public DefaultUserVerificationTokenManager(UserVerificationTokenDao tokenStore, com.atlassian.core.util.Clock clock, com.atlassian.security.random.SecureTokenGenerator secureTokenGenerator)
Deprecated.since 8.1.2
-
DefaultUserVerificationTokenManager
public DefaultUserVerificationTokenManager(UserVerificationTokenDao tokenStore, com.atlassian.core.util.Clock clock, com.atlassian.security.random.SecureTokenGenerator secureTokenGenerator, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Detail
-
generateAndSaveToken
public String generateAndSaveToken(String userName, UserVerificationTokenType tokenType)
- Specified by:
generateAndSaveToken
in interfaceUserVerificationTokenManager
-
hasToken
public boolean hasToken(String userName, UserVerificationTokenType tokenType)
- Specified by:
hasToken
in interfaceUserVerificationTokenManager
-
hasValidUserToken
public boolean hasValidUserToken(String userName, UserVerificationTokenType tokenType, String token)
- Specified by:
hasValidUserToken
in interfaceUserVerificationTokenManager
-
hasOutdatedUserToken
public boolean hasOutdatedUserToken(String userName, UserVerificationTokenType tokenType)
- Specified by:
hasOutdatedUserToken
in interfaceUserVerificationTokenManager
-
isFresh
public boolean isFresh(UserVerificationToken token)
Description copied from interface:UserVerificationTokenManager
Check if the token is fresh- Specified by:
isFresh
in interfaceUserVerificationTokenManager
- Parameters:
token
- the token to be checked against- Returns:
- true if the token is not expired
-
clearToken
public void clearToken(String userName, UserVerificationTokenType tokenType)
- Specified by:
clearToken
in interfaceUserVerificationTokenManager
-
clearToken
public void clearToken(String userName)
Description copied from interface:UserVerificationTokenManager
Clear the token regardless of the token type- Specified by:
clearToken
in interfaceUserVerificationTokenManager
- Parameters:
userName
- the token associated to the username
-
clearAllExpiredTokens
public int clearAllExpiredTokens()
- Specified by:
clearAllExpiredTokens
in interfaceUserVerificationTokenManager
- Returns:
- the number of expired tokens that have been cleared
-
-