org.springframework.social.twitter.api
Interface BlockOperations


public interface BlockOperations

Interface defining the operations for blocking and unblocking users


Method Summary
 TwitterProfile block(long userId)
          Blocks a user.
 TwitterProfile block(java.lang.String screenName)
          Blocks a user.
 java.util.List<java.lang.Long> getBlockedUserIds()
          Retrieves a list of user IDs for the users that the authenticating user has blocked.
 java.util.List<TwitterProfile> getBlockedUsers()
          Retrieves a list of users that the authenticating user has blocked.
 java.util.List<TwitterProfile> getBlockedUsers(int page, int pageSize)
          Retrieves a list of users that the authenticating user has blocked.
 boolean isBlocking(long userId)
          Determines if the user has blocked a specific user.
 boolean isBlocking(java.lang.String screenName)
          Determines if the user has blocked a specific user.
 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

java.util.List<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.

getBlockedUsers

java.util.List<TwitterProfile> getBlockedUsers(int page,
                                               int pageSize)
Retrieves a list of users that the authenticating user has blocked.

Parameters:
page - the page of blocked users to return
pageSize - the number of users per page
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

java.util.List<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.

isBlocking

boolean isBlocking(long userId)
Determines if the user has blocked a specific user.

Parameters:
userId - the ID of the user to check for a block.
Returns:
true if the user is blocked; false otherwise
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.

isBlocking

boolean isBlocking(java.lang.String screenName)
Determines if the user has blocked a specific user.

Parameters:
screenName - the screen name of the user to check for a block.
Returns:
true if the user is blocked; false otherwise
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Twitter.