ccc.api.jaxrs
Class CommentsImpl

java.lang.Object
  extended by ccc.api.jaxrs.JaxrsCollection
      extended by ccc.api.jaxrs.CommentsImpl
All Implemented Interfaces:
Comments

public class CommentsImpl
extends JaxrsCollection
implements Comments

JAX-RS implementation of the Comments interface.

Author:
Civic Computing Ltd.

Field Summary
 
Fields inherited from interface ccc.api.core.Comments
NAME
 
Constructor Summary
CommentsImpl(Comments comments)
          Constructor.
 
Method Summary
 Comment create(Comment comment)
          Create a new comment in CCC.
 void delete(java.util.UUID commentId)
          Delete an existing comment.
 PagedCollection<Comment> query(java.util.UUID resourceId, CommentStatus status, java.lang.String sort, SortOrder sortOrder, int pageNo, int pageSize)
          List existing comments.
 Comment retrieve(java.util.UUID commentId)
          Retrieve the comment using its ID.
 Comment update(java.util.UUID commentId, Comment comment)
          Update the specified comment.
 
Methods inherited from class ccc.api.jaxrs.JaxrsCollection
convertException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommentsImpl

public CommentsImpl(Comments comments)
Constructor.

Parameters:
comments - The comments implementation delegated to.
Method Detail

create

public Comment create(Comment comment)
Create a new comment in CCC.

Specified by:
create in interface Comments
Parameters:
comment - The comment to create.
Returns:
Return the newly created comment.

retrieve

public Comment retrieve(java.util.UUID commentId)
Retrieve the comment using its ID.

Specified by:
retrieve in interface Comments
Parameters:
commentId - The comment's ID.
Returns:
Return the corresponding comment.

update

public Comment update(java.util.UUID commentId,
                      Comment comment)
Update the specified comment.

Specified by:
update in interface Comments
Parameters:
commentId - The comment's ID.
comment - The updated comment.
Returns:
The updated comment.

delete

public void delete(java.util.UUID commentId)
Delete an existing comment.

Specified by:
delete in interface Comments
Parameters:
commentId - The comment's ID.

query

public PagedCollection<Comment> query(java.util.UUID resourceId,
                                      CommentStatus status,
                                      java.lang.String sort,
                                      SortOrder sortOrder,
                                      int pageNo,
                                      int pageSize)
List existing comments.

Specified by:
query in interface Comments
Parameters:
resourceId - Filter comments by resource. NULL will return all.
status - Filter comments based on status. NULL will return all.
sort - The field to sort on.
sortOrder - The order results be sorted in.
pageNo - The page of results to return.
pageSize - The number of results in a page.
Returns:
A list of comments.


Copyright © 2010. All Rights Reserved.