|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwitter4j.TwitterBaseImpl
abstract class TwitterBaseImpl
Base class of Twitter / AsyncTwitter / TwitterStream supports OAuth.
Field Summary | |
---|---|
protected Authorization |
auth
|
protected Configuration |
conf
|
protected twitter4j.internal.http.HttpClientWrapper |
http
|
protected long |
id
|
private java.util.List<RateLimitStatusListener> |
rateLimitStatusListeners
|
protected java.lang.String |
screenName
|
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
TwitterBaseImpl(Configuration conf)
|
|
TwitterBaseImpl(Configuration conf,
Authorization auth)
|
Method Summary | |
---|---|
void |
addRateLimitStatusListener(RateLimitStatusListener listener)
|
protected void |
ensureAuthorizationEnabled()
|
protected void |
ensureOAuthEnabled()
|
boolean |
equals(java.lang.Object o)
|
protected User |
fillInIDAndScreenName()
|
Authorization |
getAuthorization()
|
Configuration |
getConfiguration()
|
long |
getId()
|
private OAuthSupport |
getOAuth()
|
AccessToken |
getOAuthAccessToken()
Returns an access token associated with this instance. If no access token is associated with this instance, this will retrieve a new access token. |
AccessToken |
getOAuthAccessToken(RequestToken requestToken)
Retrieves an access token associated with the supplied request token and sets userId. |
AccessToken |
getOAuthAccessToken(RequestToken requestToken,
java.lang.String oauthVerifier)
Retrieves an access token associated with the supplied request token and sets userId. |
AccessToken |
getOAuthAccessToken(java.lang.String oauthVerifier)
Retrieves an access token. |
AccessToken |
getOAuthAccessToken(java.lang.String screenName,
java.lang.String password)
Retrieves an access token associated with the supplied screen name and password using xAuth. In order to get access acquire AccessToken using xAuth, you must apply by sending an email to api@twitter.com — all other applications will receive an HTTP 401 error. |
RequestToken |
getOAuthRequestToken()
Retrieves a request token |
RequestToken |
getOAuthRequestToken(java.lang.String callbackUrl)
Retrieves a request token |
java.lang.String |
getScreenName()
|
int |
hashCode()
|
void |
httpResponseReceived(twitter4j.internal.http.HttpResponseEvent event)
|
private void |
init()
|
private void |
readObject(java.io.ObjectInputStream stream)
|
void |
setOAuthAccessToken(AccessToken accessToken)
Sets the access token |
void |
setOAuthConsumer(java.lang.String consumerKey,
java.lang.String consumerSecret)
sets the OAuth consumer key and consumer secret |
void |
shutdown()
|
java.lang.String |
toString()
|
private void |
writeObject(java.io.ObjectOutputStream out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Configuration conf
protected transient java.lang.String screenName
protected transient long id
protected transient twitter4j.internal.http.HttpClientWrapper http
private java.util.List<RateLimitStatusListener> rateLimitStatusListeners
protected Authorization auth
private static final long serialVersionUID
Constructor Detail |
---|
TwitterBaseImpl(Configuration conf)
TwitterBaseImpl(Configuration conf, Authorization auth)
Method Detail |
---|
private void init()
public java.lang.String getScreenName() throws TwitterException, java.lang.IllegalStateException
TwitterException
java.lang.IllegalStateException
public long getId() throws TwitterException, java.lang.IllegalStateException
TwitterException
java.lang.IllegalStateException
protected User fillInIDAndScreenName() throws TwitterException
TwitterException
public void addRateLimitStatusListener(RateLimitStatusListener listener)
public void httpResponseReceived(twitter4j.internal.http.HttpResponseEvent event)
httpResponseReceived
in interface twitter4j.internal.http.HttpResponseListener
public final Authorization getAuthorization()
public Configuration getConfiguration()
public void shutdown()
protected final void ensureAuthorizationEnabled()
protected final void ensureOAuthEnabled()
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void setOAuthConsumer(java.lang.String consumerKey, java.lang.String consumerSecret)
setOAuthConsumer
in interface OAuthSupport
consumerKey
- OAuth consumer keyconsumerSecret
- OAuth consumer secretpublic RequestToken getOAuthRequestToken() throws TwitterException
getOAuthRequestToken
in interface OAuthSupport
TwitterException
- when Twitter service or network is unavailablepublic RequestToken getOAuthRequestToken(java.lang.String callbackUrl) throws TwitterException
getOAuthRequestToken
in interface OAuthSupport
callbackUrl
- callback URL
TwitterException
- when Twitter service or network is unavailablepublic AccessToken getOAuthAccessToken() throws TwitterException
getOAuthAccessToken
in interface OAuthSupport
TwitterException
- When Twitter service or network is unavailable, when the user has not authorized, or when the client application is not permitted to use xAuthpublic AccessToken getOAuthAccessToken(java.lang.String oauthVerifier) throws TwitterException
getOAuthAccessToken
in interface OAuthSupport
oauthVerifier
- OAuth verifier. AKA pin.
java.lang.IllegalStateException
- when AccessToken has already been retrieved or set
TwitterException
- when Twitter service or network is unavailable, or the user has not authorizedpublic AccessToken getOAuthAccessToken(RequestToken requestToken) throws TwitterException
getOAuthAccessToken
in interface OAuthSupport
requestToken
- the request token
java.lang.IllegalStateException
- when AccessToken has already been retrieved or set
TwitterException
- when Twitter service or network is unavailable, or the user has not authorizedpublic AccessToken getOAuthAccessToken(RequestToken requestToken, java.lang.String oauthVerifier) throws TwitterException
getOAuthAccessToken
in interface OAuthSupport
requestToken
- the request tokenoauthVerifier
- OAuth verifier. AKA pin.
java.lang.IllegalStateException
- when AccessToken has already been retrieved or set
TwitterException
- when Twitter service or network is unavailable, or the user has not authorizedpublic void setOAuthAccessToken(AccessToken accessToken)
setOAuthAccessToken
in interface OAuthSupport
accessToken
- accessTokenpublic AccessToken getOAuthAccessToken(java.lang.String screenName, java.lang.String password) throws TwitterException
getOAuthAccessToken
in interface OAuthSupport
screenName
- the screen namepassword
- the password
TwitterException
- when Twitter service or network is unavailable, or the user has not authorizedprivate OAuthSupport getOAuth()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |