Package lumis.service.commentit
Class CommentItResource
- java.lang.Object
-
- lumis.service.commentit.CommentItResource
-
@StableMinor(version="14.0", sinceVersion="8.0") @Path("/lumis/service/commentit/rest") public class CommentItResource extends Object
REST API for CommentIt service.- Since:
- 8.0.0
- Version:
- $Revision: 24476 $ $Date: 2021-04-28 11:28:23 -0300 (Wed, 28 Apr 2021) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CommentItResource.CommentsItem
JAXB object used to represent theCommentItResource.CommentsList
of a single item (itemId on a specific CommentIt service instance).static class
CommentItResource.CommentsItemList
JAXB object used to return a list ofCommentItResource.CommentsItem
.static class
CommentItResource.CommentsList
JAXB object used to return a list ofComment
objects.
-
Constructor Summary
Constructors Constructor Description CommentItResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response
addComment(Comment comment)
Adds aComment
.void
deleteComment(String commentId)
Delete theComment
with the identifierComment
getComment(String id)
Returns aComment
by its identifier.CommentItResource.CommentsItemList
getCommentsItems(String serviceInstanceId, List<String> itemIds, Integer limit)
Get the newestComment
objects of the specified items, organized inCommentItResource.CommentsItem
structures, up to the specified amount.
-
-
-
Method Detail
-
addComment
@POST @Path("/comments") @Produces("application/json") @Consumes("application/json") public Response addComment(@NotNull Comment comment) throws PortalException
Adds aComment
.- Parameters:
comment
- theComment
to add.- Returns:
- A
Response
with the path to theComment
and the addedComment
. - Throws:
PortalException
- Since:
- 8.0.0
-
getComment
@GET @Path("/comments/{id:[A-F0-9]{32}}") @Produces("application/json") public Comment getComment(@NotNull @PathParam("id") String id) throws PortalException
Returns aComment
by its identifier.- Parameters:
id
- The identifier of theComment
.- Returns:
- the
Comment
or aResponse.Status.NOT_FOUND
response if not found. - Throws:
PortalException
- Since:
- 8.0.0
-
getCommentsItems
@GET @Path("/comments-items/{serviceInstanceId:[A-F0-9]{32}}") @Produces("application/json") public CommentItResource.CommentsItemList getCommentsItems(@NotNull @PathParam("serviceInstanceId") String serviceInstanceId, @NotNull @NotEmpty @QueryParam("itemIds") List<String> itemIds, @NotNull @QueryParam("limit") Integer limit) throws PortalException
Get the newestComment
objects of the specified items, organized inCommentItResource.CommentsItem
structures, up to the specified amount.- Parameters:
serviceInstanceId
- The instance identifier for the CommentIt service being use.itemIds
- The identifier of the items to retrieve theComment
objects fromlimit
- The maximum number ofComment
objects to get.- Returns:
- A
CommentItResource.CommentsItemList
object with theCommentItResource.CommentsList
with a list ofComment
objects for each item. - Throws:
PortalException
- Since:
- 8.0.0
-
deleteComment
@DELETE @Path("/comments/{commentId:[A-F0-9]{32}}") public void deleteComment(@NotNull @PathParam("commentId") String commentId) throws PortalException
Delete theComment
with the identifier- Parameters:
commentId
- the identifier of theComment
to delete- Throws:
PortalException
- Since:
- 8.0.0
-
-