com.google.api.client.auth.oauth
Class AbstractOAuthGetToken

java.lang.Object
  extended by java.util.AbstractMap<String,Object>
      extended by com.google.api.client.util.GenericData
          extended by com.google.api.client.http.GenericUrl
              extended by com.google.api.client.auth.oauth.AbstractOAuthGetToken
All Implemented Interfaces:
Cloneable, Map<String,Object>
Direct Known Subclasses:
OAuthGetAccessToken, OAuthGetTemporaryToken

public abstract class AbstractOAuthGetToken
extends GenericUrl

Generic OAuth 1.0a URL to request a temporary or long-lived token from an authorization server.

Since:
1.0
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>
 
Field Summary
 String consumerKey
          Required identifier portion of the client credentials (equivalent to a username).
 OAuthSigner signer
          Required OAuth signature algorithm.
 HttpTransport transport
          HTTP transport required for executing request in execute().
protected  boolean usePost
          true for POST request or the default false for GET request.
 
Fields inherited from class com.google.api.client.http.GenericUrl
fragment, host, pathParts, port, scheme
 
Fields inherited from class com.google.api.client.util.GenericData
unknownFields
 
Constructor Summary
protected AbstractOAuthGetToken(String authorizationServerUrl)
           
 
Method Summary
 OAuthParameters createParameters()
          Returns a new instance of the OAuth authentication provider.
 OAuthCredentialsResponse execute()
          Executes the HTTP request for a temporary or long-lived token.
 
Methods inherited from class com.google.api.client.http.GenericUrl
appendRawPath, build, clone, equals, getAll, getFirst, getRawPath, hashCode, setRawPath, toPathParts, toString
 
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, put, putAll, remove, set
 
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

transport

public HttpTransport transport
HTTP transport required for executing request in execute().

Since:
1.3

consumerKey

public String consumerKey
Required identifier portion of the client credentials (equivalent to a username).


signer

public OAuthSigner signer
Required OAuth signature algorithm.


usePost

protected boolean usePost
true for POST request or the default false for GET request.

Constructor Detail

AbstractOAuthGetToken

protected AbstractOAuthGetToken(String authorizationServerUrl)
Parameters:
authorizationServerUrl - encoded authorization server URL
Method Detail

execute

public final OAuthCredentialsResponse execute()
                                       throws IOException
Executes the HTTP request for a temporary or long-lived token.

Returns:
OAuth credentials response object
Throws:
HttpResponseException - for an HTTP error code
IOException - I/O exception

createParameters

public OAuthParameters createParameters()
Returns a new instance of the OAuth authentication provider. Subclasses may override by calling this super implementation and then adding OAuth parameters.



Copyright © 2010-2011 Google. All Rights Reserved.