Class Posts
- java.lang.Object
-
- org.gcube.portal.social.networking.ws.methods.v2.Posts
-
@Path("2/posts") public class Posts extends ObjectREST interface for the social networking library (posts).
-
-
Constructor Summary
Constructors Constructor Description Posts()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.ResponsegetAllLikedPostIdsByUser()Retrieve ids (UUID) of the liked posts by the userjavax.ws.rs.core.ResponsegetAllLikedPostsByUser(int limit)Retrieve posts liked by the userjavax.ws.rs.core.ResponsegetAllPostsByApp()Retrieve the application's postsjavax.ws.rs.core.ResponsegetAllPostsByUser()Retrieve all user's postsjavax.ws.rs.core.ResponsegetAllPostsByVRE()javax.ws.rs.core.ResponsegetPost(String id)Retrieve a post by idjavax.ws.rs.core.ResponsegetPostsByHashTags(String hashtag)Retrieve posts containing the hashtag in the context bound to the auth tokenjavax.ws.rs.core.ResponsegetQuantityPostsByUser(int quantity)Retrieve a given quantity of latest user's postsjavax.ws.rs.core.ResponsegetRecentPostsByUserAndDate(long timeInMillis)Retrieve posts of the auth token's owner, and allow to filter them by time"javax.ws.rs.core.ResponsegetRecentPostsByVREAndRange(int from, int quantity)return the most recent posts for this vre up to quantity param and the last index of the posts in the timeline lastReturnedPostTimelineIndex is useful to know from where to start the range the next time you ask, because there are deletionsjavax.ws.rs.core.ResponsewritePostApp(PostInputBean post)Create a new application post having as owner-application the token's owner (the IAM Client), note that the application must be registered on the Information Systemjavax.ws.rs.core.ResponsewritePostUser(PostInputBean post)Create a new user post having as owner the auth token's owner
-
-
-
Method Detail
-
getRecentPostsByUserAndDate
@GET @Path("get-posts-user-since/") @Produces("application/json") public javax.ws.rs.core.Response getRecentPostsByUserAndDate(@QueryParam("time") @Min(value=0L,message="time cannot be negative") long timeInMillis) throws javax.validation.ValidationExceptionRetrieve posts of the auth token's owner, and allow to filter them by time"- Parameters:
timeInMillis- The reference time since when retrieving posts- Returns:
- the posts
- Throws:
javax.validation.ValidationException
-
getAllPostsByUser
@GET @Path("get-posts-user/") @Produces("application/json") public javax.ws.rs.core.Response getAllPostsByUser()Retrieve all user's posts- Returns:
- all posts of the auth token's owner in the context identified by the token
-
getPost
@GET @Path("get-post/") @Produces("application/json") public javax.ws.rs.core.Response getPost(@QueryParam("id") String id)Retrieve a post by id- Returns:
- the post if the post id belongs to a post in the context identified by the token
-
getQuantityPostsByUser
@GET @Path("get-posts-user-quantity/") @Produces("application/json") public javax.ws.rs.core.Response getQuantityPostsByUser(@DefaultValue("10") @QueryParam("quantity") @Min(value=0L,message="quantity cannot be negative") int quantity) throws javax.validation.ValidationExceptionRetrieve a given quantity of latest user's posts- Parameters:
quantity- the number of latest post to get- Returns:
- all posts of the auth token's owner in the context identified by the token, in reverse chronological order up to quantity (at most)
- Throws:
javax.validation.ValidationException
-
writePostUser
@POST @Path("write-post-user") @Consumes("application/json") @Produces("application/json") public javax.ws.rs.core.Response writePostUser(@NotNull(message="Post to write is missing") PostInputBean post) throws javax.validation.ValidationExceptionCreate a new user post having as owner the auth token's owner- Parameters:
post- The post to be written- Returns:
- Throws:
javax.validation.ValidationException
-
getAllPostsByApp
@GET @Path("get-posts-app/") @Produces("application/json") public javax.ws.rs.core.Response getAllPostsByApp()Retrieve the application's posts- Returns:
- the application (IAM Client) posts belonging to the token's owner (i.e., an application)"
-
writePostApp
@POST @Path("write-post-app") @Consumes("application/json") @Produces("application/json") public javax.ws.rs.core.Response writePostApp(@NotNull(message="Post to write is null") PostInputBean post)Create a new application post having as owner-application the token's owner (the IAM Client), note that the application must be registered on the Information System- Parameters:
post- The post to be written- Returns:
-
getAllPostsByVRE
@GET @Path("get-posts-vre/") @Produces("application/json") public javax.ws.rs.core.Response getAllPostsByVRE()- Returns:
- all the posts in the context bound to the auth token
-
getRecentPostsByVREAndRange
@GET @Path("get-recent-posts-vre-by-range/") @Produces("application/json") public javax.ws.rs.core.Response getRecentPostsByVREAndRange(@QueryParam("from") @Min(value=1L,message="from cannot be negative") int from, @QueryParam("quantity") @Min(value=1L,message="quantity cannot be negative") int quantity) throws javax.validation.ValidationExceptionreturn the most recent posts for this vre up to quantity param and the last index of the posts in the timeline lastReturnedPostTimelineIndex is useful to know from where to start the range the next time you ask, because there are deletions- Parameters:
from- the range start (most recent feeds for this vre) has to be greater than 0quantity- the number of most recent feeds for this vre starting from "from" param- Returns:
- a
RangePosts containing of most recent feeds for this vre - Throws:
org.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionjavax.validation.ValidationException
-
getPostsByHashTags
@GET @Path("get-posts-by-hashtag/") @Produces("application/json") public javax.ws.rs.core.Response getPostsByHashTags(@QueryParam("hashtag") @NotNull(message="hashtag cannot be missing") String hashtag) throws javax.validation.ValidationExceptionRetrieve posts containing the hashtag in the context bound to the auth token- Parameters:
hashtag- he hashtag to be contained within the posts- Returns:
- the posts in the context bound to the auth token matching the hashtag
- Throws:
javax.validation.ValidationException
-
getAllLikedPostIdsByUser
@GET @Path("get-id-liked-posts/") @Produces("application/json") public javax.ws.rs.core.Response getAllLikedPostIdsByUser()Retrieve ids (UUID) of the liked posts by the user- Returns:
- ids (UUID) of the liked posts by the user in the context bound to the auth token
-
getAllLikedPostsByUser
@GET @Path("get-liked-posts/") @Produces("application/json") public javax.ws.rs.core.Response getAllLikedPostsByUser(@DefaultValue("10") @QueryParam("limit") @Min(message="limit cannot be negative",value=0L) int limit) throws javax.validation.ValidationExceptionRetrieve posts liked by the user- Parameters:
limit- The maximum number of posts to be retrieved- Returns:
- posts liked by the user (up to a given quantity) in the context bound to the auth token
- Throws:
javax.validation.ValidationException
-
-