com.atlassian.sal.core.net
Class HttpClientRequestFactory

java.lang.Object
  extended by com.atlassian.sal.core.net.HttpClientRequestFactory
All Implemented Interfaces:
NonMarshallingRequestFactory<HttpClientRequest>, RequestFactory<HttpClientRequest>

public class HttpClientRequestFactory
extends Object
implements NonMarshallingRequestFactory<HttpClientRequest>

Does NOT support json/xml oject marshalling. Use the atlassian-rest implementation of RequestFactory instead.


Field Summary
static int DEFAULT_CONNECTION_TIMEOUT
          The default time allowed for establishing a connection
static int DEFAULT_SOCKET_TIMEOUT
          The default time to wait without retrieving data from the remote connection
 
Constructor Summary
HttpClientRequestFactory(CertificateFactory certificateFactory, UserManager userManager)
           
 
Method Summary
protected  void configureConnectionParameters(org.apache.commons.httpclient.HttpClient httpClient)
          Applies a set of parameters to a client
protected  void configureProtocol(org.apache.commons.httpclient.HttpClient httpClient, String remoteUrl)
           
protected  void configureProxy(org.apache.commons.httpclient.HttpClient client, String remoteUrl)
           
 HttpClientRequest createRequest(Request.MethodType methodType, String url)
          Creates a request of given Request.MethodType to given url
protected  org.apache.commons.httpclient.HttpClient getHttpClient(String url)
           
 boolean supportsHeader()
          Indicates whether the requests can support headers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SOCKET_TIMEOUT

public static final int DEFAULT_SOCKET_TIMEOUT
The default time to wait without retrieving data from the remote connection


DEFAULT_CONNECTION_TIMEOUT

public static final int DEFAULT_CONNECTION_TIMEOUT
The default time allowed for establishing a connection

Constructor Detail

HttpClientRequestFactory

public HttpClientRequestFactory(CertificateFactory certificateFactory,
                                UserManager userManager)
Method Detail

createRequest

public HttpClientRequest createRequest(Request.MethodType methodType,
                                       String url)
Description copied from interface: RequestFactory
Creates a request of given Request.MethodType to given url

Specified by:
createRequest in interface RequestFactory<HttpClientRequest>
Parameters:
methodType - The HTTP method type
url - The url to request
Returns:
The request object

getHttpClient

protected org.apache.commons.httpclient.HttpClient getHttpClient(String url)
Parameters:
url - The URL
Returns:
The HTTP client

configureConnectionParameters

protected void configureConnectionParameters(org.apache.commons.httpclient.HttpClient httpClient)
Applies a set of parameters to a client

Parameters:
httpClient - the client to which parameters are applied

configureProxy

protected void configureProxy(org.apache.commons.httpclient.HttpClient client,
                              String remoteUrl)
Parameters:
client - The client to configure the proxy of
remoteUrl - The remote URL

configureProtocol

protected void configureProtocol(org.apache.commons.httpclient.HttpClient httpClient,
                                 String remoteUrl)

supportsHeader

public boolean supportsHeader()
Description copied from interface: RequestFactory
Indicates whether the requests can support headers

Specified by:
supportsHeader in interface RequestFactory<HttpClientRequest>
Returns:
true if the requests can support headers
See Also:
Request.setHeader(String, String), Request.addHeader(String, String)


Copyright © 2015 Atlassian. All rights reserved.