Package lumis.service.commentit
Class CommentItResource
- java.lang.Object
-
- lumis.service.commentit.CommentItResource
-
@StableMinor(version="17.0", sinceVersion="8.0") @Path("/lumis/service/commentit/rest") public class CommentItResource extends java.lang.Object
REST API for CommentIt service.- Since:
- 8.0.0
- Version:
- $Revision$ $Date$
-
-
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 javax.ws.rs.core.Response
addComment(@NotNull Comment comment)
Adds aComment
.void
deleteComment(@NotNull java.lang.String commentId)
Delete theComment
with the identifierComment
getComment(@NotNull java.lang.String id)
Returns aComment
by its identifier.CommentItResource.CommentsItemList
getCommentsItems(@NotNull java.lang.String serviceInstanceId, @NotNull @NotEmpty java.util.List<java.lang.String> itemIds, @NotNull java.lang.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 javax.ws.rs.core.Response addComment(@NotNull @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") @NotNull java.lang.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") @NotNull java.lang.String serviceInstanceId, @NotNull @NotEmpty @QueryParam("itemIds") @NotNull @NotEmpty java.util.List<java.lang.String> itemIds, @NotNull @QueryParam("limit") @NotNull java.lang.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") @NotNull java.lang.String commentId) throws PortalException
Delete theComment
with the identifier- Parameters:
commentId
- the identifier of theComment
to delete- Throws:
PortalException
- Since:
- 8.0.0
-
-