org.springframework.social.twitter.api
Interface UserOperations


public interface UserOperations

Interface defining the operations for retrieving information about Twitter users.


Method Summary
 long getProfileId()
          Retrieves the authenticated user's Twitter ID.
 java.lang.String getScreenName()
          Retrieves the authenticated user's Twitter screen name
 java.util.List<SuggestionCategory> getSuggestionCategories()
          Retrieves a list of categories from which suggested users to follow may be found.
 java.util.List<TwitterProfile> getSuggestions(java.lang.String slug)
          Retrieves a list of suggestions of users to follow for a given category.
 TwitterProfile getUserProfile()
          Retrieves the authenticated user's Twitter profile details.
 TwitterProfile getUserProfile(long userId)
          Retrieves a specific user's Twitter profile details.
 TwitterProfile getUserProfile(java.lang.String screenName)
          Retrieves a specific user's Twitter profile details.
 byte[] getUserProfileImage(java.lang.String screenName)
          Retrieves the user's profile image.
 byte[] getUserProfileImage(java.lang.String screenName, ImageSize size)
          Retrieves the user's profile image.
 java.util.List<TwitterProfile> getUsers(long... userIds)
          Retrieves a list of Twitter profiles for the given list of user IDs.
 java.util.List<TwitterProfile> getUsers(java.lang.String... screenNames)
          Retrieves a list of Twitter profiles for the given list of screen names.
 java.util.List<TwitterProfile> searchForUsers(java.lang.String query)
          Searches for users that match a given query.
 

Method Detail

getProfileId

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

Returns:
the user's ID at Twitter

getScreenName

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

Returns:
the user's screen name

getUserProfile

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

Returns:
a TwitterProfile object representing the user's profile.

getUserProfile

TwitterProfile getUserProfile(java.lang.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.

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.

getUserProfileImage

byte[] getUserProfileImage(java.lang.String screenName)
Retrieves the user's profile image. Returns the image in Twitter's "normal" size (48px x 48px).

Parameters:
screenName - the screen name of the user
Returns:
an array of bytes containing the user's profile image.

getUserProfileImage

byte[] getUserProfileImage(java.lang.String screenName,
                           ImageSize size)
Retrieves the user's profile image. Returns the image in Twitter's "normal" type.

Parameters:
screenName - the screen name of the user
size - the size of the image
Returns:
an array of bytes containing the user's profile image.

getUsers

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


getUsers

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


searchForUsers

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


getSuggestionCategories

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


getSuggestions

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

Parameters:
slug - the category's slug