| java.lang.Object | |
| ↳ | com.google.gdata.client.http.HttpGDataRequest |
Known Direct Subclasses
|
The HttpGDataRequest class provides a basic implementation of the
GDataRequest interface over HTTP.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| HttpGDataRequest.Factory | The HttpGDataRequest.Factory class is a factory class for constructing new HttpGDataRequest instances. | ||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| String | METHOD_OVERRIDE_HEADER |
This constant is deprecated.
Use METHOD_OVERRIDE instead
|
|||||||||
| String | METHOD_OVERRIDE_PROPERTY | If this system property is set to true, the GData HTTP
client library will use POST to send data to the associated GData service
and will specify the actual method using the METHOD_OVERRIDE_HEADER
HTTP header. |
|||||||||
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| authToken | The auth token used for this request, may be null. |
||||||||||
| connectTimeout | The connection timeout for this request. | ||||||||||
| connectionSource | Source of HttpURLConnection instances. | ||||||||||
| executed | Indicates whether request execution has taken place. | ||||||||||
| expectsInput | True if the request type expects input from the client. | ||||||||||
| hasOutput | True if the request type returns output to the client. | ||||||||||
| httpConn | Underlying HTTP connection to the GData service. | ||||||||||
| inputStream | The input stream from which HTTP response data may be read or null
if no response stream or not opened yet via getResponseStream(). |
||||||||||
| inputType | Contains the content type of the request data | ||||||||||
| logger | |||||||||||
| readTimeout | The read timeout for this request. | ||||||||||
| requestUrl | The request URL provided by the client. | ||||||||||
| type | The GData request type. | ||||||||||
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new HttpGDataRequest instance of the specified RequestType,
targeting the specified URL.
| |||||||||||
Protected default constructor for testing.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Ends all processing associated with this request and releases any
transient resources (such as open data streams) required for execution.
| |||||||||||
Executes the GData service request.
| |||||||||||
Returns the URLConnection instance that represents the underlying
connection to the GData service that will be used by this request.
| |||||||||||
Returns a parse source that can be used to read response data from the
GData service.
| |||||||||||
Returns the
ContentType of the data that will be written to the
service by this request or null if no data is written to the
server by the request. | |||||||||||
Returns a stream that can be used to write request data to the GData
service.
| |||||||||||
Returns the URL that is the target of the GData request
| |||||||||||
Returns the content type of the GData response.
| |||||||||||
Returns the value of a header containing a header or
null if no
response header of this type exists or it could not be parsed as a valid
date. | |||||||||||
Returns the value of the specified response header name or
null
if no response header of this type exists. | |||||||||||
Returns an input stream that can be used to read response data from the
GData service.
| |||||||||||
Sets the number of milliseconds to wait for a connection to the remote
GData service before timing out.
| |||||||||||
Sets the entity tag value that will be used to conditionalize the request
if not
null. | |||||||||||
Sets a request header (and logs it, if logging is enabled)
| |||||||||||
Sets the If-Modified-Since date precondition to be applied to the
request.
| |||||||||||
Sets request header (and log just the name but not the value, if logging
is enabled)
| |||||||||||
Sets the number of milliseconds to wait for a response from the remote
GData service before timing out.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Called after a request is executed to process the response and generate an
appropriate exception (on failure).
| |||||||||||
Obtains a connection to the GData service.
| |||||||||||
Handles an error response received while executing a GData service request.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.google.gdata.client.Service.GDataRequest
| |||||||||||
This constant is deprecated.
Use METHOD_OVERRIDE instead
Name of HTTP header containing the method name that overrides the normal HTTP method.
If this system property is set to true, the GData HTTP
client library will use POST to send data to the associated GData service
and will specify the actual method using the METHOD_OVERRIDE_HEADER
HTTP header. This can be used as a workaround for HTTP proxies or gateways
that do not handle PUT or DELETE HTTP methods properly. If the system
property is false, the regular PUT and DELETE HTTP verbs
will be used.
The connection timeout for this request. A value of -1 means no value has been configured (use JDK default timeout behavior).
Indicates whether request execution has taken place. Set to
true if executed, false otherwise.
True if the request type expects input from the client.
True if the request type returns output to the client.
Underlying HTTP connection to the GData service.
The input stream from which HTTP response data may be read or null
if no response stream or not opened yet via getResponseStream().
The read timeout for this request. A value of -1 means no value has been configured (use JDK default timeout behavior).
The request URL provided by the client.
Constructs a new HttpGDataRequest instance of the specified RequestType, targeting the specified URL.
| type | Type of GDataRequest. |
|---|---|
| requestUrl | Request target URL. |
| inputType | The content type of request data (or null). |
| authToken | The auth token used for this request (or null). |
| headerMap | A set of headers to be included in each request |
| privateHeaderMap | A set of headers to be included in each request |
| connectionSource | Source of HttpURLConnections |
| IOException | on error initializating service connection. |
|---|
Protected default constructor for testing.
Ends all processing associated with this request and releases any transient resources (such as open data streams) required for execution.
Returns the URLConnection instance that represents the underlying connection to the GData service that will be used by this request.
Returns a parse source that can be used to read response data from the GData service. Parse source is an abstraction over input streams, readers, and other forms of input.
The caller is responsible for ensuring that input streams and readers contained in the parse source are properly closed after the response has been read.
| IOException |
|---|
Returns the ContentType of the data that will be written to the
service by this request or null if no data is written to the
server by the request.
Returns a stream that can be used to write request data to the GData service.
| IOException |
|---|
Returns the URL that is the target of the GData request
Returns the content type of the GData response.
null if no
response content.Returns the value of a header containing a header or null if no
response header of this type exists or it could not be parsed as a valid
date.
| headerName | Name of header |
|---|
Returns the value of the specified response header name or null
if no response header of this type exists.
| headerName | Name of header |
|---|
Returns an input stream that can be used to read response data from the
GData service. Returns null if response data cannot be read as an input
stream. Use getParseSource() instead.
The caller is responsible for ensuring that the input stream is properly closed after the response has been read.
| IOException |
|---|
Sets the number of milliseconds to wait for a connection to the remote GData service before timing out.
| timeout | The read timeout. A value of zero indicates an infinite timeout. |
|---|
Sets the entity tag value that will be used to conditionalize the request
if not null. For a query requests, the tag will cause the target
resource to be returned if the resource entity tag does not match
the specified value (i.e. if the resource has not changed). For update or
delete request types, the entity tag value is used to indicate that the
requested operation should occur only if the specified etag value does
match the specified value (i.e. if the resource has changed). A
request entity tag value may not be associated with other request types.
| etag |
|---|
Sets a request header (and logs it, if logging is enabled)
| name | The header name |
|---|---|
| value | The header value |
Sets the If-Modified-Since date precondition to be applied to the
request. If this precondition is set, then the request will be performed
only if the target resource has been modified since the specified date;
otherwise, a NotModifiedException will be thrown. The default
value is null, indicating no precondition.
| conditionDate | The date that should be used to limit the operation on the target resource. The operation will only be performed if the resource has been modified later than the specified date. |
|---|
| method |
|---|
| ProtocolException |
|---|
Sets request header (and log just the name but not the value, if logging is enabled)
| name | The header name |
|---|---|
| value | The header value |
Sets the number of milliseconds to wait for a response from the remote GData service before timing out.
| timeout | The read timeout. A value of zero indicates an infinite timeout. |
|---|
Called after a request is executed to process the response and generate an appropriate exception (on failure).
| IOException | |
|---|---|
| ServiceException |
Obtains a connection to the GData service.
| requestUrl |
|---|
| IOException |
|---|
Handles an error response received while executing a GData service request.
Throws a ServiceException or one of its subclasses, depending on
the failure conditions.
| ServiceException | exception describing the failure. |
|---|---|
| IOException | error reading the error response from the GData service. |