org.springframework.security.oauth.provider.token
Class InMemoryProviderTokenServices

java.lang.Object
  extended by org.springframework.security.oauth.provider.token.RandomValueProviderTokenServices
      extended by org.springframework.security.oauth.provider.token.InMemoryProviderTokenServices
All Implemented Interfaces:
InitializingBean, OAuthProviderTokenServices, OAuthTokenLifecycleRegistry
Direct Known Subclasses:
InMemorySelfCleaningProviderTokenServices

public class InMemoryProviderTokenServices
extends RandomValueProviderTokenServices

Implementation of TokenServices that stores tokens in memory.

Author:
Ryan Heaton

Field Summary
protected  ConcurrentHashMap<String,OAuthProviderTokenImpl> tokenStore
           
 
Constructor Summary
InMemoryProviderTokenServices()
           
 
Method Summary
protected  OAuthProviderTokenImpl readToken(String token)
          Read a token from persistence.
protected  OAuthProviderTokenImpl removeToken(String tokenValue)
          Remove a token from persistence.
protected  void storeToken(String tokenValue, OAuthProviderTokenImpl token)
          Store a token from persistence.
 
Methods inherited from class org.springframework.security.oauth.provider.token.RandomValueProviderTokenServices
afterPropertiesSet, authorizeRequestToken, createAccessToken, createUnauthorizedRequestToken, getAccessTokenValiditySeconds, getLifecycleListeners, getRandom, getRequestTokenValiditySeconds, getToken, getTokenSecretLengthBytes, isExpired, onTokenCreated, onTokenRemoved, register, setAccessTokenValiditySeconds, setRandom, setRequestTokenValiditySeconds, setTokenSecretLengthBytes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tokenStore

protected final ConcurrentHashMap<String,OAuthProviderTokenImpl> tokenStore
Constructor Detail

InMemoryProviderTokenServices

public InMemoryProviderTokenServices()
Method Detail

readToken

protected OAuthProviderTokenImpl readToken(String token)
Description copied from class: RandomValueProviderTokenServices
Read a token from persistence.

Specified by:
readToken in class RandomValueProviderTokenServices
Parameters:
token - The token to read.
Returns:
The token, or null if the token doesn't exist.

storeToken

protected void storeToken(String tokenValue,
                          OAuthProviderTokenImpl token)
Description copied from class: RandomValueProviderTokenServices
Store a token from persistence.

Specified by:
storeToken in class RandomValueProviderTokenServices
Parameters:
tokenValue - The token value.
token - The token to store.

removeToken

protected OAuthProviderTokenImpl removeToken(String tokenValue)
Description copied from class: RandomValueProviderTokenServices
Remove a token from persistence.

Specified by:
removeToken in class RandomValueProviderTokenServices
Parameters:
tokenValue - The token to remove.
Returns:
The token that was removed.


Copyright © 2012. All Rights Reserved.