T - type of the responsepublic abstract class AbstractGoogleJsonClientRequest<T> extends AbstractGoogleClientRequest<T>
AbstractGoogleJsonClient.
Implementation is not thread-safe.
com.google.api.client.util.GenericData.FlagsAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>USER_AGENT_SUFFIX| Modifier | Constructor and Description |
|---|---|
protected |
AbstractGoogleJsonClientRequest(AbstractGoogleJsonClient abstractGoogleJsonClient,
String requestMethod,
String uriTemplate,
Object jsonContent,
Class<T> responseClass) |
| Modifier and Type | Method and Description |
|---|---|
AbstractGoogleJsonClient |
getAbstractGoogleClient()
Returns the Google client.
|
Object |
getJsonContent()
Returns POJO that can be serialized into JSON content or
null for none. |
protected GoogleJsonResponseException |
newExceptionOnError(com.google.api.client.http.HttpResponse response)
Returns the exception to throw on an HTTP error response as defined by
HttpResponse.isSuccessStatusCode(). |
void |
queue(BatchRequest batchRequest,
JsonBatchCallback<T> callback)
Queues the request into the specified batch request container.
|
AbstractGoogleJsonClientRequest<T> |
set(String fieldName,
Object value) |
AbstractGoogleJsonClientRequest<T> |
setDisableGZipContent(boolean disableGZipContent)
Sets whether to disable GZip compression of HTTP content.
|
AbstractGoogleJsonClientRequest<T> |
setRequestHeaders(com.google.api.client.http.HttpHeaders headers)
Sets the HTTP headers used for the Google client request.
|
buildHttpRequest, buildHttpRequestUrl, buildHttpRequestUsingHead, checkRequiredParameter, execute, executeAndDownloadTo, executeAsInputStream, executeMedia, executeMediaAndDownloadTo, executeMediaAsInputStream, executeUnparsed, executeUsingHead, getDisableGZipContent, getHttpContent, getLastResponseHeaders, getLastStatusCode, getLastStatusMessage, getMediaHttpDownloader, getMediaHttpUploader, getRequestHeaders, getRequestMethod, getResponseClass, getReturnRawInputSteam, getUriTemplate, initializeMediaDownload, initializeMediaUpload, queue, setReturnRawInputStreamclone, entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys, toStringclear, containsKey, containsValue, isEmpty, keySet, size, valuesfinalize, getClass, notify, notifyAll, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAllprotected AbstractGoogleJsonClientRequest(AbstractGoogleJsonClient abstractGoogleJsonClient, String requestMethod, String uriTemplate, Object jsonContent, Class<T> responseClass)
abstractGoogleJsonClient - Google JSON clientrequestMethod - HTTP MethoduriTemplate - URI template for the path relative to the base URL. If it starts with a "/"
the base path from the base URL will be stripped out. The URI template can also be a full
URL. URI template expansion is done using UriTemplate.expand(String, String, Object,
boolean)jsonContent - POJO that can be serialized into JSON content or null for noneresponseClass - response class to parse intopublic AbstractGoogleJsonClient getAbstractGoogleClient()
AbstractGoogleClientRequestOverriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
getAbstractGoogleClient in class AbstractGoogleClientRequest<T>public AbstractGoogleJsonClientRequest<T> setDisableGZipContent(boolean disableGZipContent)
AbstractGoogleClientRequestBy default it is false.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setDisableGZipContent in class AbstractGoogleClientRequest<T>public AbstractGoogleJsonClientRequest<T> setRequestHeaders(com.google.api.client.http.HttpHeaders headers)
AbstractGoogleClientRequestThese headers are set on the request after AbstractGoogleClientRequest.buildHttpRequest() is called, this means
that HttpRequestInitializer.initialize(com.google.api.client.http.HttpRequest) is called first.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
setRequestHeaders in class AbstractGoogleClientRequest<T>public final void queue(BatchRequest batchRequest, JsonBatchCallback<T> callback) throws IOException
Batched requests are then executed when BatchRequest.execute() is called.
Example usage:
request.queue(batchRequest, new JsonBatchCallback<SomeResponseType>() {
public void onSuccess(SomeResponseType content, HttpHeaders responseHeaders) {
log("Success");
}
public void onFailure(GoogleJsonError e, HttpHeaders responseHeaders) {
log(e.getMessage());
}
});
batchRequest - batch request containercallback - batch callbackIOExceptionprotected GoogleJsonResponseException newExceptionOnError(com.google.api.client.http.HttpResponse response)
AbstractGoogleClientRequestHttpResponse.isSuccessStatusCode().
It is guaranteed that HttpResponse.isSuccessStatusCode() is false. Default
implementation is to call HttpResponseException(HttpResponse),
but subclasses may override.
newExceptionOnError in class AbstractGoogleClientRequest<T>response - HTTP responsepublic Object getJsonContent()
null for none.public AbstractGoogleJsonClientRequest<T> set(String fieldName, Object value)
set in class AbstractGoogleClientRequest<T>Copyright © 2010–2024 Google. All rights reserved.