org.springframework.social.facebook.api
Interface LikeOperations


public interface LikeOperations

Defines operations for working with a user's likes and interests.


Method Summary
 PagedList<Page> getActivities()
          Retrieves a list of activities that the authenticated user likes.
 PagedList<Page> getActivities(PagingParameters pagingParameters)
          Retrieves a list of activities that the authenticated user likes.
 PagedList<Page> getActivities(String userId)
          Retrieves a list of activities that the given user likes.
 PagedList<Page> getActivities(String userId, PagingParameters pagingParameters)
          Retrieves a list of activities that the given user likes.
 PagedList<Page> getBooks()
          Retrieves a list of books that the authenticated user likes.
 PagedList<Page> getBooks(PagingParameters pagingParameters)
          Retrieves a list of books that the authenticated user likes.
 PagedList<Page> getBooks(String userId)
          Retrieves a list of books that the given user has liked.
 PagedList<Page> getBooks(String userId, PagingParameters pagingParameters)
          Retrieves a list of books that the given user has liked.
 PagedList<Page> getGames()
          Retrieves a list of games that the authenticated user likes.
 PagedList<Page> getGames(PagingParameters pagingParameters)
          Retrieves a list of games that the authenticated user likes.
 PagedList<Page> getGames(String userId)
          Retrieves a list of games that the given user likes.
 PagedList<Page> getGames(String userId, PagingParameters pagingParameters)
          Retrieves a list of games that the given user likes.
 PagedList<Page> getInterests()
          Retrieves a list of interests that the authenticated user likes.
 PagedList<Page> getInterests(PagingParameters pagingParameters)
          Retrieves a list of interests that the authenticated user likes.
 PagedList<Page> getInterests(String userId)
          Retrieves a list of interests that the given user likes.
 PagedList<Page> getInterests(String userId, PagingParameters pagingParameters)
          Retrieves a list of interests that the given user likes.
 PagedList<Reference> getLikes(String objectId)
          Retrieves a list of references to users who have liked the specified object.
 PagedList<Reference> getLikes(String objectId, PagingParameters pagingParameters)
          Retrieves a page of references to users who have liked the specified object.
 PagedList<Page> getMovies()
          Retrieves a list of movies that the authenticated user likes.
 PagedList<Page> getMovies(PagingParameters pagingParameters)
          Retrieves a list of movies that the authenticated user likes.
 PagedList<Page> getMovies(String userId)
          Retrieves a list of movies that the given user has liked.
 PagedList<Page> getMovies(String userId, PagingParameters pagingParameters)
          Retrieves a list of movies that the given user has liked.
 PagedList<Page> getMusic()
          Retrieves a list of music that the authenticated user likes.
 PagedList<Page> getMusic(PagingParameters pagingParameters)
          Retrieves a list of music that the authenticated user likes.
 PagedList<Page> getMusic(String userId)
          Retrieves a list of music that the given user has liked.
 PagedList<Page> getMusic(String userId, PagingParameters pagingParameters)
          Retrieves a list of music that the given user has liked.
 PagedList<Page> getPagesLiked()
          Retrieves a list of pages that the authenticated user has liked.
 PagedList<Page> getPagesLiked(PagingParameters pagingParameters)
          Retrieves a list of pages that the authenticated user has liked.
 PagedList<Page> getPagesLiked(String userId)
          Retrieves a list of pages that the given user has liked.
 PagedList<Page> getPagesLiked(String userId, PagingParameters pagingParameters)
          Retrieves a list of pages that the given user has liked.
 PagedList<Page> getTelevision()
          Retrieves a list of television shows that the authenticated user likes.
 PagedList<Page> getTelevision(PagingParameters pagingParameters)
          Retrieves a list of television shows that the authenticated user likes.
 PagedList<Page> getTelevision(String userId)
          Retrieves a list of television shows that the given user has liked.
 PagedList<Page> getTelevision(String userId, PagingParameters pagingParameters)
          Retrieves a list of television shows that the given user has liked.
 void like(String objectId)
          Like an object on behalf of the authenticated user.
 void unlike(String objectId)
          Unlike an object on behalf of the authenticated user.
 

Method Detail

getLikes

PagedList<Reference> getLikes(String objectId)
Retrieves a list of references to users who have liked the specified object. Limited to 25 references. Pass the PagingParameters returned from PagedList.getNextPage() into getLikes(String, PagingParameters) to get the next page.

Parameters:
objectId - the object ID (an Album, Checkin, Comment, Note, Photo, Post, or Video).
Returns:
a list of Reference objects for the users who have liked the object.
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.

getLikes

PagedList<Reference> getLikes(String objectId,
                              PagingParameters pagingParameters)
Retrieves a page of references to users who have liked the specified object.

Parameters:
objectId - the object ID (an Album, Checkin, Comment, Note, Photo, Post, or Video).
pagingParameters - the paging parameters for fetching a specific page of references.
Returns:
a list of Reference objects for the users who have liked the object.
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.

getPagesLiked

PagedList<Page> getPagesLiked()
Retrieves a list of pages that the authenticated user has liked. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getPagesLiked

PagedList<Page> getPagesLiked(PagingParameters pagingParameters)
Retrieves a list of pages that the authenticated user has liked. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Parameters:
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getPagesLiked

PagedList<Page> getPagesLiked(String userId)
Retrieves a list of pages that the given user has liked. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" or "friends_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getPagesLiked

PagedList<Page> getPagesLiked(String userId,
                              PagingParameters pagingParameters)
