Spring Social Facebook

org.springframework.social.facebook.api
Interface CommentOperations


public interface CommentOperations

Defines operations for reading and posting comments to Facebook.

Author:
Craig Walls

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

Method Detail

getComments

java.util.List<Comment> getComments(java.lang.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

java.util.List<Comment> getComments(java.lang.String objectId,
                                    int offset,
                                    int limit)
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.

getComment

Comment getComment(java.lang.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

java.lang.String addComment(java.lang.String objectId,
                            java.lang.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(java.lang.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

java.util.List<Reference> getLikes(java.lang.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.

Spring Social Facebook