BaseApiService

public abstract class BaseApiService extends AbstractIdleService
Known Direct Subclasses

Base object encapsulating common functionality for interacting with Google APIs such as setting credentials, request timeouts, error handling and retry etc.

Nested Class Summary

class BaseApiService.AbstractBuilder<B extends AbstractBuilder<B, T extends AbstractGoogleJsonClient>, T> Builder object for creating an instance of BaseApiService
class BaseApiService.RetryRequestInitializer Adds a backoff and retry response and exception handlers to the HttpRequest

Field Summary

protected final RetryPolicy retryPolicy
protected final T extends AbstractGoogleJsonClient service

Protected Constructor Summary

BaseApiService(AbstractBuilder<? extends AbstractBuilder<?, T>, T> builder)

Protected Method Summary

static <T> T
executeRequest(AbstractGoogleJsonClientRequest<T> request, StatsManager.OperationStats stats, boolean initializeDefaults)
Common execute method for all api requests.

Inherited Method Summary

Fields

protected final RetryPolicy retryPolicy

protected final T extends AbstractGoogleJsonClient service

Protected Constructors

protected BaseApiService (AbstractBuilder<? extends AbstractBuilder<?, T>, T> builder)

Parameters
builder

Protected Methods

protected static T executeRequest (AbstractGoogleJsonClientRequest<T> request, StatsManager.OperationStats stats, boolean initializeDefaults)

Common execute method for all api requests.

Parameters
request the service API request to perform
stats OperationStats to update
initializeDefaults if default values to be initialized for primitive types
Returns
  • the response result from executing the request
Throws
IOException when the service throws an exception

Skicka feedback om ...