com.google.api.client.http.apache
Class ApacheHttpTransport

java.lang.Object
  extended by com.google.api.client.http.HttpTransport
      extended by com.google.api.client.http.apache.ApacheHttpTransport

public final class ApacheHttpTransport
extends HttpTransport

Thread-safe HTTP transport based on the Apache HTTP Client library.

Implementation is thread-safe, as long as any parameter modification to the Apache HTTP Client is only done at initialization time. For maximum efficiency, applications should use a single globally-shared instance of the HTTP transport.

Default settings:

These parameters may be overridden by setting the values on the httpClient. getParams(). Please read the Apache HTTP Client connection management tutorial for more complex configuration questions, such as how to set up an HTTP proxy.

Since:
1.0
Author:
Yaniv Inbar

Field Summary
 org.apache.http.client.HttpClient httpClient
          Deprecated. (scheduled to be made private in 1.6) Use getHttpClient()
 
Constructor Summary
ApacheHttpTransport()
           
 
Method Summary
 com.google.api.client.http.apache.ApacheHttpRequest buildDeleteRequest(String url)
          Builds a DELETE request.
 com.google.api.client.http.apache.ApacheHttpRequest buildGetRequest(String url)
          Builds a GET request.
 com.google.api.client.http.apache.ApacheHttpRequest buildHeadRequest(String url)
          Builds a HEAD request.
 com.google.api.client.http.apache.ApacheHttpRequest buildPatchRequest(String url)
          Builds a PATCH request.
 com.google.api.client.http.apache.ApacheHttpRequest buildPostRequest(String url)
          Builds a POST request.
 com.google.api.client.http.apache.ApacheHttpRequest buildPutRequest(String url)
          Builds a PUT request.
 org.apache.http.client.HttpClient getHttpClient()
          Returns the Apache HTTP client.
 void shutdown()
          Shuts down the connection manager and releases allocated resources.
 boolean supportsHead()
          Returns whether this HTTP transport implementation supports the HEAD request method.
 boolean supportsPatch()
          Returns whether this HTTP transport implementation supports the PATCH request method.
 
Methods inherited from class com.google.api.client.http.HttpTransport
createRequestFactory, createRequestFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

httpClient

@Deprecated
public final org.apache.http.client.HttpClient httpClient
Deprecated. (scheduled to be made private in 1.6) Use getHttpClient()
Apache HTTP client.

Since:
1.1
Constructor Detail

ApacheHttpTransport

public ApacheHttpTransport()
Since:
1.3
Method Detail

supportsHead

public boolean supportsHead()
Description copied from class: HttpTransport
Returns whether this HTTP transport implementation supports the HEAD request method.

Default implementation returns false.

Overrides:
supportsHead in class HttpTransport

supportsPatch

public boolean supportsPatch()
Description copied from class: HttpTransport
Returns whether this HTTP transport implementation supports the PATCH request method.

Default implementation returns false.

Overrides:
supportsPatch in class HttpTransport

buildDeleteRequest

public com.google.api.client.http.apache.ApacheHttpRequest buildDeleteRequest(String url)
Description copied from class: HttpTransport
Builds a DELETE request.

Specified by:
buildDeleteRequest in class HttpTransport
Parameters:
url - URL

buildGetRequest

public com.google.api.client.http.apache.ApacheHttpRequest buildGetRequest(String url)
Description copied from class: HttpTransport
Builds a GET request.

Specified by:
buildGetRequest in class HttpTransport
Parameters:
url - URL

buildHeadRequest

public com.google.api.client.http.apache.ApacheHttpRequest buildHeadRequest(String url)
Description copied from class: HttpTransport
Builds a HEAD request. Won't be called if HttpTransport.supportsHead() returns false .

Default implementation throws an UnsupportedOperationException.

Overrides:
buildHeadRequest in class HttpTransport
Parameters:
url - URL

buildPatchRequest

public com.google.api.client.http.apache.ApacheHttpRequest buildPatchRequest(String url)
Description copied from class: HttpTransport
Builds a PATCH request. Won't be called if HttpTransport.supportsPatch() returns false.

Default implementation throws an UnsupportedOperationException.

Overrides:
buildPatchRequest in class HttpTransport
Parameters:
url - URL

buildPostRequest

public com.google.api.client.http.apache.ApacheHttpRequest buildPostRequest(String url)
Description copied from class: HttpTransport
Builds a POST request.

Specified by:
buildPostRequest in class HttpTransport
Parameters:
url - URL

buildPutRequest

public com.google.api.client.http.apache.ApacheHttpRequest buildPutRequest(String url)
Description copied from class: HttpTransport
Builds a PUT request.

Specified by:
buildPutRequest in class HttpTransport
Parameters:
url - URL

shutdown

public void shutdown()
Shuts down the connection manager and releases allocated resources. This includes closing all connections, whether they are currently used or not.

Overrides:
shutdown in class HttpTransport
Since:
1.4

getHttpClient

public org.apache.http.client.HttpClient getHttpClient()
Returns the Apache HTTP client.

Since:
1.5


Copyright © 2011 Google. All Rights Reserved.