public abstract class AbstractGoogleClient extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AbstractGoogleClient.Builder
Builder for
AbstractGoogleClient . |
Modifier | Constructor and Description |
---|---|
protected |
AbstractGoogleClient(com.google.api.client.http.HttpTransport transport,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer,
String rootUrl,
String servicePath,
com.google.api.client.util.ObjectParser objectParser)
Constructor with required parameters.
|
protected |
AbstractGoogleClient(com.google.api.client.http.HttpTransport transport,
com.google.api.client.http.HttpRequestInitializer httpRequestInitializer,
String rootUrl,
String servicePath,
com.google.api.client.util.ObjectParser objectParser,
GoogleClientRequestInitializer googleClientRequestInitializer,
String applicationName,
boolean suppressPatternChecks) |
Modifier and Type | Method and Description |
---|---|
BatchRequest |
batch()
Create an
BatchRequest object from this Google API client instance. |
BatchRequest |
batch(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer)
Create an
BatchRequest object from this Google API client instance. |
String |
getApplicationName()
Returns the application name to be sent in the User-Agent header of each request or
null for none. |
String |
getBaseUrl()
Returns the URL-encoded base URL of the service, for example
"https://www.googleapis.com/tasks/v1/" . |
GoogleClientRequestInitializer |
getGoogleClientRequestInitializer()
Returns the Google client request initializer or
null for none. |
com.google.api.client.util.ObjectParser |
getObjectParser()
Returns the object parser or
null for none. |
com.google.api.client.http.HttpRequestFactory |
getRequestFactory()
Returns the HTTP request factory.
|
String |
getRootUrl()
Returns the URL-encoded root URL of the service, for example
"https://www.googleapis.com/" . |
String |
getServicePath()
Returns the URL-encoded service path of the service, for example
"tasks/v1/" . |
boolean |
getSuppressPatternChecks()
Returns whether discovery pattern checks should be suppressed on required parameters.
|
protected void |
initialize(AbstractGoogleClientRequest<?> httpClientRequest)
Initializes a
AbstractGoogleClientRequest using a
GoogleClientRequestInitializer . |
protected AbstractGoogleClient(com.google.api.client.http.HttpTransport transport, com.google.api.client.http.HttpRequestInitializer httpRequestInitializer, String rootUrl, String servicePath, com.google.api.client.util.ObjectParser objectParser)
Use AbstractGoogleClient.Builder
if you need to specify any of the optional parameters.
transport
- HTTP transporthttpRequestInitializer
- HTTP request initializer or null
for nonerootUrl
- root URL of the serviceservicePath
- service pathobjectParser
- object parserprotected AbstractGoogleClient(com.google.api.client.http.HttpTransport transport, com.google.api.client.http.HttpRequestInitializer httpRequestInitializer, String rootUrl, String servicePath, com.google.api.client.util.ObjectParser objectParser, GoogleClientRequestInitializer googleClientRequestInitializer, String applicationName, boolean suppressPatternChecks)
transport
- HTTP transporthttpRequestInitializer
- HTTP request initializer or null
for nonerootUrl
- root URL of the serviceservicePath
- service pathobjectParser
- object parser or null
for nonegoogleClientRequestInitializer
- Google request initializer or null
for noneapplicationName
- application name to be sent in the User-Agent header of requests or
null
for nonesuppressPatternChecks
- whether discovery pattern checks should be suppressed on required
parameterspublic final String getRootUrl()
"https://www.googleapis.com/"
.
Must end with a "/".
public final String getServicePath()
"tasks/v1/"
.
Must end with a "/" and not begin with a "/". It is allowed to be an empty string ""
or
a forward slash "/"
, if it is a forward slash then it is treated as an empty string
public final String getBaseUrl()
"https://www.googleapis.com/tasks/v1/"
.
Must end with a "/". It is guaranteed to be equal to getRootUrl() + getServicePath()
.
public final String getApplicationName()
null
for none.public final com.google.api.client.http.HttpRequestFactory getRequestFactory()
public final GoogleClientRequestInitializer getGoogleClientRequestInitializer()
null
for none.public com.google.api.client.util.ObjectParser getObjectParser()
null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
protected void initialize(AbstractGoogleClientRequest<?> httpClientRequest) throws IOException
AbstractGoogleClientRequest
using a
GoogleClientRequestInitializer
.
Must be called before the Google client request is executed, preferably right after the request is instantiated. Sample usage:
public class Get extends HttpClientRequest { ... } public Get get(String userId) throws IOException { Get result = new Get(userId); initialize(result); return result; }
Subclasses may override by calling the super implementation.
httpClientRequest
- Google client request typeIOException
public final BatchRequest batch()
BatchRequest
object from this Google API client instance.
Sample usage:
client.batch() .queue(...) .queue(...) .execute();
public final BatchRequest batch(com.google.api.client.http.HttpRequestInitializer httpRequestInitializer)
BatchRequest
object from this Google API client instance.
Sample usage:
client.batch(httpRequestInitializer) .queue(...) .queue(...) .execute();
httpRequestInitializer
- The initializer to use when creating the top-level batch HTTP
request or null
for nonepublic final boolean getSuppressPatternChecks()
Copyright © 2010-2013 Google. All Rights Reserved.