twitter4j.internal.http
Class HttpClientImpl

java.lang.Object
  extended by twitter4j.internal.http.HttpClientImpl
All Implemented Interfaces:
java.io.Serializable, HttpClient, HttpResponseCode

public class HttpClientImpl
extends java.lang.Object
implements HttpClient, HttpResponseCode, java.io.Serializable

Since:
Twitter4J 2.1.2
Author:
Yusuke Yamamoto - yusuke at mac.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface twitter4j.internal.http.HttpResponseCode
BAD_GATEWAY, BAD_REQUEST, ENHANCE_YOUR_CLAIM, FORBIDDEN, FOUND, INTERNAL_SERVER_ERROR, MULTIPLE_CHOICES, NOT_ACCEPTABLE, NOT_FOUND, NOT_MODIFIED, OK, SERVICE_UNAVAILABLE, UNAUTHORIZED
 
Constructor Summary
HttpClientImpl()
           
HttpClientImpl(HttpClientConfiguration conf)
           
 
Method Summary
static java.lang.String encode(java.lang.String str)
           
 boolean equals(java.lang.Object o)
           
 HttpResponse get(java.lang.String url)
           
 int getConnectionTimeout()
           
static HttpClient getInstance(HttpClientConfiguration conf)
           
 java.lang.String getProxyAuthPassword()
           
 java.lang.String getProxyAuthUser()
           
 java.lang.String getProxyHost()
           
 int getProxyPort()
           
 int getReadTimeout()
           
 int hashCode()
           
 HttpResponse post(java.lang.String url, HttpParameter[] params)
           
 HttpResponse request(HttpRequest req)
           
 void setConnectionTimeout(int connectionTimeout)
          Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the resource referenced by this URLConnection.
 void setProxyAuthPassword(java.lang.String proxyAuthPassword)
          Sets proxy authentication password.
 void setProxyAuthUser(java.lang.String proxyAuthUser)
          Sets proxy authentication user.
 void setProxyHost(java.lang.String proxyHost)
          Sets proxy host.
 void setProxyPort(int proxyPort)
          Sets proxy port.
 void setReadTimeout(int readTimeout)
          Sets the read timeout to a specified timeout, in milliseconds.
 void setRetryCount(int retryCount)
           
 void setRetryIntervalSeconds(int retryIntervalSeconds)
           
 void shutdown()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpClientImpl

public HttpClientImpl()

HttpClientImpl

public HttpClientImpl(HttpClientConfiguration conf)
Method Detail

shutdown

public void shutdown()
Specified by:
shutdown in interface HttpClient

getInstance

public static HttpClient getInstance(HttpClientConfiguration conf)

getProxyHost

public java.lang.String getProxyHost()

setProxyHost

public void setProxyHost(java.lang.String proxyHost)
Sets proxy host.

Parameters:
proxyHost -

getProxyPort

public int getProxyPort()

setProxyPort

public void setProxyPort(int proxyPort)
Sets proxy port.

Parameters:
proxyPort -

getProxyAuthUser

public java.lang.String getProxyAuthUser()

setProxyAuthUser

public void setProxyAuthUser(java.lang.String proxyAuthUser)
Sets proxy authentication user. System property -Dtwitter4j.http.proxyUser overrides this attribute.

Parameters:
proxyAuthUser -

getProxyAuthPassword

public java.lang.String getProxyAuthPassword()

setProxyAuthPassword

public void setProxyAuthPassword(java.lang.String proxyAuthPassword)
Sets proxy authentication password. System property -Dtwitter4j.http.proxyPassword overrides this attribute.

Parameters:
proxyAuthPassword -

getConnectionTimeout

public int getConnectionTimeout()

setConnectionTimeout

public void setConnectionTimeout(int connectionTimeout)
Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the resource referenced by this URLConnection.

Parameters:
connectionTimeout - - an int that specifies the connect timeout value in milliseconds

getReadTimeout

public int getReadTimeout()

setReadTimeout

public void setReadTimeout(int readTimeout)
Sets the read timeout to a specified timeout, in milliseconds.

Parameters:
readTimeout - - an int that specifies the timeout value to be used in milliseconds

setRetryCount

public void setRetryCount(int retryCount)

setRetryIntervalSeconds

public void setRetryIntervalSeconds(int retryIntervalSeconds)

get

public HttpResponse get(java.lang.String url)
                 throws TwitterException
Throws:
TwitterException

post

public HttpResponse post(java.lang.String url,
                         HttpParameter[] params)
                  throws TwitterException
Throws:
TwitterException

request

public HttpResponse request(HttpRequest req)
                     throws TwitterException
Specified by:
request in interface HttpClient
Throws:
TwitterException

encode

public static java.lang.String encode(java.lang.String str)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011. All Rights Reserved.