Class AbstractGoogleProtoClientRequest<T> (2.1.2)

public abstract class AbstractGoogleProtoClientRequest<T> extends AbstractGoogleClientRequest<T>

Beta
Google protocol buffer request for a AbstractGoogleProtoClient.

Implementation is not thread-safe.

Inheritance

Object > java.util.AbstractMap > com.google.api.client.util.GenericData > AbstractGoogleClientRequest > AbstractGoogleProtoClientRequest<T>

Type Parameter

Name Description
T

Constructors

AbstractGoogleProtoClientRequest(AbstractGoogleProtoClient abstractGoogleProtoClient, String requestMethod, String uriTemplate, MessageLite message, Class<T> responseClass)

protected AbstractGoogleProtoClientRequest(AbstractGoogleProtoClient abstractGoogleProtoClient, String requestMethod, String uriTemplate, MessageLite message, Class<T> responseClass)
Parameters
Name Description
abstractGoogleProtoClient AbstractGoogleProtoClient

Google protocol buffer client

requestMethod String

HTTP Method

uriTemplate String

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)

message MessageLite

message to serialize or null for none

responseClass Class<T>

response class to parse into

Methods

getAbstractGoogleClient()

public AbstractGoogleProtoClient getAbstractGoogleClient()

Returns the Google client.

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

Returns
Type Description
AbstractGoogleProtoClient
Overrides

getMessage()

public Object getMessage()

Returns the message to serialize or null for none.

Returns
Type Description
Object

queue(BatchRequest batchRequest, BatchCallback<T,Void> callback)

public final void queue(BatchRequest batchRequest, BatchCallback<T,Void> callback)

Queues the request into the specified batch request container.

Batched requests are then executed when BatchRequest#execute() is called.

Example usage:


 request.queue(batchRequest, new BatchCallback{@literal <}someresponsetype, void{@literal="">}() {

   public void onSuccess(SomeResponseType content, HttpHeaders responseHeaders) {
     log("Success");
   }

   public void onFailure(Void unused, HttpHeaders responseHeaders) {
     log(e.getMessage());
   }
 });
 
Parameters
Name Description
batchRequest BatchRequest

batch request container

callback BatchCallback<T,java.lang.Void>

batch callback

Exceptions
Type Description
IOException

set(String fieldName, Object value)

public AbstractGoogleProtoClientRequest<T> set(String fieldName, Object value)
Parameters
Name Description
fieldName String
value Object
Returns
Type Description
AbstractGoogleProtoClientRequest<T>
Overrides

setDisableGZipContent(boolean disableGZipContent)

public AbstractGoogleProtoClientRequest<T> setDisableGZipContent(boolean disableGZipContent)

Sets whether to disable GZip compression of HTTP content.

By default it is false.

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

Parameter
Name Description
disableGZipContent boolean
Returns
Type Description
AbstractGoogleProtoClientRequest<T>
Overrides

setRequestHeaders(HttpHeaders headers)

public AbstractGoogleProtoClientRequest<T> setRequestHeaders(HttpHeaders headers)

Sets the HTTP headers used for the Google client request.

These headers are set on the request after #buildHttpRequest is called, this means that HttpRequestInitializer#initialize is called first.

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

Parameter
Name Description
headers com.google.api.client.http.HttpHeaders
Returns
Type Description
AbstractGoogleProtoClientRequest<T>
Overrides