Spring Social Twitter

org.springframework.social.twitter.api
Interface ListOperations


public interface ListOperations

Interface defining the operations for working with a user's lists.

Author:
Craig Walls

Method Summary
 UserList addToList(long listId, long... newMemberIds)
          Adds one or more new members to a user list.
 UserList addToList(long listId, java.lang.String... newMemberScreenNames)
          Adds one or more new members to a user list.
 UserList createList(java.lang.String name, java.lang.String description, boolean isPublic)
          Create a new user list
 void deleteList(long listId)
          Removes a user list.
 UserList getList(long listId)
          Retrieves a specific user list.
 UserList getList(java.lang.String screenName, java.lang.String listSlug)
          Retrieves a specific user list.
 java.util.List<TwitterProfile> getListMembers(long listId)
          Retrieves a list of Twitter profiles whose users are members of the list.
 java.util.List<TwitterProfile> getListMembers(java.lang.String screenName, java.lang.String listSlug)
          Retrieves a list of Twitter profiles whose users are members of the list.
 java.util.List<UserList> getLists()
          Retrieves user lists for the authenticated user.
 java.util.List<UserList> getLists(long userId)
          Retrieves user lists for a given user.
 java.util.List<UserList> getLists(java.lang.String screenName)
          Retrieves user lists for a given user.
 java.util.List<Tweet> getListStatuses(long listId)
          Retrieves the timeline tweets for the given user list.
 java.util.List<Tweet> getListStatuses(long listId, int pageSize)
          Retrieves the timeline tweets for the given user list.
 java.util.List<Tweet> getListStatuses(long listId, int pageSize, long sinceId, long maxId)
          Retrieves the timeline tweets for the given user list.
 java.util.List<Tweet> getListStatuses(java.lang.String screenName, java.lang.String listSlug)
          Retrieves the timeline tweets for the given user list.
 java.util.List<Tweet> getListStatuses(java.lang.String screenName, java.lang.String listSlug, int pageSize)
          Retrieves the timeline tweets for the given user list.
 java.util.List<Tweet> getListStatuses(java.lang.String screenName, java.lang.String listSlug, int pageSize, long sinceId, long maxId)
          Retrieves the timeline tweets for the given user list.
 java.util.List<TwitterProfile> getListSubscribers(long listId)
          Retrieves the subscribers to a list.
 java.util.List<TwitterProfile> getListSubscribers(java.lang.String screenName, java.lang.String listSlug)
          Retrieves the subscribers to a list.
 CursoredList<UserList> getMemberships(long userId)
          Retrieves the lists that a given user is a member of.
 CursoredList<UserList> getMemberships(java.lang.String screenName)
          Retrieves the lists that a given user is a member of.
 CursoredList<UserList> getSubscriptions(long userId)
          Retrieves the lists that a given user is subscribed to.
 CursoredList<UserList> getSubscriptions(java.lang.String screenName)
          Retrieves the lists that a given user is subscribed to.
 boolean isMember(long listId, long memberId)
          Checks to see if a given user is a member of a given list.
 boolean isMember(java.lang.String screenName, java.lang.String listSlug, java.lang.String memberScreenName)
          Checks to see if a given user is a member of a given list.
 boolean isSubscriber(long listId, long subscriberId)
          Checks to see if a given user subscribes to a given list.
 boolean isSubscriber(java.lang.String screenName, java.lang.String listSlug, java.lang.String subscriberScreenName)
          Checks to see if a given user subscribes to a given list.
 void removeFromList(long listId, long memberId)
          Removes a member from a user list.
 void removeFromList(long listId, java.lang.String memberScreenName)
          Removes a member from a user list.
 UserList subscribe(long listId)
          Subscribes the authenticating user to a list.
 UserList subscribe(java.lang.String screenName, java.lang.String listSlug)
          Subscribes the authenticating user to a list.
 UserList unsubscribe(long listId)
          Unsubscribes the authenticating user from a list.
 UserList unsubscribe(java.lang.String screenName, java.lang.String listSlug)
          Unsubscribes the authenticating user from a list.
 UserList updateList(long listId, java.lang.String name, java.lang.String description, boolean isPublic)
          Updates an existing user list
 

Method Detail

getLists

java.util.List<UserList> getLists()
Retrieves user lists for the authenticated user.

Returns:
a list of UserLists for the authenticated user.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

getLists

java.util.List<UserList> getLists(long userId)
Retrieves user lists for a given user. Supports either user or application authorization.

Parameters:
userId - the ID of the Twitter user.
Returns:
a list of UserLists for the specified user.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getLists

