|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.integration.twitter.oauth.AbstractOAuthAccessTokenBasedFactoryBean<T>
T - public abstract class AbstractOAuthAccessTokenBasedFactoryBean<T>
base-class for OAuthAccessTokenBasedTwitterFactoryBean.
OAuthAccessTokenBasedTwitterFactoryBean| Field Summary | |
|---|---|
protected OAuthConfiguration |
configuration
|
protected boolean |
initialized
|
protected java.lang.Object |
monitor
|
protected T |
twitter
|
| Constructor Summary | |
|---|---|
protected |
AbstractOAuthAccessTokenBasedFactoryBean(OAuthConfiguration configuration)
Nasty little bit of circular indirection here: the OAuthConfiguration hosts the String values for authentication,
which we need to build up this instance, but the OAuthConfiguration in turn needs references to the instances provided by
this FactoryBean. |
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
provides lifecycle for initiation of the reference. |
abstract void |
establishTwitterObject(twitter4j.http.AccessToken accessToken)
|
protected static java.util.Properties |
fromResource(Resource resource)
This probably doesn't belong here. |
abstract twitter4j.http.AccessToken |
getOAuthAccessToken()
Only used if the impementation is trying to get an AccessToken for the first time. |
abstract twitter4j.http.AccessToken |
getOAuthAccessToken(twitter4j.http.RequestToken token,
java.lang.String pin)
Only used if the impementation is trying to get an AccessToken for the first time. |
abstract 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. |
T |
getObject()
Rubber meets the road: builds up a reference to the twitter4j.(Async)Twitter instance |
abstract java.lang.Class<?> |
getObjectType()
this method is delegated to implementations because we can't correctly dereference the generic type's class |
boolean |
isSingleton()
Standard FactoryBean method. |
abstract 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 |
| Field Detail |
|---|
protected OAuthConfiguration configuration
protected final java.lang.Object monitor
protected volatile T twitter
protected volatile boolean initialized
| Constructor Detail |
|---|
protected AbstractOAuthAccessTokenBasedFactoryBean(OAuthConfiguration configuration)
OAuthConfiguration hosts the String values for authentication,
which we need to build up this instance, but the OAuthConfiguration in turn needs references to the instances provided by
this FactoryBean. So, they collaborate and guard each others state. Ultimately, clients should use OAuthConfiguration
to correctly any implementations of this factory bean as well as the OAuthConfiguration reference itself.
configuration - the configuration object| Method Detail |
|---|
protected static java.util.Properties fromResource(Resource resource)
throws java.lang.Exception
OAuthAccessTokenBasedTwitterFactoryBean or
OAuthAccessTokenBasedTwitterFactoryBean methods that run the user through a command line tool to approve a user for the first
time if the user hasn't obtained her accessToken yet
resource - the resource where properties file lives
Properties instance
java.lang.Exception - thrown if anythign goes wrong
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface InitializingBeanjava.lang.Exception
public abstract void establishTwitterObject(twitter4j.http.AccessToken accessToken)
throws java.lang.Exception
java.lang.Exception
public abstract twitter4j.http.RequestToken getOAuthRequestToken()
throws java.lang.Exception
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.
RequestToken as vended by the service. Ths will contain a verification URl required to obtain an access key and secret.
java.lang.Exception - thrown if anything should go wrong
public abstract twitter4j.http.AccessToken getOAuthAccessToken(twitter4j.http.RequestToken token,
java.lang.String pin)
throws java.lang.Exception
AccessToken for the first time. This method
will never be evaluated as long as the OAuthConfiguration.accessToken
and OAuthConfiguration.accessTokenSecret beans are not null.
token - the initiating RequestTokenpin - the string returned from the verification URL
AccessToken fetched from the twitter service.
java.lang.Exception - thrown if anything should go wrong
public abstract twitter4j.http.AccessToken getOAuthAccessToken()
throws java.lang.Exception
AccessToken for the first time. This method
will never be evaluated as long as the OAuthConfiguration.accessToken
and OAuthConfiguration.accessTokenSecret beans are not null.
AccessToken fetched from the twitter service.
java.lang.Exception - thrown if anything should go wrong
public abstract void verifyCredentials()
throws java.lang.Exception
Twitter.verifyCredentials() or AsyncTwitter.verifyCredentials() as appropriate
java.lang.Exception - if there's an inability to authenticate
public T getObject()
throws java.lang.Exception
getObject in interface FactoryBean<T>java.lang.Exception - thrown in case some condition isn't met correctly in constructionpublic abstract java.lang.Class<?> getObjectType()
getObjectType in interface FactoryBean<T>public boolean isSingleton()
FactoryBean method. Implementations may override if there's a specific method
isSingleton in interface FactoryBean<T>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||