org.springframework.security.oauth2.client.context
Class DefaultOAuth2ClientContext

java.lang.Object
  extended by org.springframework.security.oauth2.client.context.DefaultOAuth2ClientContext
All Implemented Interfaces:
Serializable, OAuth2ClientContext

public class DefaultOAuth2ClientContext
extends Object
implements OAuth2ClientContext, Serializable

The OAuth 2 security context (for a specific user or client or combination thereof).

Author:
Dave Syer
See Also:
Serialized Form

Constructor Summary
DefaultOAuth2ClientContext()
           
DefaultOAuth2ClientContext(AccessTokenRequest accessTokenRequest)
           
DefaultOAuth2ClientContext(OAuth2AccessToken accessToken)
           
 
Method Summary
 OAuth2AccessToken getAccessToken()
           
 AccessTokenRequest getAccessTokenRequest()
           
 Object removePreservedState(String stateKey)
           
 void setAccessToken(OAuth2AccessToken accessToken)
           
 void setPreservedState(String stateKey, Object preservedState)
          Convenience method for saving state in the OAuth2ClientContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultOAuth2ClientContext

public DefaultOAuth2ClientContext()

DefaultOAuth2ClientContext

public DefaultOAuth2ClientContext(AccessTokenRequest accessTokenRequest)

DefaultOAuth2ClientContext

public DefaultOAuth2ClientContext(OAuth2AccessToken accessToken)
Method Detail

getAccessToken

public OAuth2AccessToken getAccessToken()
Specified by:
getAccessToken in interface OAuth2ClientContext
Returns:
the current access token if any (may be null or empty)

setAccessToken

public void setAccessToken(OAuth2AccessToken accessToken)
Specified by:
setAccessToken in interface OAuth2ClientContext
Parameters:
accessToken - the current access token

getAccessTokenRequest

public AccessTokenRequest getAccessTokenRequest()
Specified by:
getAccessTokenRequest in interface OAuth2ClientContext
Returns:
the current request if any (may be null or empty)

setPreservedState

public void setPreservedState(String stateKey,
                              Object preservedState)
Description copied from interface: OAuth2ClientContext
Convenience method for saving state in the OAuth2ClientContext.

Specified by:
setPreservedState in interface OAuth2ClientContext
Parameters:
stateKey - the key to use to save the state
preservedState - the state to be saved

removePreservedState

public Object removePreservedState(String stateKey)
Specified by:
removePreservedState in interface OAuth2ClientContext
Parameters:
stateKey - the state key to lookup
Returns:
the state preserved with this key (if any)


Copyright © 2012. All Rights Reserved.