public static interface

Service.GDataRequestFactory

com.google.gdata.client.Service.GDataRequestFactory
Known Indirect Subclasses

Class Overview

The GDataRequestFactory interface defines a basic factory interface for constructing a new GDataRequest interface.

Summary

Public Methods
abstract Service.GDataRequest getRequest(Service.GDataRequest.RequestType type, URL requestUrl, ContentType contentType)
Creates a new GDataRequest instance of the specified RequestType.
abstract Service.GDataRequest getRequest(Query query, ContentType contentType)
Creates a new GDataRequest instance for querying a service.
abstract void setAuthToken(AuthTokenFactory.AuthToken authToken)
Set authentication token to be used on subsequent requests created via getRequest(com.google.gdata.client.Service.GDataRequest.RequestType, URL, ContentType).
abstract void setHeader(String header, String value)
Set a header that will be included in all requests.
abstract void setPrivateHeader(String header, String value)
Set a header that will be included in all requests and do not log the value.

Public Methods

public abstract Service.GDataRequest getRequest (Service.GDataRequest.RequestType type, URL requestUrl, ContentType contentType)

Creates a new GDataRequest instance of the specified RequestType.

Clients should be sure to call end() on the returned request once they have finished using it.

Parameters
type The request type
requestUrl The target URL for the request
contentType The contentType of the data being provided in the request body. May be null if no data is provided.
Throws
IOException
ServiceException

public abstract Service.GDataRequest getRequest (Query query, ContentType contentType)

Creates a new GDataRequest instance for querying a service. This method pushes the query parameters down to the factory method instead of serializing them as a URL. Some factory implementations prefer to get access to query parameters in their original form, not as a URL.

Clients should be sure to call end() on the returned request once they have finished using it.

Parameters
query The query associated with the request
contentType This parameter is unused but remains for backwards compatibility.
Throws
IOException
ServiceException

public abstract void setAuthToken (AuthTokenFactory.AuthToken authToken)

Set authentication token to be used on subsequent requests created via getRequest(com.google.gdata.client.Service.GDataRequest.RequestType, URL, ContentType). An IllegalArgumentException is thrown if an auth token of the wrong type is passed, or if authentication is not supported.

Parameters
authToken Authentication token.

public abstract void setHeader (String header, String value)

Set a header that will be included in all requests. If header of the same name was previously set, then replace the previous header value.

Parameters
header The name of the header
value The value of the header, if null, then unset that header.

public abstract void setPrivateHeader (String header, String value)

Set a header that will be included in all requests and do not log the value. Useful for values that are sensitive or related to security. If header of the same name was previously set, then replace the previous header value.

Parameters
header The name of the header
value The value of the header. If null, then unset that header.