com.google.api.client.auth.oauth2
Class AuthorizationCodeFlow.Builder

java.lang.Object
  extended by com.google.api.client.auth.oauth2.AuthorizationCodeFlow.Builder
Enclosing class:
AuthorizationCodeFlow

public static class AuthorizationCodeFlow.Builder
extends Object

Authorization code flow builder.

Implementation is not thread-safe.


Constructor Summary
AuthorizationCodeFlow.Builder(Credential.AccessMethod method, HttpTransport transport, JsonFactory jsonFactory, GenericUrl tokenServerUrl, HttpExecuteInterceptor clientAuthentication, String clientId, String authorizationServerEncodedUrl)
           
 
Method Summary
 AuthorizationCodeFlow build()
          Returns a new instance of an authorization code flow based on this builder.
 String getAuthorizationServerEncodedUrl()
          Returns the authorization server encoded URL.
 HttpExecuteInterceptor getClientAuthentication()
          Returns the client authentication or null for none (see TokenRequest.setClientAuthentication(HttpExecuteInterceptor)).
 String getClientId()
          Returns the client identifier.
 CredentialStore getCredentialStore()
          Returns the credential persistence store or null for none.
 JsonFactory getJsonFactory()
          Returns the JSON factory.
 Credential.AccessMethod getMethod()
          Returns the method of presenting the access token to the resource server (for example BearerToken.authorizationHeaderAccessMethod()).
 HttpRequestInitializer getRequestInitializer()
          Returns the HTTP request initializer or null for none.
 String getScopes()
          Returns the space-separated list of scopes or null for none.
 GenericUrl getTokenServerUrl()
          Returns the token server URL.
 HttpTransport getTransport()
          Returns the HTTP transport.
 AuthorizationCodeFlow.Builder setCredentialStore(CredentialStore credentialStore)
          Sets the credential persistence store or null for none.
 AuthorizationCodeFlow.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
          Sets the HTTP request initializer or null for none.
 AuthorizationCodeFlow.Builder setScopes(Iterable<String> scopes)
          Sets the list of scopes or null for none.
 AuthorizationCodeFlow.Builder setScopes(String... scopes)
          Sets the list of scopes or null for none.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorizationCodeFlow.Builder

public AuthorizationCodeFlow.Builder(Credential.AccessMethod method,
                                     HttpTransport transport,
                                     JsonFactory jsonFactory,
                                     GenericUrl tokenServerUrl,
                                     HttpExecuteInterceptor clientAuthentication,
                                     String clientId,
                                     String authorizationServerEncodedUrl)
Parameters:
method - method of presenting the access token to the resource server (for example BearerToken.authorizationHeaderAccessMethod())
transport - HTTP transport
jsonFactory - JSON factory
tokenServerUrl - token server URL
clientAuthentication - client authentication or null for none (see TokenRequest.setClientAuthentication(HttpExecuteInterceptor))
clientId - client identifier
authorizationServerEncodedUrl - authorization server encoded URL
Method Detail

build

public AuthorizationCodeFlow build()
Returns a new instance of an authorization code flow based on this builder.


getMethod

public final Credential.AccessMethod getMethod()
Returns the method of presenting the access token to the resource server (for example BearerToken.authorizationHeaderAccessMethod()).


getTransport

public final HttpTransport getTransport()
Returns the HTTP transport.


getJsonFactory

public final JsonFactory getJsonFactory()
Returns the JSON factory.


getTokenServerUrl

public final GenericUrl getTokenServerUrl()
Returns the token server URL.


getClientAuthentication

public final HttpExecuteInterceptor getClientAuthentication()
Returns the client authentication or null for none (see TokenRequest.setClientAuthentication(HttpExecuteInterceptor)).


getClientId

public final String getClientId()
Returns the client identifier.


getAuthorizationServerEncodedUrl

public final String getAuthorizationServerEncodedUrl()
Returns the authorization server encoded URL.


getCredentialStore

public final CredentialStore getCredentialStore()
Returns the credential persistence store or null for none.


setCredentialStore

public AuthorizationCodeFlow.Builder setCredentialStore(CredentialStore credentialStore)
Sets the credential persistence store or null for none.

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


getRequestInitializer

public final HttpRequestInitializer getRequestInitializer()
Returns the HTTP request initializer or null for none.


setRequestInitializer

public AuthorizationCodeFlow.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
Sets the HTTP request initializer or null for none.

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


setScopes

public AuthorizationCodeFlow.Builder setScopes(Iterable<String> scopes)
Sets the list of scopes or null for none.

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

Parameters:
scopes - list of scopes to be joined by a space separator (or a single value containing multiple space-separated scopes)

setScopes

public AuthorizationCodeFlow.Builder setScopes(String... scopes)
Sets the list of scopes or null for none.

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

Parameters:
scopes - list of scopes to be joined by a space separator (or a single value containing multiple space-separated scopes)

getScopes

public final String getScopes()
Returns the space-separated list of scopes or null for none.



Copyright © 2011-2012 Google. All Rights Reserved.