com.atlassian.jira.user
Class DefaultSecureUserTokenManager

java.lang.Object
  extended by com.atlassian.jira.user.DefaultSecureUserTokenManager
All Implemented Interfaces:
SecureUserTokenManager

public class DefaultSecureUserTokenManager
extends Object
implements SecureUserTokenManager

See Also:
SecureUserTokenManager} for details

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.user.SecureUserTokenManager
SecureUserTokenManager.TokenType
 
Constructor Summary
DefaultSecureUserTokenManager(com.atlassian.cache.CacheManager cacheManager)
           
 
Method Summary
 String generateToken(com.atlassian.crowd.embedded.api.User user, SecureUserTokenManager.TokenType tokenType)
          Given a user and tokentype this method creates a new secure token and returns this token.
 void onClearCache(ClearCacheEvent event)
           
 com.atlassian.crowd.embedded.api.User 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSecureUserTokenManager

public DefaultSecureUserTokenManager(com.atlassian.cache.CacheManager cacheManager)
Method Detail

generateToken

public String generateToken(com.atlassian.crowd.embedded.api.User user,
                            SecureUserTokenManager.TokenType tokenType)
Description copied from interface: SecureUserTokenManager
Given 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:
generateToken in interface SecureUserTokenManager
Parameters:
user - The user this token is for
tokenType - The SecureUserTokenManager.TokenType for this token
Returns:
A new token or null if no user was provided

useToken

public com.atlassian.crowd.embedded.api.User useToken(String token,
                                                      SecureUserTokenManager.TokenType tokenType)
Description copied from interface: SecureUserTokenManager
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.

Specified by:
useToken in interface SecureUserTokenManager
Parameters:
token - A secure token
tokenType - The SecureUserTokenManager.TokenType for this token
Returns:
The User mapped to this token, or null if no mapping can be found.

onClearCache

@EventListener
public void onClearCache(ClearCacheEvent event)


Copyright © 2002-2014 Atlassian. All Rights Reserved.