BaseApiService.AbstractBuilder

public static abstract class BaseApiService.AbstractBuilder extends Object
Known Direct Subclasses

Builder object for creating an instance of BaseApiService.

Field Summary

protected BatchPolicy batchPolicy
protected CredentialFactory credentialFactory
protected GoogleProxy googleProxy
protected JsonFactory jsonFactory
protected HttpRequestInitializer requestInitializer
protected HttpRequestInitializer requestTimeoutInitializer
protected RetryPolicy retryPolicy
protected String rootUrl
protected T extends AbstractGoogleJsonClient service
protected HttpTransport transport

Public Constructor Summary

Public Method Summary

abstract BaseApiService<T>
build()
Get instance of BaseApiService implementation.
abstract Set<String>
getApiScopes()
Get scopes to be used while making Google API requests.
abstract AbstractGoogleJsonClient.Builder
getServiceBuilder(HttpTransport transport, JsonFactory jsonFactory, HttpRequestInitializer requestInitializer)
abstract B
getThis()
Get current builder instance.
B
setBatchPolicy(BatchPolicy batchPolicy)
Sets BatchPolicy to be used for request batching.
B
setCredentialFactory(CredentialFactory credentialFactory)
Sets CredentialFactory to be used to obtained credentials while making Google API requests.
B
setJsonFactory(JsonFactory jsonFactory)
Sets JsonFactory instance to be used for constructing AbstractGoogleJsonClient.
B
setProxy(GoogleProxy proxy)
Sets instance of GoogleProxy to be used for creating an instance of AbstractGoogleJsonClient.
B
setRequestInitializer(HttpRequestInitializer requestInitializer)
Sets an instance of HttpRequestInitializer to be used to initialize each Google API request.
B
setRequestTimeout(int connectTimeoutSeconds, int readTimeoutSeconds)
Sets request timeouts for making Google API requests.
B
setRetryPolicy(RetryPolicy retryPolicy)
Sets request RetryPolicy to be used for making Google API request.
B
setRootUrl(String rootUrl)
Sets root URL for Google API client as set on setRootUrl(String)
B
setService(T service)
Sets pre-built instance of AbstractGoogleJsonClient.
B
setTransport(HttpTransport transport)
Sets instance of HttpTransport to be used for creating an instance of AbstractGoogleJsonClient.

Protected Method Summary

GoogleCredential

Inherited Method Summary

Fields

protected BatchPolicy batchPolicy

protected CredentialFactory credentialFactory

protected GoogleProxy googleProxy

protected JsonFactory jsonFactory

protected HttpRequestInitializer requestInitializer

protected HttpRequestInitializer requestTimeoutInitializer

protected RetryPolicy retryPolicy

protected String rootUrl

protected T extends AbstractGoogleJsonClient service

protected HttpTransport transport

Public Constructors

public BaseApiService.AbstractBuilder ()

Public Methods

public abstract BaseApiService<T> build ()

Get instance of BaseApiService implementation. Implementation should call setupServiceAndCredentials() as part of build implementation.

Returns
Throws
GeneralSecurityException
IOException

public abstract Set<String> getApiScopes ()

Get scopes to be used while making Google API requests.

Returns
  • set of scopes to be used.

public abstract AbstractGoogleJsonClient.Builder getServiceBuilder (HttpTransport transport, JsonFactory jsonFactory, HttpRequestInitializer requestInitializer)

Parameters
transport HttpTranport to be used for creating AbstractGoogleJsonClient
jsonFactory JsonFactory to be used for creating AbstractGoogleJsonClient
requestInitializer HttpRequestInitializer to be used for creating AbstractGoogleJsonClient
Returns

public abstract B getThis ()

Get current builder instance.

Returns
  • current builder instance

public B setBatchPolicy (BatchPolicy batchPolicy)

Sets BatchPolicy to be used for request batching.

Parameters
batchPolicy BatchPolicy to be used for request batching.
Returns
  • this Builder instance

public B setCredentialFactory (CredentialFactory credentialFactory)

Sets CredentialFactory to be used to obtained credentials while making Google API requests.

Parameters
credentialFactory CredentialFactory to be used
Returns
  • this Builder instance

public B setJsonFactory (JsonFactory jsonFactory)

Sets JsonFactory instance to be used for constructing AbstractGoogleJsonClient.

Parameters
jsonFactory JsonFactory instance to be used
Returns
  • this Builder instance

public B setProxy (GoogleProxy proxy)

Sets instance of GoogleProxy to be used for creating an instance of AbstractGoogleJsonClient.

Parameters
proxy GoogleProxy to be used for creating an instance of AbstractGoogleJsonClient
Returns
  • this Builder instance

public B setRequestInitializer (HttpRequestInitializer requestInitializer)

Sets an instance of HttpRequestInitializer to be used to initialize each Google API request.

Parameters
requestInitializer instance of HttpRequestInitializer to be used
Returns
  • this Builder instance

public B setRequestTimeout (int connectTimeoutSeconds, int readTimeoutSeconds)

Sets request timeouts for making Google API requests.

Parameters
connectTimeoutSeconds socket timeouts in seconds as consumed by setConnectTimeout(int).
readTimeoutSeconds read timeout in seconds as consumed by setReadTimeout(int).
Returns
  • this Builder instance

public B setRetryPolicy (RetryPolicy retryPolicy)

Sets request RetryPolicy to be used for making Google API request.

Parameters
retryPolicy RetryPolicy to be used for making Google API request.
Returns
  • this Builder instance

public B setRootUrl (String rootUrl)

Sets root URL for Google API client as set on setRootUrl(String)

Parameters
rootUrl root URL for Google API client
Returns
  • this Builder instance

public B setService (T service)

Sets pre-built instance of AbstractGoogleJsonClient.

Parameters
service pre-built instance of AbstractGoogleJsonClient.
Returns
  • this Builder instance

public B setTransport (HttpTransport transport)

Sets instance of HttpTransport to be used for creating an instance of AbstractGoogleJsonClient.

Parameters
transport HttpTransport to be used for creating an instance of AbstractGoogleJsonClient
Returns
  • this Builder instance

Protected Methods

protected GoogleCredential setupServiceAndCredentials ()

Throws
GeneralSecurityException
IOException

Send feedback about...

Cloud Search
Cloud Search