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

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

public static class Credential.Builder
extends Object

Credential builder.

Implementation is not thread-safe.


Constructor Summary
Credential.Builder(Credential.AccessMethod method)
           
 
Method Summary
 Credential.Builder addRefreshListener(CredentialRefreshListener refreshListener)
          Adds a listener for refresh token results.
 Credential build()
          Returns a new credential instance.
 HttpExecuteInterceptor getClientAuthentication()
          Returns the client authentication or null for none (see TokenRequest.setClientAuthentication(HttpExecuteInterceptor)).
 JsonFactory getJsonFactory()
          Returns the JSON factory to use for parsing response for refresh token request or null if not refreshing tokens.
 Credential.AccessMethod getMethod()
          Returns the method of presenting the access token to the resource server (for example BearerToken.AuthorizationHeaderAccessMethod).
 List<CredentialRefreshListener> getRefreshListeners()
          Returns the listeners for refresh token results or null for none.
 HttpRequestInitializer getRequestInitializer()
          Returns the HTTP request initializer for refresh token requests to the token server or null for none.
 GenericUrl getTokenServerUrl()
          Returns the token server URL or null if not refreshing tokens.
 HttpTransport getTransport()
          Returns the HTTP transport for executing refresh token request or null if not refreshing tokens.
 Credential.Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
          Sets the client authentication or null for none (see TokenRequest.setClientAuthentication(HttpExecuteInterceptor)).
 Credential.Builder setJsonFactory(JsonFactory jsonFactory)
          Sets the JSON factory to use for parsing response for refresh token request or null if not refreshing tokens.
 Credential.Builder setRefreshListeners(List<CredentialRefreshListener> refreshListeners)
          Sets the listeners for refresh token results or null for none.
 Credential.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
          Sets the HTTP request initializer for refresh token requests to the token server or null for none.
 Credential.Builder setTokenServerEncodedUrl(String tokenServerEncodedUrl)
          Sets the encoded token server URL or null if not refreshing tokens.
 Credential.Builder setTokenServerUrl(GenericUrl tokenServerUrl)
          Sets the token server URL or null if not refreshing tokens.
 Credential.Builder setTransport(HttpTransport transport)
          Sets the HTTP transport for executing refresh token request or null if not refreshing tokens.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Credential.Builder

public Credential.Builder(Credential.AccessMethod method)
Parameters:
method - method of presenting the access token to the resource server (for example BearerToken.AuthorizationHeaderAccessMethod)
Method Detail

build

public Credential build()
Returns a new credential instance.


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 for executing refresh token request or null if not refreshing tokens.


setTransport

public Credential.Builder setTransport(HttpTransport transport)
Sets the HTTP transport for executing refresh token request or null if not refreshing tokens.

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


getJsonFactory

public final JsonFactory getJsonFactory()
Returns the JSON factory to use for parsing response for refresh token request or null if not refreshing tokens.


setJsonFactory

public Credential.Builder setJsonFactory(JsonFactory jsonFactory)
Sets the JSON factory to use for parsing response for refresh token request or null if not refreshing tokens.

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


getTokenServerUrl

public final GenericUrl getTokenServerUrl()
Returns the token server URL or null if not refreshing tokens.


setTokenServerUrl

public Credential.Builder setTokenServerUrl(GenericUrl tokenServerUrl)
Sets the token server URL or null if not refreshing tokens.

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


setTokenServerEncodedUrl

public Credential.Builder setTokenServerEncodedUrl(String tokenServerEncodedUrl)
Sets the encoded token server URL or null if not refreshing tokens.

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


getClientAuthentication

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


setClientAuthentication

public Credential.Builder setClientAuthentication(HttpExecuteInterceptor clientAuthentication)
Sets the client authentication or null for none (see TokenRequest.setClientAuthentication(HttpExecuteInterceptor)).

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 for refresh token requests to the token server or null for none.


setRequestInitializer

public Credential.Builder setRequestInitializer(HttpRequestInitializer requestInitializer)
Sets the HTTP request initializer for refresh token requests to the token server or null for none.

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


addRefreshListener

public Credential.Builder addRefreshListener(CredentialRefreshListener refreshListener)
Adds a listener for refresh token results.

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

Parameters:
refreshListener - refresh listener

getRefreshListeners

public final List<CredentialRefreshListener> getRefreshListeners()
Returns the listeners for refresh token results or null for none.


setRefreshListeners

public Credential.Builder setRefreshListeners(List<CredentialRefreshListener> refreshListeners)
Sets the listeners for refresh token results 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.