java.util.List<UserList> getLists(java.lang.String screenName)
Retrieves user lists for a given user. Supports either user or application authorization.

Parameters:
screenName - the screen name of the Twitter user.
Returns:
a list of UserLists for the specified user.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getList

UserList getList(long listId)
Retrieves a specific user list.

Parameters:
listId - the ID of the list to retrieve.
Returns:
the requested UserList
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

getList

UserList getList(java.lang.String screenName,
                 java.lang.String listSlug)
Retrieves a specific user list. Supports either user or application authorization.

Parameters:
screenName - the screen name of the list owner.
listSlug - the lists's slug
Returns:
the requested UserList
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getListStatuses

java.util.List<Tweet> getListStatuses(long listId)
Retrieves the timeline tweets for the given user list. Supports either user or application authorization.

Parameters:
listId - the ID of the list to retrieve.
Returns:
a list of Tweet objects for the items in the user list timeline.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getListStatuses

java.util.List<Tweet> getListStatuses(long listId,
                                      int pageSize)
Retrieves the timeline tweets for the given user list. Supports either user or application authorization.

Parameters:
listId - the ID of the list to retrieve.
pageSize - The number of Tweets per page.
Returns:
a list of Tweet objects for the items in the user list timeline.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getListStatuses

java.util.List<Tweet> getListStatuses(long listId,
                                      int pageSize,
                                      long sinceId,
                                      long maxId)
Retrieves the timeline tweets for the given user list. Supports either user or application authorization.

Parameters:
listId - the ID of the list to retrieve.
pageSize - The number of Tweets per page.
sinceId - The minimum Tweet ID to return in the results
maxId - The maximum Tweet ID to return in the results
Returns:
a list of Tweet objects for the items in the user list timeline.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getListStatuses

java.util.List<Tweet> getListStatuses(java.lang.String screenName,
                                      java.lang.String listSlug)
Retrieves the timeline tweets for the given user list. Supports either user or application authorization.

Parameters:
screenName - the screen name of the Twitter user.
listSlug - the list's slug.
Returns:
a list of Tweet objects for the items in the user list timeline.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getListStatuses

java.util.List<Tweet> getListStatuses(java.lang.String screenName,
                                      java.lang.String listSlug,
                                      int pageSize)
Retrieves the timeline tweets for the given user list. Supports either user or application authorization.

Parameters:
screenName - the screen name of the Twitter user.
listSlug - the list's slug.
pageSize - The number of Tweets per page.
Returns:
a list of Tweet objects for the items in the user list timeline.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getListStatuses

java.util.List<Tweet> getListStatuses(java.lang.String screenName,
                                      java.lang.String listSlug,
                                      int pageSize,
                                      long sinceId,
                                      long maxId)
Retrieves the timeline tweets for the given user list. Supports either user or application authorization.

Parameters:
screenName - the screen name of the Twitter user.
listSlug - the list's slug.
pageSize - The number of Tweets per page.
sinceId - The minimum Tweet ID to return in the results
maxId - The maximum Tweet ID to return in the results
Returns:
a list of Tweet objects for the items in the user list timeline.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

createList

UserList createList(java.lang.String name,
                    java.lang.String description,
                    boolean isPublic)
Create a new user list

Parameters:
name - the name of the list.
description - the list description.
isPublic - if true, the list will be public; if false the list will be private.
Returns:
the newly created UserList
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

updateList

UserList updateList(long listId,
                    java.lang.String name,
                    java.lang.String description,
                    boolean isPublic)
Updates an existing user list

Parameters:
listId - the ID of the list
name - the new name of the list.
description - the new list description.
isPublic - if true, the list will be public; if false the list will be private.
Returns:
the newly created UserList
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

deleteList

void deleteList(long listId)
Removes a user list.

Parameters:
listId - the ID of the list to be removed.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

getListMembers

java.util.List<TwitterProfile> getListMembers(long listId)
Retrieves a list of Twitter profiles whose users are members of the list. Supports either user or application authorization.

Parameters:
listId - the ID of the list.
Returns:
a list of TwitterProfile
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getListMembers

java.util.List<TwitterProfile> getListMembers(java.lang.String screenName,
                                              java.lang.String listSlug)
Retrieves a list of Twitter profiles whose users are members of the list. Supports either user or application authorization.

Parameters:
screenName - the screen name of the list owner.
listSlug - the slug of the list.
Returns:
a list of TwitterProfile
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

addToList

UserList addToList(long listId,
                   long... newMemberIds)
Adds one or more new members to a user list.

Parameters:
listId - the ID of the list.
newMemberIds - one or more profile IDs of the Twitter profiles to add to the list.
Returns:
the UserList
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

