org.springframework.social.facebook.api
Interface CommentOperations


public interface CommentOperations

Defines operations for reading and posting comments to Facebook.


Method Summary
 String addComment(String objectId, String message)
          Posts a comment on an object on behalf of the authenticated user.
 void deleteComment(String commentId)
          Deletes a comment.
 Comment getComment(String commentId)
          Retrieves a single comment
 PagedList<Comment> getComments(String objectId)
          Retrieves the first 25 comments for a given object.
 PagedList<Comment> getComments(String objectId, int offset, int limit)
          Deprecated. Use getComments(String, PagingParameters) instead
 PagedList<Comment> getComments(String objectId, PagingParameters pagedListParameters)
          Retrieves comments for a given object.
 PagedList<Reference> getLikes(String objectId)
          Retrieve a list of references to users who have liked a given object.
 

Method Detail

getComments

PagedList<Comment> getComments(String objectId)
Retrieves the first 25 comments for a given object.

Parameters:
objectId - the ID of the object
Returns:
a list of Comments for the specified object
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getComments

@Deprecated
PagedList<Comment> getComments(String objectId,
                                          int offset,
                                          int limit)
Deprecated. Use getComments(String, PagingParameters) instead

Retrieves comments for a given object.

Parameters:
objectId - the ID of the object
offset - the offset into the list of comments to start retrieving comments
limit - the maximum number of comments to retrieve
Returns:
a list of Comments for the specified object
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getComments

PagedList<Comment> getComments(String objectId,
                               PagingParameters pagedListParameters)
Retrieves comments for a given object.

Parameters:
objectId - the ID of the object
pagedListParameters - the parameters defining the bounds of the list to return.
Returns:
a list of Comments for the specified object
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

getComment

Comment getComment(String commentId)
Retrieves a single comment

Parameters:
commentId - the comment ID
Returns:
the requested Comment
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.

addComment

String addComment(String objectId,
                  String message)
Posts a comment on an object on behalf of the authenticated user. Requires "publish_stream" permission.

Parameters:
objectId - the object ID
message - the comment message
Returns:
the new comment's 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.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

deleteComment

void deleteComment(String commentId)
Deletes a comment. Requires "publish_stream" permission.

Parameters:
commentId - the comment 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.
org.springframework.social.MissingAuthorizationException - if FacebookTemplate was not created with an access token.

getLikes

PagedList<Reference> getLikes(String objectId)
Retrieve a list of references to users who have liked a given object.

Parameters:
objectId -
Returns:
a list of References
Throws:
org.springframework.social.ApiException - if there is an error while communicating with Facebook.