org.springframework.social.facebook.api
Interface UserOperations


public interface UserOperations


Method Summary
 PagedList<String> getUserPermissions()
          Retrieves a list of permissions that the application has been granted for the authenticated user.
 FacebookProfile getUserProfile()
          Retrieves the profile for the authenticated user.
 FacebookProfile getUserProfile(String userId)
          Retrieves the profile for the specified user.
 byte[] getUserProfileImage()
          Retrieves the user's profile image.
 byte[] getUserProfileImage(ImageType imageType)
          Retrieves the user's profile image.
 byte[] getUserProfileImage(String userId)
          Retrieves the user's profile image.
 byte[] getUserProfileImage(String userId, ImageType imageType)
          Retrieves the user's profile image.
 PagedList<Reference> search(String query)
          Searches for users.
 

Method Detail

getUserProfile

FacebookProfile getUserProfile()
Retrieves the profile for the authenticated user.

Returns:
the user's profile information.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getUserProfile

FacebookProfile getUserProfile(String userId)
Retrieves the profile for the specified user.

Parameters:
userId - the Facebook user ID to retrieve profile data for.
Returns:
the user's profile information.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getUserProfileImage

byte[] getUserProfileImage()
Retrieves the user's profile image. Returns the image in Facebook's "normal" type.

Returns:
an array of bytes containing the user's profile image.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getUserProfileImage

byte[] getUserProfileImage(String userId)
Retrieves the user's profile image. Returns the image in Facebook's "normal" type.

Parameters:
userId - the Facebook user ID.
Returns:
an array of bytes containing the user's profile image.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getUserProfileImage

byte[] getUserProfileImage(ImageType imageType)
Retrieves the user's profile image.

Parameters:
imageType - the image type (eg., small, normal, large. square)
Returns:
an array of bytes containing the user's profile image.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getUserProfileImage

byte[] getUserProfileImage(String userId,
                           ImageType imageType)
Retrieves the user's profile image.

Parameters:
userId - the Facebook user ID.
imageType - the image type (eg., small, normal, large. square)
Returns:
an array of bytes containing the user's profile image.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getUserPermissions

PagedList<String> getUserPermissions()
Retrieves a list of permissions that the application has been granted for the authenticated user.

Returns:
the permissions granted for the user.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

search

PagedList<Reference> search(String query)
Searches for users.

Parameters:
query - the search query (e.g., "Michael Scott")
Returns:
a list of References, each representing a user who matched the given query.
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.