org.springframework.security.oauth2.common
类 DefaultOAuth2AccessToken

java.lang.Object
  继承者 org.springframework.security.oauth2.common.DefaultOAuth2AccessToken
所有已实现的接口:
Serializable, OAuth2AccessToken

public class DefaultOAuth2AccessToken
extends Object
implements Serializable, OAuth2AccessToken

Basic access token for OAuth 2.

作者:
Ryan Heaton, Dave Syer, Rob Winch
另请参见:
序列化表格

字段摘要
 
从接口 org.springframework.security.oauth2.common.OAuth2AccessToken 继承的字段
ACCESS_TOKEN, BEARER_TYPE, EXPIRES_IN, OAUTH2_TYPE, REFRESH_TOKEN, SCOPE, TOKEN_TYPE
 
构造方法摘要
DefaultOAuth2AccessToken(OAuth2AccessToken accessToken)
          Copy constructor for access token.
DefaultOAuth2AccessToken(String value)
          Create an access token from the value provided.
 
方法摘要
 boolean equals(Object obj)
           
 Map<String,Object> getAdditionalInformation()
          Additional information that token granters would like to add to the token, e.g. to support new token types.
 Date getExpiration()
          The instant the token expires.
 int getExpiresIn()
           
 OAuth2RefreshToken getRefreshToken()
          The refresh token associated with the access token, if any.
 Set<String> getScope()
          The scope of the token.
 String getTokenType()
          The token type, as introduced in draft 11 of the OAuth 2 spec.
 String getValue()
          The token value.
 int hashCode()
           
 boolean isExpired()
          Convenience method for checking expiration
 void setAdditionalInformation(Map<String,Object> additionalInformation)
          Additional information that token granters would like to add to the token, e.g. to support new token types.
 void setExpiration(Date expiration)
          The instant the token expires.
protected  void setExpiresIn(int delta)
           
 void setRefreshToken(OAuth2RefreshToken refreshToken)
          The refresh token associated with the access token, if any.
 void setScope(Set<String> scope)
          The scope of the token.
 void setTokenType(String tokenType)
          The token type, as introduced in draft 11 of the OAuth 2 spec.
 DefaultOAuth2AccessToken setValue(String value)
           
 String toString()
           
static OAuth2AccessToken valueOf(Map<String,String> tokenParams)
           
 
从类 java.lang.Object 继承的方法
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

DefaultOAuth2AccessToken

public DefaultOAuth2AccessToken(String value)
Create an access token from the value provided.


DefaultOAuth2AccessToken

public DefaultOAuth2AccessToken(OAuth2AccessToken accessToken)
Copy constructor for access token.

参数:
accessToken -
方法详细信息

setValue

public DefaultOAuth2AccessToken setValue(String value)

getValue

public String getValue()
The token value.

指定者:
接口 OAuth2AccessToken 中的 getValue
返回:
The token value.

getExpiresIn

public int getExpiresIn()
指定者:
接口 OAuth2AccessToken 中的 getExpiresIn

setExpiresIn

protected void setExpiresIn(int delta)

getExpiration

public Date getExpiration()
The instant the token expires.

指定者:
接口 OAuth2AccessToken 中的 getExpiration
返回:
The instant the token expires.

setExpiration

public void setExpiration(Date expiration)
The instant the token expires.

参数:
expiration - The instant the token expires.

isExpired

public boolean isExpired()
Convenience method for checking expiration

指定者:
接口 OAuth2AccessToken 中的 isExpired
返回:
true if the expiration is befor ethe current time

getTokenType

public String getTokenType()
The token type, as introduced in draft 11 of the OAuth 2 spec. The spec doesn't define (yet) that the valid token types are, but says it's required so the default will just be "undefined".

指定者:
接口 OAuth2AccessToken 中的 getTokenType
返回:
The token type, as introduced in draft 11 of the OAuth 2 spec.

setTokenType

public void setTokenType(String tokenType)
The token type, as introduced in draft 11 of the OAuth 2 spec.

参数:
tokenType - The token type, as introduced in draft 11 of the OAuth 2 spec.

getRefreshToken

public OAuth2RefreshToken getRefreshToken()
The refresh token associated with the access token, if any.

指定者:
接口 OAuth2AccessToken 中的 getRefreshToken
返回:
The refresh token associated with the access token, if any.

setRefreshToken

public void setRefreshToken(OAuth2RefreshToken refreshToken)
The refresh token associated with the access token, if any.

参数:
refreshToken - The refresh token associated with the access token, if any.

getScope

public Set<String> getScope()
The scope of the token.

指定者:
接口 OAuth2AccessToken 中的 getScope
返回:
The scope of the token.

setScope

public void setScope(Set<String> scope)
The scope of the token.

参数:
scope - The scope of the token.

equals

public boolean equals(Object obj)
覆盖:
Object 中的 equals

hashCode

public int hashCode()
覆盖:
Object 中的 hashCode

toString

public String toString()
覆盖:
Object 中的 toString

valueOf

public static OAuth2AccessToken valueOf(Map<String,String> tokenParams)

getAdditionalInformation

public Map<String,Object> getAdditionalInformation()
Additional information that token granters would like to add to the token, e.g. to support new token types.

指定者:
接口 OAuth2AccessToken 中的 getAdditionalInformation
返回:
the additional information (default empty)

setAdditionalInformation

public void setAdditionalInformation(Map<String,Object> additionalInformation)
Additional information that token granters would like to add to the token, e.g. to support new token types. If the values in the map are primitive then remote communication is going to always work. It should also be safe to use maps (nested if desired), or something that is explicitly serializable by Jackson.

参数:
additionalInformation - the additional information to set


Copyright © 2013. All rights reserved.