|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.social.twitter.api.impl.TwitterTemplate
public class TwitterTemplate
This is the central class for interacting with Twitter.
Most (not all) Twitter operations require OAuth authentication. To perform
such operations, TwitterTemplate
must be constructed with the minimal
amount of information required to sign requests to Twitter's API with an
OAuth Authorization
header.
There are a few operations, such as searching, that do not require OAuth
authentication. In those cases, you may use a TwitterTemplate
that is
created through the default constructor and without any OAuth details.
Attempts to perform secured operations through such an instance, however,
will result in BadCredentialsException
being thrown.
Constructor Summary | |
---|---|
TwitterTemplate()
Create a new instance of TwitterTemplate. |
|
TwitterTemplate(java.lang.String apiKey,
java.lang.String apiSecret,
java.lang.String accessToken,
java.lang.String accessTokenSecret)
Create a new instance of TwitterTemplate. |
Method Summary | |
---|---|
DirectMessageOperations |
directMessageOperations()
Returns the portion of the Twitter API containing the direct message operations. |
FriendOperations |
friendOperations()
Returns the portion of the Twitter API containing the friends and followers operations. |
protected RestTemplate |
getRestTemplate()
|
boolean |
isAuthorizedForUser()
Returns true if the TwitterApi is configured to act on behalf of a user (eg., if it was created with OAuth credentials). |
ListOperations |
listOperations()
Returns the portion of the Twitter API containing the user list operations. |
SearchOperations |
searchOperations()
Returns the portion of the Twitter API containing the search operations. |
TimelineOperations |
timelineOperations()
Returns the portion of the Twitter API containing the tweet and timeline operations. |
UserOperations |
userOperations()
Returns the portion of the Twitter API containing the user operations. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TwitterTemplate()
BadCredentialsException
.
public TwitterTemplate(java.lang.String apiKey, java.lang.String apiSecret, java.lang.String accessToken, java.lang.String accessTokenSecret)
apiKey
- the application's API keyapiSecret
- the application's API secretaccessToken
- an access token acquired through OAuth authentication with TwitteraccessTokenSecret
- an access token secret acquired through OAuth authentication with TwitterMethod Detail |
---|
public boolean isAuthorizedForUser()
TwitterApi
isAuthorizedForUser
in interface TwitterApi
public TimelineOperations timelineOperations()
TwitterApi
timelineOperations
in interface TwitterApi
public FriendOperations friendOperations()
TwitterApi
friendOperations
in interface TwitterApi
public ListOperations listOperations()
TwitterApi
listOperations
in interface TwitterApi
public SearchOperations searchOperations()
TwitterApi
searchOperations
in interface TwitterApi
public DirectMessageOperations directMessageOperations()
TwitterApi
directMessageOperations
in interface TwitterApi
public UserOperations userOperations()
TwitterApi
userOperations
in interface TwitterApi
protected RestTemplate getRestTemplate()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |