twitter4j
Class TwitterSupport

java.lang.Object
  extended by twitter4j.TwitterSupport
Direct Known Subclasses:
Twitter, TwitterStream

 class TwitterSupport
extends java.lang.Object

Author:
Yusuke Yamamoto - yusuke at mac.com

Field Summary
protected  HttpClient http
           
protected  java.lang.String source
           
 
Constructor Summary
TwitterSupport()
           
TwitterSupport(java.lang.String userId, java.lang.String password)
           
 
Method Summary
 void forceUsePost(boolean forceUsePost)
          Deprecated. some methods don't accept POST method anymore
 java.lang.String getClientURL()
           
 java.lang.String getClientVersion()
           
 java.lang.String getPassword()
          Returns authenticating password
 java.lang.String getSource()
          Returns the source
 java.lang.String getUserAgent()
           
 java.lang.String getUserId()
          Returns authenticating userid
 boolean isUsePostForced()
           
 void setClientURL(java.lang.String clientURL)
          Sets the X-Twitter-Client-URL header.
 void setClientVersion(java.lang.String version)
          Sets the X-Twitter-Client-Version header.
 void setHttpConnectionTimeout(int connectionTimeout)
          Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the Twitter API.
 void setHttpProxy(java.lang.String proxyHost, int proxyPort)
          Enables use of HTTP proxy
 void setHttpProxyAuth(java.lang.String proxyUser, java.lang.String proxyPass)
          Adds authentication on HTTP proxy
 void setHttpReadTimeout(int readTimeoutMilliSecs)
          Sets the read timeout to a specified timeout, in milliseconds.
 void setPassword(java.lang.String password)
          Sets the password
 void setRequestHeader(java.lang.String name, java.lang.String value)
          Sets the request header name/value combination see Twitter Fan Wiki for detail.
 void setRetryCount(int retryCount)
           
 void setRetryIntervalSecs(int retryIntervalSecs)
           
 void setSource(java.lang.String source)
          Sets X-Twitter-Client http header and the source parameter that will be passed by updating methods.
 void setUserAgent(java.lang.String userAgent)
          Sets the User-Agent header.
 void setUserId(java.lang.String userId)
          Sets the userid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

http

protected HttpClient http

source

protected java.lang.String source
Constructor Detail

TwitterSupport

TwitterSupport()

TwitterSupport

TwitterSupport(java.lang.String userId,
               java.lang.String password)
Method Detail

setUserAgent

public void setUserAgent(java.lang.String userAgent)
Sets the User-Agent header. System property -Dtwitter4j.http.userAgent overrides this attribute.

Parameters:
userAgent - UserAgent
Since:
Twitter4J 1.1.8

getUserAgent

public java.lang.String getUserAgent()
Returns:
UserAgent
Since:
Twitter4J 1.1.8

setClientVersion

public void setClientVersion(java.lang.String version)
Sets the X-Twitter-Client-Version header. System property -Dtwitter4j.clientVersion overrides this attribute.

Parameters:
version - client version
Since:
Twitter4J 1.1.8

getClientVersion

public java.lang.String getClientVersion()
Returns:
client version
Since:
Twitter4J 1.1.8

setClientURL

public void setClientURL(java.lang.String clientURL)
Sets the X-Twitter-Client-URL header. System property -Dtwitter4j.clientURL overrides this attribute.

Parameters:
clientURL - client URL
Since:
Twitter4J 1.1.8

getClientURL

public java.lang.String getClientURL()
Returns:
client URL
Since:
Twitter4J 1.1.8

setUserId

public void setUserId(java.lang.String userId)
Sets the userid

Parameters:
userId - new userid

getUserId

public java.lang.String getUserId()
Returns authenticating userid

Returns:
userid

setPassword

public void setPassword(java.lang.String password)
Sets the password

Parameters:
password - new password

getPassword

public java.lang.String getPassword()
Returns authenticating password

Returns:
password

setHttpProxy

public void setHttpProxy(java.lang.String proxyHost,
                         int proxyPort)
Enables use of HTTP proxy

Parameters:
proxyHost - proxy host, can be overridden system property -Dtwitter4j.http.proxyHost , -Dhttp.proxyHost
proxyPort - proxy port, can be overridden system property -Dtwitter4j.http.proxyPort , -Dhttp.proxyPort
Since:
Twitter4J 1.1.6

setHttpProxyAuth

public void setHttpProxyAuth(java.lang.String proxyUser,
                             java.lang.String proxyPass)
Adds authentication on HTTP proxy

Parameters:
proxyUser - proxy user, can be overridden system property -Dtwitter4j.http.proxyUser
proxyPass - proxy password, can be overridden system property -Dtwitter4j.http.proxyPassword
Since:
Twitter4J 1.1.6

setHttpConnectionTimeout

public void setHttpConnectionTimeout(int connectionTimeout)
Sets a specified timeout value, in milliseconds, to be used when opening a communications link to the Twitter API. System property -Dtwitter4j.http.connectionTimeout overrides this attribute.

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

setHttpReadTimeout

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

Parameters:
readTimeoutMilliSecs - an int that specifies the timeout value to be used in milliseconds
Since:
Twitter4J 1.1.6

setSource

public void setSource(java.lang.String source)
Sets X-Twitter-Client http header and the source parameter that will be passed by updating methods. System property -Dtwitter4j.source overrides this attribute. System property -Dtwitter4j.source overrides this attribute.

Parameters:
source - the new source
See Also:
How do I get "from [MyApp]" appended to updates sent from my API application?, Twitter - Request a link to your application

getSource

public java.lang.String getSource()
Returns the source

Returns:
source

setRequestHeader

public void setRequestHeader(java.lang.String name,
                             java.lang.String value)
Sets the request header name/value combination see Twitter Fan Wiki for detail. http://twitter.pbwiki.com/API-Docs#RequestHeaders

Parameters:
name - the name of the request header
value - the value of the request header

forceUsePost

public void forceUsePost(boolean forceUsePost)
Deprecated. some methods don't accept POST method anymore

Set true to force using POST method communicating to the server.
This method doesn't take effect anymore

Parameters:
forceUsePost - if true POST method will be used forcibly

isUsePostForced

public boolean isUsePostForced()
Returns:
true if POST is used forcibly

setRetryCount

public void setRetryCount(int retryCount)

setRetryIntervalSecs

public void setRetryIntervalSecs(int retryIntervalSecs)