Package com.atlassian.jira.user
Class DefaultSecureUserTokenManager
java.lang.Object
com.atlassian.jira.user.DefaultSecureUserTokenManager
- All Implemented Interfaces:
InitializingComponent,SecureUserTokenManager
public class DefaultSecureUserTokenManager
extends Object
implements SecureUserTokenManager, InitializingComponent
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.jira.user.SecureUserTokenManager
SecureUserTokenManager.TokenType -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSecureUserTokenManager(com.atlassian.cache.CacheManager cacheManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after all the beans are constructed and the ApplicationContext is fully populated.generateToken(ApplicationUser user, SecureUserTokenManager.TokenType tokenType) Given a user and tokentype this method creates a new secure token and returns this token.voidonClearCache(ClearCacheEvent event) useToken(String token, SecureUserTokenManager.TokenType tokenType) Given a token and tokenType, this method returns the User that was mapped to this token and then revokes the token to ensure it can't be used again.
-
Constructor Details
-
DefaultSecureUserTokenManager
public DefaultSecureUserTokenManager(com.atlassian.cache.CacheManager cacheManager)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponentCalled after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiationin interfaceInitializingComponent- Throws:
Exception
-
generateToken
Description copied from interface:SecureUserTokenManagerGiven a user and tokentype this method creates a new secure token and returns this token. A particular user can have multiple tokens mapped at any given time.- Specified by:
generateTokenin interfaceSecureUserTokenManager- Parameters:
user- The user this token is fortokenType- TheSecureUserTokenManager.TokenTypefor this token- Returns:
- A new token or null if no user was provided
-
useToken
Description copied from interface:SecureUserTokenManagerGiven a token and tokenType, this method returns the User that was mapped to this token and then revokes the token to ensure it can't be used again.- Specified by:
useTokenin interfaceSecureUserTokenManager- Parameters:
token- A secure tokentokenType- TheSecureUserTokenManager.TokenTypefor this token- Returns:
- The User mapped to this token, or null if no mapping can be found.
-
onClearCache
-