org.jboss.seam.social.twitter
Interface Twitter

All Superinterfaces:
HasStatus, OAuthService, Serializable

public interface Twitter
extends OAuthService, HasStatus

A specialization of OAuthService to add TwitterRelated specific methods

Author:
Antoine Sabot-Durand

Field Summary
static String TYPE
           
 
Method Summary
 TwitterProfile getMyProfile()
          Retrieves the authenticated user's Twitter profile details.
 String getProfileId()
          Retrieves the authenticated user's Twitter ID.
 String getScreenName()
          Retrieves the authenticated user's Twitter screen name
 List<SuggestionCategory> getSuggestionCategories()
          Retrieves a list of categories from which suggested users to follow may be found.
 List<TwitterProfile> getSuggestions(String slug)
          Retrieves a list of suggestions of users to follow for a given category.
 TwitterProfile getUserProfile(long userId)
          Retrieves a specific user's Twitter profile details.
 TwitterProfile getUserProfile(String screenName)
          Retrieves a specific user's Twitter profile details.
 List<TwitterProfile> getUsers(Long... userIds)
          Retrieves a list of Twitter profiles for the given list of user IDs.
 List<TwitterProfile> getUsers(String... screenNames)
          Retrieves a list of Twitter profiles for the given list of screen names.
 List<TwitterProfile> searchForUsers(String query)
          Searches for users that match a given query.
 
Methods inherited from interface org.jboss.seam.social.core.OAuthService
getAccessToken, getAuthorizationUrl, getName, getServiceLogo, getSession, getSettings, getType, getVerifier, getVerifierParamName, initAccessToken, isConnected, resetConnection, sendSignedRequest, sendSignedRequest, sendSignedRequest, sendSignedXmlRequest, setAccessToken, setAccessToken, setSession, setSettings, setVerifier
 
Methods inherited from interface org.jboss.seam.social.core.HasStatus
getStatus, setStatus, updateStatus, updateStatus
 

Field Detail

TYPE

static final String TYPE
See Also:
Constant Field Values
Method Detail

getProfileId

String getProfileId()
Retrieves the authenticated user's Twitter ID.

Returns:
the user's ID at Twitter
Throws:
ApiException - if there is an error while communicating with Twitter.
MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

getScreenName

String getScreenName()
Retrieves the authenticated user's Twitter screen name

Returns:
the user's screen name
Throws:
ApiException - if there is an error while communicating with Twitter.
MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

getMyProfile

TwitterProfile getMyProfile()
Retrieves the authenticated user's Twitter profile details.

Specified by:
getMyProfile in interface OAuthService
Returns:
a TwitterProfile object representing the user's profile.
Throws:
ApiException - if there is an error while communicating with Twitter.
MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

getUserProfile

TwitterProfile getUserProfile(String screenName)
Retrieves a specific user's Twitter profile details. Note that this method does not require authentication.

Parameters:
screenName - the screen name for the user whose details are to be retrieved.
Returns:
a TwitterProfile object representing the user's profile.
Throws:
ApiException - if there is an error while communicating with Twitter.

getUserProfile

TwitterProfile getUserProfile(long userId)
Retrieves a specific user's Twitter profile details. Note that this method does not require authentication.

Parameters:
userId - the user ID for the user whose details are to be retrieved.
Returns:
a TwitterProfile object representing the user's profile.
Throws:
ApiException - if there is an error while communicating with Twitter.

getUsers

List<TwitterProfile> getUsers(Long... userIds)
Retrieves a list of Twitter profiles for the given list of user IDs.

Throws:
ApiException - if there is an error while communicating with Twitter.

getUsers

List<TwitterProfile> getUsers(String... screenNames)
Retrieves a list of Twitter profiles for the given list of screen names.

Throws:
ApiException - if there is an error while communicating with Twitter.

searchForUsers

List<TwitterProfile> searchForUsers(String query)
Searches for users that match a given query.

Throws:
ApiException - if there is an error while communicating with Twitter.
MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

getSuggestionCategories

List<SuggestionCategory> getSuggestionCategories()
Retrieves a list of categories from which suggested users to follow may be found.

Throws:
ApiException - if there is an error while communicating with Twitter.

getSuggestions

List<TwitterProfile> getSuggestions(String slug)
Retrieves a list of suggestions of users to follow for a given category.

Parameters:
slug - the category's slug
Throws:
ApiException - if there is an error while communicating with Twitter.


Copyright © 2011 Seam Framework. All Rights Reserved.