org.wso2.carbon.registry.rest.api
Class Comment

java.lang.Object
  extended by org.wso2.carbon.registry.rest.api.RegistryRestSuper
      extended by org.wso2.carbon.registry.rest.api.Comment

public class Comment
extends RegistryRestSuper

This class is to handle REST verbs GET , PSST and DELETE.


Constructor Summary
Comment()
           
 
Method Summary
 javax.ws.rs.core.Response addComment(String resourcePath, String commentText, String JWTToken)
          This method to add comment for given resource.
 javax.ws.rs.core.Response deleteComment(String resourcePath, long commentId, String JWTToken)
          This method deletes the specific comment(using id) on the given resource
 javax.ws.rs.core.Response editComment(String resourcePath, long commentId, String commentText, String JWTToken)
          This method to update the given comment (using comment id).
 javax.ws.rs.core.Response getComment(String resourcePath, long commentId, String JWTToken)
          This method get a specific comment of the given resource
 
Methods inherited from class org.wso2.carbon.registry.rest.api.RegistryRestSuper
getBegin, getEnd, getPageSize, getResourcePath, getTenantID, getUserRegistry, getUserRegistry, setBegin, setEnd, setPageSize, setUserRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Comment

public Comment()
Method Detail

getComment

public javax.ws.rs.core.Response getComment(String resourcePath,
                                            long commentId,
                                            @HeaderParam(value="X-JWT-Assertion")
                                            String JWTToken)
This method get a specific comment of the given resource

Parameters:
resourcePath - - Registry path of the resource.
commentId - - Comment id.
Returns:
CommentModel JSON object. HTTP 200 OK.

addComment

public javax.ws.rs.core.Response addComment(String resourcePath,
                                            String commentText,
                                            @HeaderParam(value="X-JWT-Assertion")
                                            String JWTToken)
This method to add comment for given resource.

Parameters:
resourcePath - - Resource path.
commentText - - Comment to be added.
Returns:
CommentModel object. HTTP 204 No Content.

editComment

public javax.ws.rs.core.Response editComment(String resourcePath,
                                             long commentId,
                                             String commentText,
                                             @HeaderParam(value="X-JWT-Assertion")
                                             String JWTToken)
This method to update the given comment (using comment id).

Parameters:
resourcePath - - resource path
commentId - - id of the specific comment
commentText - - comment to be added
Returns:
CommentModel object. HTTP 204 No Content.

deleteComment

public javax.ws.rs.core.Response deleteComment(String resourcePath,
                                               long commentId,
                                               @HeaderParam(value="X-JWT-Assertion")
                                               String JWTToken)
This method deletes the specific comment(using id) on the given resource

Parameters:
resourcePath - - registry path of the resource
commentId - - ID of the comment to be deleted
Returns:
Response , HTTP 204 No Content.


Copyright © 2015 WSO2. All rights reserved.