Spring Social Twitter

org.springframework.social.twitter.api
Interface BlockOperations


public interface BlockOperations

Interface defining the operations for blocking and unblocking users

Author:
Craig Walls

Method Summary
 TwitterProfile block(long userId)
          Blocks a user.
 TwitterProfile block(java.lang.String screenName)
          Blocks a user.
 CursoredList<java.lang.Long> getBlockedUserIds()
          Retrieves a list of user IDs for the users that the authenticating user has blocked.
 CursoredList<java.lang.Long> getBlockedUserIdsInCursor(long cursor)
          Retrieves a list of user IDs for the users that the authenticating user has blocked.
 CursoredList<TwitterProfile> getBlockedUsers()
          Retrieves a list of users that the authenticating user has blocked.
 CursoredList<TwitterProfile> getBlockedUsersInCursor(long cursor)
          Retrieves a list of users that the authenticating user has blocked.
 TwitterProfile unblock(long userId)
          Unblocks a user.
 TwitterProfile unblock(java.lang.String screenName)
          Unblocks a user.
 

Method Detail

block

TwitterProfile block(long userId)
Blocks a user. If a friendship exists with the user, it will be destroyed.

Parameters:
userId - the ID of the user to block.
Returns:
The TwitterProfile of the blocked 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.

block

TwitterProfile block(java.lang.String screenName)
Blocks a user. If a friendship exists with the user, it will be destroyed.

Parameters:
screenName - the screen name of the user to block.
Returns:
The TwitterProfile of the blocked 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.

unblock

TwitterProfile unblock(long userId)
Unblocks a user.

Parameters:
userId - the ID of the user to unblock.
Returns:
The TwitterProfile of the unblocked 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.

unblock

TwitterProfile unblock(java.lang.String screenName)
Unblocks a user.

Parameters:
screenName - the screen name of the user to unblock.
Returns:
The TwitterProfile of the unblocked 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.

getBlockedUsers

CursoredList<TwitterProfile> getBlockedUsers()
Retrieves a list of users that the authenticating user has blocked.

Returns:
a list of TwitterProfiles for the users that are blocked.
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.

getBlockedUsersInCursor

CursoredList<TwitterProfile> getBlockedUsersInCursor(long cursor)
Retrieves a list of users that the authenticating user has blocked.

Parameters:
cursor - the cursor to retrieve results from. -1 will retrieve the first cursored page of results.
Returns:
a list of TwitterProfiles for the users that are blocked.
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.

getBlockedUserIds

CursoredList<java.lang.Long> getBlockedUserIds()
Retrieves a list of user IDs for the users that the authenticating user has blocked.

Returns:
a list of user IDs for the users that are blocked.
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.

getBlockedUserIdsInCursor

CursoredList<java.lang.Long> getBlockedUserIdsInCursor(long cursor)
Retrieves a list of user IDs for the users that the authenticating user has blocked.

Parameters:
cursor - the cursor to retrieve results from. -1 will retrieve the first cursored page of results.
Returns:
a list of user IDs for the users that are blocked.
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