|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 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 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,
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. |
abstract 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 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 objectMethod Detail |
---|
protected static Properties fromResource(Resource resource) throws Exception
OAuthAccessTokenBasedTwitterFactoryBean#main(String[])
or
OAuthAccessTokenBasedTwitterFactoryBean#main(String[])
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
Exception
- thrown if anythign goes wrongpublic void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public abstract void establishTwitterObject(twitter4j.http.AccessToken accessToken) throws Exception
Exception
public abstract twitter4j.http.RequestToken getOAuthRequestToken() throws 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.
Exception
- thrown if anything should go wrongpublic abstract twitter4j.http.AccessToken getOAuthAccessToken(twitter4j.http.RequestToken token, String pin) throws 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 RequestToken
pin
- the string returned from the verification URL
AccessToken
fetched from the twitter service.
Exception
- thrown if anything should go wrongpublic abstract twitter4j.http.AccessToken getOAuthAccessToken() throws 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.
Exception
- thrown if anything should go wrongpublic abstract void verifyCredentials() throws Exception
Twitter.verifyCredentials()
or AsyncTwitter.verifyCredentials()
as appropriate
Exception
- if there's an inability to authenticatepublic T getObject() throws Exception
getObject
in interface FactoryBean<T>
Exception
- thrown in case some condition isn't met correctly in constructionpublic abstract 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>
|
Spring Integration | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |