org.springframework.social.twitter.api
Interface FriendOperations


public interface FriendOperations

Interface defining the operations for working with a user's friends and followers.


Method Summary
 java.lang.String follow(long userId)
          Allows the authenticated user to follow (create a friendship) with another user.
 java.lang.String follow(java.lang.String screenName)
          Allows the authenticated user to follow (create a friendship) with another user.
 boolean friendshipExists(java.lang.String userA, java.lang.String userB)
          Checks for a friendship between two users.
 java.util.List<java.lang.Long> getFollowerIds()
          Retrieves a list of IDs for the Twitter users that follow the authenticated user.
 java.util.List<java.lang.Long> getFollowerIds(long userId)
          Retrieves a list of IDs for the Twitter users that follow the given user.
 java.util.List<java.lang.Long> getFollowerIds(java.lang.String screenName)
          Retrieves a list of IDs for the Twitter users that follow the given user.
 java.util.List<TwitterProfile> getFollowers()
          Retrieves a list of users that the authenticated user is being followed by
 java.util.List<TwitterProfile> getFollowers(long userId)
          Retrieves a list of users that the given user is being followed by
 java.util.List<TwitterProfile> getFollowers(java.lang.String screenName)
          Retrieves a list of users that the given user is being followed by
 java.util.List<java.lang.Long> getFriendIds()
          Retrieves a list of IDs for the Twitter users that the authenticated user follows.
 java.util.List<java.lang.Long> getFriendIds(long userId)
          Retrieves a list of IDs for the Twitter users that the given user follows.
 java.util.List<java.lang.Long> getFriendIds(java.lang.String screenName)
          Retrieves a list of IDs for the Twitter users that the given user follows.
 java.util.List<TwitterProfile> getFriends()
          Retrieves a list of users that the authenticated user follows.
 java.util.List<TwitterProfile> getFriends(long userId)
          Retrieves a list of users that the given user follows.
 java.util.List<TwitterProfile> getFriends(java.lang.String screenName)
          Retrieves a list of users that the given user follows.
 java.util.List<java.lang.Long> getIncomingFriendships()
          Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user.
 java.util.List<java.lang.Long> getOutgoingFriendships()
          Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.
 java.lang.String unfollow(long userId)
          Allows the authenticated use to unfollow (destroy a friendship) with another user
 java.lang.String unfollow(java.lang.String screenName)
          Allows the authenticated use to unfollow (destroy a friendship) with another user
 

Method Detail

getFriends

java.util.List<TwitterProfile> getFriends()
Retrieves a list of users that the authenticated user follows.

Returns:
a list of TwitterProfiles

getFriends

java.util.List<TwitterProfile> getFriends(long userId)
Retrieves a list of users that the given user follows.

Parameters:
userId - The user's Twitter ID
Returns:
a list of TwitterProfiles

getFriends

java.util.List<TwitterProfile> getFriends(java.lang.String screenName)
Retrieves a list of users that the given user follows.

Parameters:
screenName - The user's Twitter screen name
Returns:
a list of TwitterProfiles

getFriendIds

java.util.List<java.lang.Long> getFriendIds()
Retrieves a list of IDs for the Twitter users that the authenticated user follows.

Returns:
a list of user IDs

getFriendIds

java.util.List<java.lang.Long> getFriendIds(long userId)
Retrieves a list of IDs for the Twitter users that the given user follows.

Parameters:
userId - the user's Twitter ID
Returns:
a list of user IDs

getFriendIds

java.util.List<java.lang.Long> getFriendIds(java.lang.String screenName)
Retrieves a list of IDs for the Twitter users that the given user follows.

Parameters:
screenName - the user's Twitter screen name
Returns:
a list of user IDs

getFollowers

java.util.List<TwitterProfile> getFollowers()
Retrieves a list of users that the authenticated user is being followed by

Returns:
a list of TwitterProfiles

getFollowers

java.util.List<TwitterProfile> getFollowers(long userId)
Retrieves a list of users that the given user is being followed by

Parameters:
userId - The user's Twitter ID
Returns:
a list of TwitterProfiles

getFollowers

java.util.List<TwitterProfile> getFollowers(java.lang.String screenName)
Retrieves a list of users that the given user is being followed by

Parameters:
screenName - The user's Twitter screen name
Returns:
a list of TwitterProfiles

getFollowerIds

java.util.List<java.lang.Long> getFollowerIds()
Retrieves a list of IDs for the Twitter users that follow the authenticated user.

Returns:
a list of user IDs

getFollowerIds

java.util.List<java.lang.Long> getFollowerIds(long userId)
Retrieves a list of IDs for the Twitter users that follow the given user.

Parameters:
userId - the user's Twitter ID
Returns:
a list of user IDs

getFollowerIds

java.util.List<java.lang.Long> getFollowerIds(java.lang.String screenName)
Retrieves a list of IDs for the Twitter users that follow the given user.

Parameters:
screenName - the user's Twitter screen name
Returns:
a list of user IDs

follow

java.lang.String follow(long userId)
Allows the authenticated user to follow (create a friendship) with another user.

Parameters:
userId - The Twitter ID of the user to follow
Returns:
the name of the followed user if successful

follow

java.lang.String follow(java.lang.String screenName)
Allows the authenticated user to follow (create a friendship) with another user.

Parameters:
screenName - The screen name of the user to follow
Returns:
the name of the followed user if successful

unfollow

java.lang.String unfollow(long userId)
Allows the authenticated use to unfollow (destroy a friendship) with another user

Parameters:
userId - the Twitter ID of the user to unfollow
Returns:
the name of the unfolloed user if successful

unfollow

java.lang.String unfollow(java.lang.String screenName)
Allows the authenticated use to unfollow (destroy a friendship) with another user

Parameters:
screenName - the screen name of the user to unfollow
Returns:
the name of the unfolloed user if successful

friendshipExists

boolean friendshipExists(java.lang.String userA,
                         java.lang.String userB)
Checks for a friendship between two users. Returns true if userA follows userB.

Parameters:
userA - the screen name of userA
userB - the screen name of userB

getIncomingFriendships

java.util.List<java.lang.Long> getIncomingFriendships()
Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user.


getOutgoingFriendships

java.util.List<java.lang.Long> getOutgoingFriendships()
Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request.