org.springframework.integration.twitter.oauth
Class OAuthAccessTokenBasedTwitterFactoryBean
java.lang.Object
org.springframework.integration.twitter.oauth.AbstractOAuthAccessTokenBasedFactoryBean<twitter4j.Twitter>
org.springframework.integration.twitter.oauth.OAuthAccessTokenBasedTwitterFactoryBean
- All Implemented Interfaces:
- FactoryBean<twitter4j.Twitter>, InitializingBean
public class OAuthAccessTokenBasedTwitterFactoryBean
- extends AbstractOAuthAccessTokenBasedFactoryBean<twitter4j.Twitter>
Method Summary |
void |
establishTwitterObject(twitter4j.http.AccessToken accessToken)
|
twitter4j.http.AccessToken |
getOAuthAccessToken()
Only used if the impementation is trying to get an AccessToken for the first time. |
twitter4j.http.AccessToken |
getOAuthAccessToken(twitter4j.http.RequestToken token,
String pin)
Only used if the impementation is trying to get an AccessToken for the first time. |
twitter4j.http.RequestToken |
getOAuthRequestToken()
because we are not able to dereference the Twitter or AsyncTwitter instances, we need to ask subclasses to call
us how to call AsyncTwitter.getOAuthRequestToken() or Twitter.getOAuthRequestToken() for us.This method
will never be evaluated as long as the OAuthConfiguration.accessToken
and OAuthConfiguration.accessTokenSecret beans are not null. |
Class<?> |
getObjectType()
this method is delegated to implementations because we can't correctly dereference the generic type's class |
void |
verifyCredentials()
Responsibility of subclasses to call this because we cant dereference the generic type appropriately. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OAuthAccessTokenBasedTwitterFactoryBean
protected OAuthAccessTokenBasedTwitterFactoryBean(OAuthConfiguration configuration)
establishTwitterObject
public void establishTwitterObject(twitter4j.http.AccessToken accessToken)
throws Exception
- Specified by:
establishTwitterObject
in class AbstractOAuthAccessTokenBasedFactoryBean<twitter4j.Twitter>
- Throws:
Exception
getOAuthRequestToken
public twitter4j.http.RequestToken getOAuthRequestToken()
throws Exception
- Description copied from class:
AbstractOAuthAccessTokenBasedFactoryBean
- because we are not able to dereference the
Twitter
or AsyncTwitter
instances, we need to ask subclasses to call
us how to call AsyncTwitter.getOAuthRequestToken()
or Twitter.getOAuthRequestToken()
for us.This method
will never be evaluated as long as the OAuthConfiguration.accessToken
and OAuthConfiguration.accessTokenSecret
beans are not null.
- Specified by:
getOAuthRequestToken
in class AbstractOAuthAccessTokenBasedFactoryBean<twitter4j.Twitter>
- Returns:
- the
RequestToken
as vended by the service. Ths will contain a verification URl required to obtain an access key and secret.
- Throws:
Exception
- thrown if anything should go wrong
verifyCredentials
public void verifyCredentials()
throws Exception
- Description copied from class:
AbstractOAuthAccessTokenBasedFactoryBean
- Responsibility of subclasses to call this because we cant dereference the generic type appropriately. The responsibility is
to call
Twitter.verifyCredentials()
or AsyncTwitter.verifyCredentials()
as appropriate
- Specified by:
verifyCredentials
in class AbstractOAuthAccessTokenBasedFactoryBean<twitter4j.Twitter>
- Throws:
Exception
- if there's an inability to authenticate
getOAuthAccessToken
public twitter4j.http.AccessToken getOAuthAccessToken(twitter4j.http.RequestToken token,
String pin)
throws Exception
- Description copied from class:
AbstractOAuthAccessTokenBasedFactoryBean
- Only used if the impementation is trying to get an
AccessToken
for the first time. This method
will never be evaluated as long as the OAuthConfiguration.accessToken
and OAuthConfiguration.accessTokenSecret
beans are not null.
- Specified by:
getOAuthAccessToken
in class AbstractOAuthAccessTokenBasedFactoryBean<twitter4j.Twitter>
- Parameters:
token
- the initiating RequestToken
pin
- the string returned from the verification URL
- Returns:
- returns the
AccessToken
fetched from the twitter service.
- Throws:
Exception
- thrown if anything should go wrong
getOAuthAccessToken
public twitter4j.http.AccessToken getOAuthAccessToken()
throws Exception
- Description copied from class:
AbstractOAuthAccessTokenBasedFactoryBean
- Only used if the impementation is trying to get an
AccessToken
for the first time. This method
will never be evaluated as long as the OAuthConfiguration.accessToken
and OAuthConfiguration.accessTokenSecret
beans are not null.
- Specified by:
getOAuthAccessToken
in class AbstractOAuthAccessTokenBasedFactoryBean<twitter4j.Twitter>
- Returns:
- returns the
AccessToken
fetched from the twitter service.
- Throws:
Exception
- thrown if anything should go wrong
getObjectType
public Class<?> getObjectType()
- Description copied from class:
AbstractOAuthAccessTokenBasedFactoryBean
- this method is delegated to implementations because we can't correctly dereference the generic type's class
- Specified by:
getObjectType
in interface FactoryBean<twitter4j.Twitter>
- Specified by:
getObjectType
in class AbstractOAuthAccessTokenBasedFactoryBean<twitter4j.Twitter>
- Returns:
- a class
Copyright © 2010. All Rights Reserved.