abstract class TwitterBaseImpl extends java.lang.Object implements TwitterBase, java.io.Serializable, OAuthSupport, twitter4j.internal.http.HttpResponseListener
| Modifier and Type | Field and Description | 
|---|---|
| protected Authorization | auth | 
| protected Configuration | conf | 
| protected twitter4j.internal.json.z_T4JInternalFactory | factory | 
| 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 and Description | 
|---|
| TwitterBaseImpl(Configuration conf,
               Authorization auth) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addRateLimitStatusListener(RateLimitStatusListener listener)Registers a RateLimitStatusListener for account associated rate limits | 
| protected void | ensureAuthorizationEnabled() | 
| protected void | ensureOAuthEnabled() | 
| boolean | equals(java.lang.Object o) | 
| protected User | fillInIDAndScreenName() | 
| Authorization | getAuthorization()Returns the authorization scheme for this instance. The returned type will be either of BasicAuthorization, OAuthAuthorization, or NullAuthorization | 
| Configuration | getConfiguration()Returns the configuration associated with this instance | 
| long | getId()Returns authenticating user's user id. This method may internally call verifyCredentials() on the first invocation if - this instance is authenticated by Basic and email address is supplied instead of screen name, or - this instance is authenticated by OAuth. | 
| 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 | 
| RequestToken | getOAuthRequestToken(java.lang.String callbackUrl,
                    java.lang.String xAuthAccessType)Retrieves a request token | 
| java.lang.String | getScreenName()Returns authenticating user's screen name. This method may internally call verifyCredentials() on the first invocation if - this instance is authenticated by Basic and email address is supplied instead of screen name, or - this instance is authenticated by OAuth. Note that this method returns a transiently cached (will be lost upon serialization) screen name while it is possible to change a user's screen name. | 
| int | hashCode() | 
| void | httpResponseReceived(twitter4j.internal.http.HttpResponseEvent event) | 
| private void | init() | 
| private void | readObject(java.io.ObjectInputStream stream) | 
| protected void | setFactory() | 
| 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()Shuts down this instance and releases allocated resources. | 
| java.lang.String | toString() | 
| private void | writeObject(java.io.ObjectOutputStream out) | 
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 twitter4j.internal.json.z_T4JInternalFactory factory
protected Authorization auth
private static final long serialVersionUID
TwitterBaseImpl(Configuration conf, Authorization auth)
private void init()
protected void setFactory()
public java.lang.String getScreenName()
                               throws TwitterException,
                                      java.lang.IllegalStateException
getScreenName in interface TwitterBaseTwitterException - when verifyCredentials threw an exception.java.lang.IllegalStateException - if no credentials are supplied. i.e.) this is an anonymous Twitter instancepublic long getId()
           throws TwitterException,
                  java.lang.IllegalStateException
getId in interface TwitterBaseTwitterException - when verifyCredentials threw an exception.java.lang.IllegalStateException - if no credentials are supplied. i.e.) this is an anonymous Twitter instanceprotected User fillInIDAndScreenName() throws TwitterException
TwitterExceptionpublic void addRateLimitStatusListener(RateLimitStatusListener listener)
addRateLimitStatusListener in interface TwitterBaselistener - the listener to be addedpublic void httpResponseReceived(twitter4j.internal.http.HttpResponseEvent event)
httpResponseReceived in interface twitter4j.internal.http.HttpResponseListenerpublic final Authorization getAuthorization()
getAuthorization in interface TwitterBasepublic Configuration getConfiguration()
getConfiguration in interface TwitterBasepublic void shutdown()
shutdown in interface TwitterBaseprotected final void ensureAuthorizationEnabled()
protected final void ensureOAuthEnabled()
private void writeObject(java.io.ObjectOutputStream out)
                  throws java.io.IOException
java.io.IOExceptionprivate void readObject(java.io.ObjectInputStream stream)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic void setOAuthConsumer(java.lang.String consumerKey,
                    java.lang.String consumerSecret)
setOAuthConsumer in interface OAuthSupportconsumerKey - OAuth consumer keyconsumerSecret - OAuth consumer secretpublic RequestToken getOAuthRequestToken() throws TwitterException
getOAuthRequestToken in interface OAuthSupportTwitterException - when Twitter service or network is unavailablepublic RequestToken getOAuthRequestToken(java.lang.String callbackUrl) throws TwitterException
getOAuthRequestToken in interface OAuthSupportcallbackUrl - callback URLTwitterException - when Twitter service or network is unavailablepublic RequestToken getOAuthRequestToken(java.lang.String callbackUrl, java.lang.String xAuthAccessType) throws TwitterException
getOAuthRequestToken in interface OAuthSupportcallbackUrl - callback URLxAuthAccessType - Overrides the access level an application requests to a users account. Supported values are read or write. This parameter is intended to allow a developer to register a read/write application but also request read only access when appropriate.TwitterException - when Twitter service or network is unavailablepublic AccessToken getOAuthAccessToken() throws TwitterException
getOAuthAccessToken in interface OAuthSupportTwitterException - 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 OAuthSupportoauthVerifier - OAuth verifier. AKA pin.java.lang.IllegalStateException - when AccessToken has already been retrieved or setTwitterException - when Twitter service or network is unavailable, or the user has not authorizedpublic AccessToken getOAuthAccessToken(RequestToken requestToken) throws TwitterException
getOAuthAccessToken in interface OAuthSupportrequestToken - the request tokenjava.lang.IllegalStateException - when AccessToken has already been retrieved or setTwitterException - 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 OAuthSupportrequestToken - the request tokenoauthVerifier - OAuth verifier. AKA pin.java.lang.IllegalStateException - when AccessToken has already been retrieved or setTwitterException - when Twitter service or network is unavailable, or the user has not authorizedpublic void setOAuthAccessToken(AccessToken accessToken)
setOAuthAccessToken in interface OAuthSupportaccessToken - accessTokenpublic AccessToken getOAuthAccessToken(java.lang.String screenName, java.lang.String password) throws TwitterException
getOAuthAccessToken in interface OAuthSupportscreenName - the screen namepassword - the passwordTwitterException - 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.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object