org.jboss.seam.social.twitter
Interface TwitterService

All Superinterfaces:
org.jboss.seam.social.HasStatus, org.jboss.seam.social.oauth.OAuthService, org.jboss.seam.social.rest.RestService, Serializable
All Known Implementing Classes:
TwitterServiceJackson

public interface TwitterService
extends org.jboss.seam.social.oauth.OAuthService, org.jboss.seam.social.HasStatus

A specialization of OAuthService to add TwitterRelated specific methods

Author:
Antoine Sabot-Durand

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.oauth.OAuthService
getAccessToken, getAuthorizationUrl, getSession, getSettings, getVerifier, getVerifierParamName, initAccessToken, sendSignedRequest, sendSignedRequest, sendSignedRequest, sendSignedXmlRequest, setAccessToken, setAccessToken, setSession, setSettings, setVerifier
 
Methods inherited from interface org.jboss.seam.social.rest.RestService
getName, getQualifier, getServiceLogo, getType, isConnected, resetConnection
 
Methods inherited from interface org.jboss.seam.social.HasStatus
getStatus, setStatus, updateStatus, updateStatus
 

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 org.jboss.seam.social.rest.RestService
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.