com.google.api.client.auth.oauth2
Class TokenResponse

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.json.GenericJson
              extended by com.google.api.client.auth.oauth2.TokenResponse
All Implemented Interfaces:
Cloneable, Map<String,Object>
Direct Known Subclasses:
IdTokenResponse

public class TokenResponse
extends GenericJson

OAuth 2.0 JSON model for a successful access token response as specified in Successful Response.

Implementation is not thread-safe.

Since:
1.7
Author:
Yaniv Inbar

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
TokenResponse()
           
 
Method Summary
 String getAccessToken()
          Returns the access token issued by the authorization server.
 Long getExpiresInSeconds()
          Returns the lifetime in seconds of the access token (for example 3600 for an hour) or null for none.
 String getRefreshToken()
          Returns the refresh token which can be used to obtain new access tokens using the same authorization grant or null for none.
 String getScope()
          Returns the scope of the access token or null for none.
 String getTokenType()
          Returns the token type (as specified in Access Token Types).
 TokenResponse setAccessToken(String accessToken)
          Sets the access token issued by the authorization server.
 TokenResponse setExpiresInSeconds(Long expiresInSeconds)
          Sets the lifetime in seconds of the access token (for example 3600 for an hour) or null for none.
 TokenResponse setRefreshToken(String refreshToken)
          Sets the refresh token which can be used to obtain new access tokens using the same authorization grant or null for none.
 TokenResponse setScope(String scope)
          Sets the scope of the access token or null for none.
 TokenResponse setTokenType(String tokenType)
          Sets the token type (as specified in Access Token Types).
 
Methods inherited from class com.google.api.client.json.GenericJson
clone, getFactory, setFactory, toPrettyString, toString
 
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getUnknownKeys, put, putAll, remove, set, setUnknownKeys
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TokenResponse

public TokenResponse()
Method Detail

getAccessToken

public final String getAccessToken()
Returns the access token issued by the authorization server.


setAccessToken

public TokenResponse setAccessToken(String accessToken)
Sets the access token issued by the authorization server.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.


getTokenType

public final String getTokenType()
Returns the token type (as specified in Access Token Types).


setTokenType

public TokenResponse setTokenType(String tokenType)
Sets the token type (as specified in Access Token Types).

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.


getExpiresInSeconds

public final Long getExpiresInSeconds()
Returns the lifetime in seconds of the access token (for example 3600 for an hour) or null for none.


setExpiresInSeconds

public TokenResponse setExpiresInSeconds(Long expiresInSeconds)
Sets the lifetime in seconds of the access token (for example 3600 for an hour) or null for none.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.


getRefreshToken

public final String getRefreshToken()
Returns the refresh token which can be used to obtain new access tokens using the same authorization grant or null for none.


setRefreshToken

public TokenResponse setRefreshToken(String refreshToken)
Sets the refresh token which can be used to obtain new access tokens using the same authorization grant or null for none.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.


getScope

public final String getScope()
Returns the scope of the access token or null for none.


setScope

public TokenResponse setScope(String scope)
Sets the scope of the access token or null for none.

Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.



Copyright © 2011-2012 Google. All Rights Reserved.