org.springframework.security.oauth2.provider.token
类 InMemoryTokenStore

java.lang.Object
  继承者 org.springframework.security.oauth2.provider.token.InMemoryTokenStore
所有已实现的接口:
TokenStore

public class InMemoryTokenStore
extends Object
implements TokenStore

Implementation of token services that stores tokens in memory.

作者:
Ryan Heaton, Luke Taylor, Dave Syer

构造方法摘要
InMemoryTokenStore()
           
 
方法摘要
 void clear()
          Convenience method for super admin users to remove all tokens (useful for testing, not really in production)
 Collection<OAuth2AccessToken> findTokensByClientId(String clientId)
           
 Collection<OAuth2AccessToken> findTokensByUserName(String userName)
           
 OAuth2AccessToken getAccessToken(OAuth2Authentication authentication)
          Retrieve an access token stored against the provided authentication key, if it exists.
 int getAccessTokenCount()
           
 int getExpiryTokenCount()
           
 int getFlushInterval()
          The interval (count of token inserts) between flushing expired tokens.
 int getRefreshTokenCount()
           
 OAuth2AccessToken readAccessToken(String tokenValue)
          Read an access token from the store.
 OAuth2Authentication readAuthentication(OAuth2AccessToken token)
          Read the authentication stored under the specified token value.
 OAuth2Authentication readAuthentication(String token)
          Read the authentication stored under the specified token value.
 OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token)
           
 OAuth2Authentication readAuthenticationForRefreshToken(String token)
           
 OAuth2RefreshToken readRefreshToken(String tokenValue)
          Read a refresh token from the store.
 void removeAccessToken(OAuth2AccessToken accessToken)
          Remove an access token from the database.
 void removeAccessToken(String tokenValue)
           
 void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken)
          Remove an access token using a refresh token.
 void removeRefreshToken(OAuth2RefreshToken refreshToken)
          Remove a refresh token from the database.
 void removeRefreshToken(String tokenValue)
           
 void setAuthenticationKeyGenerator(AuthenticationKeyGenerator authenticationKeyGenerator)
           
 void setFlushInterval(int flushInterval)
          The number of tokens to store before flushing expired tokens.
 void storeAccessToken(OAuth2AccessToken token, OAuth2Authentication authentication)
          Store an access token.
 void storeRefreshToken(OAuth2RefreshToken refreshToken, OAuth2Authentication authentication)
          Store the specified refresh token in the database.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

InMemoryTokenStore

public InMemoryTokenStore()
方法详细信息

setFlushInterval

public void setFlushInterval(int flushInterval)
The number of tokens to store before flushing expired tokens. Defaults to 1000.

参数:
flushInterval - the interval to set

getFlushInterval

public int getFlushInterval()
The interval (count of token inserts) between flushing expired tokens.

返回:
the flushInterval the flush interval

clear

public void clear()
Convenience method for super admin users to remove all tokens (useful for testing, not really in production)


setAuthenticationKeyGenerator

public void setAuthenticationKeyGenerator(AuthenticationKeyGenerator authenticationKeyGenerator)

getAccessTokenCount

public int getAccessTokenCount()

getRefreshTokenCount

public int getRefreshTokenCount()

getExpiryTokenCount

public int getExpiryTokenCount()

getAccessToken

public OAuth2AccessToken getAccessToken(OAuth2Authentication authentication)
从接口 TokenStore 复制的描述
Retrieve an access token stored against the provided authentication key, if it exists.

指定者:
接口 TokenStore 中的 getAccessToken
参数:
authentication - the authentication key for the access token
返回:
the access token or null if there was none

readAuthentication

public OAuth2Authentication readAuthentication(OAuth2AccessToken token)
从接口 TokenStore 复制的描述
Read the authentication stored under the specified token value.

指定者:
接口 TokenStore 中的 readAuthentication
参数:
token - The token value under which the authentication is stored.
返回:
The authentication, or null if none.

readAuthentication

public OAuth2Authentication readAuthentication(String token)
从接口 TokenStore 复制的描述
Read the authentication stored under the specified token value.

指定者:
接口 TokenStore 中的 readAuthentication
参数:
token - The token value under which the authentication is stored.
返回:
The authentication, or null if none.

readAuthenticationForRefreshToken

public OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token)
指定者:
接口 TokenStore 中的 readAuthenticationForRefreshToken
参数:
token - a refresh token
返回:
the authentication originally used to grant the refresh token

readAuthenticationForRefreshToken

public OAuth2Authentication readAuthenticationForRefreshToken(String token)

storeAccessToken

public void storeAccessToken(OAuth2AccessToken token,
                             OAuth2Authentication authentication)
从接口 TokenStore 复制的描述
Store an access token.

指定者:
接口 TokenStore 中的 storeAccessToken
参数:
token - The token to store.
authentication - The authentication associated with the token.

removeAccessToken

public void removeAccessToken(OAuth2AccessToken accessToken)
从接口 TokenStore 复制的描述
Remove an access token from the database.

指定者:
接口 TokenStore 中的 removeAccessToken
参数:
accessToken - The token to remove from the database.

readAccessToken

public OAuth2AccessToken readAccessToken(String tokenValue)
从接口 TokenStore 复制的描述
Read an access token from the store.

指定者:
接口 TokenStore 中的 readAccessToken
参数:
tokenValue - The token value.
返回:
The access token to read.

removeAccessToken

public void removeAccessToken(String tokenValue)

storeRefreshToken

public void storeRefreshToken(OAuth2RefreshToken refreshToken,
                              OAuth2Authentication authentication)
从接口 TokenStore 复制的描述
Store the specified refresh token in the database.

指定者:
接口 TokenStore 中的 storeRefreshToken
参数:
refreshToken - The refresh token to store.
authentication - The authentication associated with the refresh token.

readRefreshToken

public OAuth2RefreshToken readRefreshToken(String tokenValue)
从接口 TokenStore 复制的描述
Read a refresh token from the store.

指定者:
接口 TokenStore 中的 readRefreshToken
参数:
tokenValue - The value of the token to read.
返回:
The token.

removeRefreshToken

public void removeRefreshToken(OAuth2RefreshToken refreshToken)
从接口 TokenStore 复制的描述
Remove a refresh token from the database.

指定者:
接口 TokenStore 中的 removeRefreshToken
参数:
refreshToken - The token to remove from the database.

removeRefreshToken

public void removeRefreshToken(String tokenValue)

removeAccessTokenUsingRefreshToken

public void removeAccessTokenUsingRefreshToken(OAuth2RefreshToken refreshToken)
从接口 TokenStore 复制的描述
Remove an access token using a refresh token. This functionality is necessary so refresh tokens can't be used to create an unlimited number of access tokens.

指定者:
接口 TokenStore 中的 removeAccessTokenUsingRefreshToken
参数:
refreshToken - The refresh token.

findTokensByClientId

public Collection<OAuth2AccessToken> findTokensByClientId(String clientId)
指定者:
接口 TokenStore 中的 findTokensByClientId
参数:
clientId - the client id
返回:
a collection of access tokens

findTokensByUserName

public Collection<OAuth2AccessToken> findTokensByUserName(String userName)
指定者:
接口 TokenStore 中的 findTokensByUserName
参数:
userName - the user name to search
返回:
a collection of access tokens


Copyright © 2013. All rights reserved.