addToList

UserList addToList(long listId,
                   java.lang.String... newMemberScreenNames)
Adds one or more new members to a user list.

Parameters:
listId - the ID of the list.
newMemberScreenNames - one or more profile IDs of the Twitter profiles to add to the list.
Returns:
the UserList
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

removeFromList

void removeFromList(long listId,
                    long memberId)
Removes a member from a user list.

Parameters:
listId - the ID of the list.
memberId - the ID of the member to be removed.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

removeFromList

void removeFromList(long listId,
                    java.lang.String memberScreenName)
Removes a member from a user list.

Parameters:
listId - the ID of the list.
memberScreenName - the ID of the member to be removed.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

subscribe

UserList subscribe(long listId)
Subscribes the authenticating user to a list.

Parameters:
listId - the ID of the list.
Returns:
the UserList
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

subscribe

UserList subscribe(java.lang.String screenName,
                   java.lang.String listSlug)
Subscribes the authenticating user to a list.

Parameters:
screenName - the screen name of the list owner.
listSlug - the slug of the list.
Returns:
the UserList
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

unsubscribe

UserList unsubscribe(long listId)
Unsubscribes the authenticating user from a list.

Parameters:
listId - the ID of the list.
Returns:
the UserList
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

unsubscribe

UserList unsubscribe(java.lang.String screenName,
                     java.lang.String listSlug)
Unsubscribes the authenticating user from a list.

Parameters:
screenName - the screen name of the list owner.
listSlug - the slug of the list.
Returns:
the UserList
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

getListSubscribers

java.util.List<TwitterProfile> getListSubscribers(long listId)
Retrieves the subscribers to a list. Supports either user or application authorization.

Parameters:
listId - the ID of the list.
Returns:
a list of TwitterProfiles for the list's subscribers.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getListSubscribers

java.util.List<TwitterProfile> getListSubscribers(java.lang.String screenName,
                                                  java.lang.String listSlug)
Retrieves the subscribers to a list. Supports either user or application authorization.

Parameters:
screenName - the screen name of the list owner.
listSlug - the slug of the list.
Returns:
a list of TwitterProfiles for the list's subscribers.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getMemberships

CursoredList<UserList> getMemberships(long userId)
Retrieves the lists that a given user is a member of. Supports either user or application authorization.

Parameters:
userId - the user ID
Returns:
a list of UserLists that the user is a member of.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getMemberships

CursoredList<UserList> getMemberships(java.lang.String screenName)
Retrieves the lists that a given user is a member of. Supports either user or application authorization.

Parameters:
screenName - the user's screen name
Returns:
a list of UserLists that the user is a member of.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getSubscriptions

CursoredList<UserList> getSubscriptions(long userId)
Retrieves the lists that a given user is subscribed to. Supports either user or application authorization.

Parameters:
userId - the user ID
Returns:
a list of UserLists that the user is subscribed to.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

getSubscriptions

CursoredList<UserList> getSubscriptions(java.lang.String screenName)
Retrieves the lists that a given user is subscribed to. Supports either user or application authorization.

Parameters:
screenName - the user's screen name
Returns:
a list of UserLists that the user is subscribed to.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

isMember

boolean isMember(long listId,
                 long memberId)
Checks to see if a given user is a member of a given list. Supports either user or application authorization.

Parameters:
listId - the list ID
memberId - the user ID to check for membership
Returns:
true if the user is a member of the list
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

isMember

boolean isMember(java.lang.String screenName,
                 java.lang.String listSlug,
                 java.lang.String memberScreenName)
Checks to see if a given user is a member of a given list. Supports either user or application authorization.

Parameters:
screenName - the screen name of the list's owner
listSlug - the list's slug
memberScreenName - the screenName to check for membership
Returns:
true if the user is a member of the list
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

isSubscriber

boolean isSubscriber(long listId,
                     long subscriberId)
Checks to see if a given user subscribes to a given list. Supports either user or application authorization.

Parameters:
listId - the list ID
subscriberId - the user ID to check for subscribership
Returns:
true if the user is a member of the list
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials or an application access token.

isSubscriber

boolean isSubscriber(java.lang.String screenName,
                     java.lang.String listSlug,
                     java.lang.String subscriberScreenName)
Checks to see if a given user subscribes to a given list. Supports either user or application authorization.

Parameters:
screenName - the screen name of the list's owner
listSlug - the list's slug
subscriberScreenName - the screenName to check for subscribership
Returns:
true if the user is a member of the list
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.
org.springframework.social.MissingAuthorizationException - if TwitterTemplate was not created with OAuth credentials.

Spring Social Twitter