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

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

public class InMemorySelfCleaningProviderTokenServices
extends InMemoryProviderTokenServices
implements DisposableBean

Implementation of TokenServices that stores tokens in memory. The token services will schedule a thread to do cleaning up of expired tokens.

Author:
Ryan Heaton

Field Summary
 
Fields inherited from class org.springframework.security.oauth.provider.token.InMemoryProviderTokenServices
tokenStore
 
Constructor Summary
InMemorySelfCleaningProviderTokenServices()
           
 
Method Summary
 void afterPropertiesSet()
          Initialze these token services.
 void destroy()
           
 Integer getCleanupIntervalSeconds()
          The interval at which to schedule cleanup.
 void setCleanupIntervalSeconds(Integer cleanupIntervalSeconds)
          The interval at which to schedule cleanup.
 
Methods inherited from class org.springframework.security.oauth.provider.token.InMemoryProviderTokenServices
readToken, removeToken, storeToken
 
Methods inherited from class org.springframework.security.oauth.provider.token.RandomValueProviderTokenServices
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
 

Constructor Detail

InMemorySelfCleaningProviderTokenServices

public InMemorySelfCleaningProviderTokenServices()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Description copied from class: RandomValueProviderTokenServices
Initialze these token services. If no random generator is set, one will be created.

Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class RandomValueProviderTokenServices
Throws:
Exception

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface DisposableBean
Throws:
Exception

getCleanupIntervalSeconds

public Integer getCleanupIntervalSeconds()
The interval at which to schedule cleanup. (<= 0 for never).

Returns:
The interval at which to schedule cleanup.

setCleanupIntervalSeconds

public void setCleanupIntervalSeconds(Integer cleanupIntervalSeconds)
The interval at which to schedule cleanup.

Parameters:
cleanupIntervalSeconds - The interval at which to schedule cleanup.


Copyright © 2012. All Rights Reserved.