Retrieves a list of pages that the given user has liked. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" or "friends_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

like

void like(String objectId)
Like an object on behalf of the authenticated user. The type of object to be liked is limited to Album, Checkin, Comment, Note, Photo, Post, or Video. You cannot like a Facebook Page through this API. Requires "publish_stream" permission and permission to access the object being liked.

Parameters:
objectId - the object ID
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "publish_stream" permission or if the user does not have permission to access the object.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

unlike

void unlike(String objectId)
Unlike an object on behalf of the authenticated user. The type of object to be liked is limited to Album, Checkin, Comment, Note, Photo, Post, or Video. You cannot unlike a Facebook Page through this API. Requires "publish_stream" permission and permission to access the object being liked.

Parameters:
objectId - the object ID
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "publish_stream" permission or if the user does not have permission to access the object.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getBooks

PagedList<Page> getBooks()
Retrieves a list of books that the authenticated user likes. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getBooks

PagedList<Page> getBooks(String userId)
Retrieves a list of books that the given user has liked. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getBooks

PagedList<Page> getBooks(PagingParameters pagingParameters)
Retrieves a list of books that the authenticated user likes. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Parameters:
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getBooks

PagedList<Page> getBooks(String userId,
                         PagingParameters pagingParameters)
Retrieves a list of books that the given user has liked. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getMovies

PagedList<Page> getMovies()
Retrieves a list of movies that the authenticated user likes. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getMovies

PagedList<Page> getMovies(String userId)
Retrieves a list of movies that the given user has liked. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getMovies

PagedList<Page> getMovies(PagingParameters pagingParameters)
Retrieves a list of movies that the authenticated user likes. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Parameters:
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getMovies

PagedList<Page> getMovies(String userId,
                          PagingParameters pagingParameters)
Retrieves a list of movies that the given user has liked. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getMusic

PagedList<Page> getMusic()
Retrieves a list of music that the authenticated user likes. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getMusic

PagedList<Page> getMusic(String userId)
Retrieves a list of music that the given user has liked. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getMusic

PagedList<Page> getMusic(PagingParameters pagingParameters)
Retrieves a list of music that the authenticated user likes. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Parameters:
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getMusic

PagedList<Page> getMusic(String userId,
                         PagingParameters pagingParameters)
Retrieves a list of music that the given user has liked. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getTelevision

PagedList<Page> getTelevision()
Retrieves a list of television shows that the authenticated user likes. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getTelevision

PagedList<Page> getTelevision(String userId)
Retrieves a list of television shows that the given user has liked. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" or "friends_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getTelevision

PagedList<Page> getTelevision(PagingParameters pagingParameters)
Retrieves a list of television shows that the authenticated user likes. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Parameters:
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getTelevision

PagedList<Page> getTelevision(String userId,
                              PagingParameters pagingParameters)
Retrieves a list of television shows that the given user has liked. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" or "friends_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getActivities

PagedList<Page> getActivities()
Retrieves a list of activities that the authenticated user likes. Requires "user_activities" permission. Returns an empty list if permission isn't granted.

Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_activities" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getActivities

PagedList<Page> getActivities(String userId)
Retrieves a list of activities that the given user likes. Requires "user_activities" permission for the authenticated user and "friends_activities" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_activities" or "friends_activities" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getActivities

PagedList<Page> getActivities(PagingParameters pagingParameters)
Retrieves a list of activities that the authenticated user likes. Requires "user_activities" permission. Returns an empty list if permission isn't granted.

Parameters:
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_activities" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getActivities

PagedList<Page> getActivities(String userId,
                              PagingParameters pagingParameters)
Retrieves a list of activities that the given user likes. Requires "user_activities" permission for the authenticated user and "friends_activities" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_activities" or "friends_activities" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getInterests

PagedList<Page> getInterests()
Retrieves a list of interests that the authenticated user likes. Requires "user_interests" permission. Returns an empty list if permission isn't granted.

Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_interests" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getInterests

PagedList<Page> getInterests(String userId)
Retrieves a list of interests that the given user likes. Requires "user_interests" permission for the authenticated user and "friends_interests" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_interests" or "friends_interests" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getInterests

PagedList<Page> getInterests(PagingParameters pagingParameters)
Retrieves a list of interests that the authenticated user likes. Requires "user_interests" permission. Returns an empty list if permission isn't granted.

Parameters:
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_interests" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getInterests

PagedList<Page> getInterests(String userId,
                             PagingParameters pagingParameters)
Retrieves a list of interests that the given user likes. Requires "user_interests" permission for the authenticated user and "friends_interests" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_interests" or "friends_interests" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getGames

PagedList<Page> getGames()
Retrieves a list of games that the authenticated user likes. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getGames

PagedList<Page> getGames(String userId)
Retrieves a list of games that the given user likes. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" or "friends_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getGames

PagedList<Page> getGames(PagingParameters pagingParameters)
Retrieves a list of games that the authenticated user likes. Requires "user_likes" permission. Returns an empty list if permission isn't granted.

Parameters:
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getGames

PagedList<Page> getGames(String userId,
                         PagingParameters pagingParameters)
Retrieves a list of games that the given user likes. Requires "user_likes" permission for the authenticated user and "friends_likes" for the authenticated user's friends. Returns an empty list if permission isn't granted.

Parameters:
userId - the ID of the user
pagingParameters - the paging parameters for fetching a given range of pages.
Returns:
a list of Page objects
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.
org.springframework.social.InsufficientPermissionException - if the user has not granted "user_likes" or "friends_likes" permission.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.