diff --git a/CHANGELOG.md b/CHANGELOG.md index 90bbd4f..b6b6096 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v1.2.1] - 2023-11-20 + +- Corresponding API calls for all the public functions in Social Networking Library + ## [v1.2.0] - 2022-10-20 - Minor fix on a method name diff --git a/pom.xml b/pom.xml index b083f21..af8e667 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.gcube.social-networking social-service-client - 1.2.0 + 1.2.1-SNAPSHOT social-networking-service-client jar The social networking web service client library diff --git a/src/main/java/org/gcube/social_networking/social_networking_client_library/CommentClient.java b/src/main/java/org/gcube/social_networking/social_networking_client_library/CommentClient.java new file mode 100644 index 0000000..3329e71 --- /dev/null +++ b/src/main/java/org/gcube/social_networking/social_networking_client_library/CommentClient.java @@ -0,0 +1,81 @@ +package org.gcube.social_networking.social_networking_client_library; + +import java.util.ArrayList; +import java.util.List; + +import javax.ws.rs.core.GenericType; + +import org.apache.commons.lang.Validate; +import org.gcube.portal.databook.shared.Comment; +import org.gcube.social_networking.social_networking_client_library.utils.HttpClient; +import org.gcube.social_networking.socialnetworking.model.output.ResponseBean; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Posts client. + * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) + */ +public class CommentClient extends BaseClient{ + + private static final String SUB_SERVICE_PATH = "2/comments/"; + private static Logger logger = LoggerFactory.getLogger(CommentClient.class); + + + public CommentClient() throws Exception { + super(SUB_SERVICE_PATH); + } + + public Comment addCommentLib(Comment comment){ + Validate.isTrue(comment != null, "Comment to write cannot be null"); + + logger.debug("Request for writing comment"); + String thisMethodSignature = "add-comment-lib"; + String request = getServiceEndpoint() + thisMethodSignature; + return HttpClient.post(new GenericType>(){}, request, comment); + } + public Comment readCommentByIdLib(String commentid){ + Validate.isTrue(commentid != null, "Commentid to read cannot be null"); + + logger.debug("Request for reading commentid"); + String thisMethodSignature = "read-comment-by-id-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?commentid=" + commentid; + return HttpClient.get(new GenericType>(){}, request); + } + public List getAllCommentsByPostIdLib(String postid){ + Validate.isTrue(postid != null, "Postid to read cannot be null"); + + logger.debug("Request for reading comments of post"); + String thisMethodSignature = "get-comments-by-post-id-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + postid; + return HttpClient.get(new GenericType>>(){}, request); + } + public List getRecentCommentsByUserAndDateLib(final String userid, + final long timeInMillis){ + + Validate.isTrue(userid != null, "username to read cannot be null"); + + logger.debug("Request for reading recent comments of user"); + String thisMethodSignature = "get-recent-comments-by-user-and-date-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?time=" + timeInMillis + "&username=" + userid; + return HttpClient.get(new GenericType>>(){}, request); + } + + public Comment editCommentLib(Comment comment){ + Validate.isTrue(comment != null, "Comment to write cannot be null"); + + logger.debug("Request for writing comment"); + String thisMethodSignature = "edit-comment-lib"; + String request = getServiceEndpoint() + thisMethodSignature; + return HttpClient.post(new GenericType>(){}, request, comment); + } + + public boolean deleteCommentLib(String commentid, String postid){ + Validate.isTrue(commentid != null, "Comment to write cannot be null"); + + logger.debug("Request for del comment"); + String thisMethodSignature = "delete-comment-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?commentid=" + commentid + "&postid=" + postid; + return HttpClient.post(new GenericType>(){}, request, postid); + } +} diff --git a/src/main/java/org/gcube/social_networking/social_networking_client_library/HashTagClient.java b/src/main/java/org/gcube/social_networking/social_networking_client_library/HashTagClient.java index 7784c77..836604d 100644 --- a/src/main/java/org/gcube/social_networking/social_networking_client_library/HashTagClient.java +++ b/src/main/java/org/gcube/social_networking/social_networking_client_library/HashTagClient.java @@ -1,10 +1,16 @@ package org.gcube.social_networking.social_networking_client_library; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import javax.ws.rs.core.GenericType; +import org.apache.commons.lang.Validate; +import org.gcube.portal.databook.shared.Feed; +import org.gcube.portal.databook.shared.Post; +import org.gcube.portal.databook.shared.ex.*; import org.gcube.social_networking.social_networking_client_library.utils.HttpClient; import org.gcube.social_networking.socialnetworking.model.output.ResponseBean; import org.slf4j.Logger; @@ -35,4 +41,74 @@ public class HashTagClient extends BaseClient{ return HttpClient.get(new GenericType>>(){}, request); } + + + + + //library api calls + public boolean saveHashTagsLib(String feedid, String vreid, List hashtags) { + Validate.isTrue(hashtags != null, "hashtags to write cannot be null"); + + logger.debug("Request for saving hashtags"); + String thisMethodSignature = "save-hashtag-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?feedid=" + feedid + "&vreid=" + vreid; + return HttpClient.post(new GenericType>(){}, request, hashtags); + } + + public boolean deleteHashTagsLib(String feedid, String vreid, List hashtags) { + Validate.isTrue(hashtags != null, "hashtags to delete cannot be null"); + + logger.debug("Request for deleting hashtags"); + String thisMethodSignature = "delete-hashtag-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?feedid=" + feedid + "&vreid=" + vreid; + return HttpClient.post(new GenericType>(){}, request, hashtags); + } + + public boolean saveHashTagsCommentLib(String commentId, String vreid, List hashtags){ + Validate.isTrue(hashtags != null, "hashtags to comment cannot be null"); + + logger.debug("Request for saving hashtags comment"); + String thisMethodSignature = "save-hashtag-comment-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?commentid=" + commentId + "&vreid=" + vreid; + return HttpClient.post(new GenericType>(){}, request, hashtags); + } + + public boolean deleteHashTagsCommentLib(String commentId, String vreid, List hashtags) { + Validate.isTrue(hashtags != null, "hashtags to comment delete cannot be null"); + + logger.debug("Request for deleting hashtags comment"); + String thisMethodSignature = "delete-hashtag-comment-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?commentid=" + commentId + "&vreid=" + vreid; + return HttpClient.post(new GenericType>(){}, request, hashtags); + } + + public Map getVREHashtagsWithOccurrenceLib(String vreid) { + logger.debug("Request for vre hashtags occurrences"); + String thisMethodSignature = "get-vre-hashtags-occurrences-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid; + return HttpClient.get(new GenericType>>(){}, request); + } + + public Map getVREHashtagsWithOccurrenceFilteredByTimeLib(String vreid, long timestamp){ + logger.debug("Request for vre hashtags occurrences with time"); + String thisMethodSignature = "get-vre-hashtags-occurrences-time-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&time=" + timestamp; + return HttpClient.get(new GenericType>>(){}, request); + } + + + public List getVREFeedsByHashtagLib(String vreid, String hashtag){ + logger.debug("Request for vre of hashtags"); + String thisMethodSignature = "get-vre-feed-by-hashtag-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&hashtag=" + hashtag; + return HttpClient.get(new GenericType>>(){}, request); + + } + public List getVREPostsByHashtagLib(String vreid, String hashtag){ + logger.debug("Request for vre of hashtags"); + String thisMethodSignature = "get-vre-post-by-hashtag-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&hashtag=" + hashtag; + return HttpClient.get(new GenericType>>(){}, request); + } + } diff --git a/src/main/java/org/gcube/social_networking/social_networking_client_library/InviteClient.java b/src/main/java/org/gcube/social_networking/social_networking_client_library/InviteClient.java new file mode 100644 index 0000000..229e2af --- /dev/null +++ b/src/main/java/org/gcube/social_networking/social_networking_client_library/InviteClient.java @@ -0,0 +1,73 @@ +package org.gcube.social_networking.social_networking_client_library; + +import java.util.ArrayList; +import java.util.List; + +import javax.ws.rs.core.GenericType; + +import org.apache.commons.lang.Validate; +import org.gcube.portal.databook.shared.Invite; +import org.gcube.portal.databook.shared.InviteOperationResult; +import org.gcube.portal.databook.shared.InviteStatus; +import org.gcube.social_networking.social_networking_client_library.utils.HttpClient; +import org.gcube.social_networking.socialnetworking.model.output.ResponseBean; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Posts client. + * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) + */ +public class InviteClient extends BaseClient{ + + private static final String SUB_SERVICE_PATH = "2/invites/"; + private static Logger logger = LoggerFactory.getLogger(InviteClient.class); + + + public InviteClient() throws Exception { + super(SUB_SERVICE_PATH); + } + + public String isExistingInviteLib(String vreid, String email){ + Validate.isTrue(email != null, "email to invite cannot be null"); + + logger.debug("Request for inviting to vre"); + String thisMethodSignature = "is-existing-invite-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&email=" + email; + return HttpClient.get(new GenericType>(){}, request); + } + public InviteOperationResult saveInviteLib(Invite invite){ + Validate.isTrue(invite != null, "likeid to unlike cannot be null"); + + logger.debug("Request for saving invite"); + String thisMethodSignature = "save-invite-lib"; + String request = getServiceEndpoint() + thisMethodSignature; + return HttpClient.post(new GenericType>(){}, request, invite); + } + public Invite readInviteLib(String inviteid){ + Validate.isTrue(inviteid != null, "inviteid to read likes cannot be null"); + + logger.debug("Request for reading invite"); + String thisMethodSignature = "read-invite-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?inviteid=" + inviteid; + return HttpClient.get(new GenericType>(){}, request); + } + public boolean setInviteStatusLib(String vreid, String email, InviteStatus status){ + Validate.isTrue(status != null, "status to set cannot be null"); + + logger.debug("Request for setting invite status"); + String thisMethodSignature = "set-invite-status-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&email=" + email; + return HttpClient.post(new GenericType>(){}, request, status); + } + + public List getInvitedEmailsByVRELib(String vreid, InviteStatus... status){ + Validate.isTrue(status != null, "status to get cannot be null"); + + logger.debug("Request for getting email invites"); + String thisMethodSignature = "get-invited-email-by-vre-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid; + return HttpClient.post(new GenericType>>(){}, request, status); + } + +} diff --git a/src/main/java/org/gcube/social_networking/social_networking_client_library/LikeClient.java b/src/main/java/org/gcube/social_networking/social_networking_client_library/LikeClient.java new file mode 100644 index 0000000..e386c7a --- /dev/null +++ b/src/main/java/org/gcube/social_networking/social_networking_client_library/LikeClient.java @@ -0,0 +1,62 @@ +package org.gcube.social_networking.social_networking_client_library; + +import java.util.ArrayList; +import java.util.List; + +import javax.ws.rs.core.GenericType; + +import org.apache.commons.lang.Validate; +import org.gcube.portal.databook.shared.Like; +import org.gcube.social_networking.social_networking_client_library.utils.HttpClient; +import org.gcube.social_networking.socialnetworking.model.output.ResponseBean; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Posts client. + * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) + */ +public class LikeClient extends BaseClient{ + + private static final String SUB_SERVICE_PATH = "2/likes/"; + private static Logger logger = LoggerFactory.getLogger(LikeClient.class); + + + public LikeClient() throws Exception { + super(SUB_SERVICE_PATH); + } + + public boolean likeLib(Like like){ + Validate.isTrue(like != null, "like to write cannot be null"); + + logger.debug("Request for liking post"); + String thisMethodSignature = "like-lib"; + String request = getServiceEndpoint() + thisMethodSignature; + return HttpClient.post(new GenericType>(){}, request, like); + } + public boolean unlikeLib(String userid, String likeid, String feedid){ + Validate.isTrue(likeid != null, "likeid to unlike cannot be null"); + + logger.debug("Request for unliking post"); + String thisMethodSignature = "unlike-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&likeid=" + likeid + "&feedid=" + feedid ; + return HttpClient.post(new GenericType>(){}, request, likeid); + } + public ListgetAllLikedPostIdsByUserLib(String userid){ + Validate.isTrue(userid != null, "userid to read likes cannot be null"); + + logger.debug("Request for reading likes of user"); + String thisMethodSignature = "get-all-liked-posts-by-user-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid; + return HttpClient.get(new GenericType>>(){}, request); + } + public ListgetAllLikesByPostLib(String postid){ + Validate.isTrue(postid != null, "postid to read likes cannot be null"); + + logger.debug("Request for reading likes of post"); + String thisMethodSignature = "get-all-likes-by-post-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + postid; + return HttpClient.get(new GenericType>>(){}, request); + } + +} diff --git a/src/main/java/org/gcube/social_networking/social_networking_client_library/NotificationClient.java b/src/main/java/org/gcube/social_networking/social_networking_client_library/NotificationClient.java index 867d435..9a9b647 100644 --- a/src/main/java/org/gcube/social_networking/social_networking_client_library/NotificationClient.java +++ b/src/main/java/org/gcube/social_networking/social_networking_client_library/NotificationClient.java @@ -1,12 +1,20 @@ package org.gcube.social_networking.social_networking_client_library; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.ws.rs.core.GenericType; import org.apache.commons.lang.Validate; import org.gcube.portal.databook.shared.Notification; +import org.gcube.portal.databook.shared.NotificationChannelType; +import org.gcube.portal.databook.shared.NotificationType; +import org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException; +import org.gcube.portal.databook.shared.ex.NotificationChannelTypeNotFoundException; +import org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException; +import org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException; import org.gcube.social_networking.social_networking_client_library.utils.HttpClient; import org.gcube.social_networking.socialnetworking.model.beans.JobNotificationBean; import org.gcube.social_networking.socialnetworking.model.beans.catalogue.CatalogueEvent; @@ -40,7 +48,7 @@ public class NotificationClient extends BaseClient{ public List getNotifications(int from, int quantity){ Validate.isTrue(from >= 1, "From cannot be negative"); - Validate.isTrue(from >= 0, "Quantity cannot be negative"); + Validate.isTrue(quantity >= 0, "Quantity cannot be negative"); logger.debug("Request for getting notifications"); String thisMethodSignature = "get-range-notifications"; @@ -90,4 +98,98 @@ public class NotificationClient extends BaseClient{ } + + + //library api + + public boolean saveNotificationLib(Notification n){ + Validate.isTrue(n != null, "Notification cannot be null"); + logger.debug("Request for saving notification"); + String thisMethodSignature = "save-notification-lib"; + String request = getServiceEndpoint() + thisMethodSignature; + return HttpClient.post(new GenericType>(){}, request, n); + } + public Notification readNotificationLib(String notificationid){ + logger.debug("Request for getting notification by id"); + String thisMethodSignature = "read-notification-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?notid=" + notificationid; + return HttpClient.get(new GenericType>(){}, request); + } + public boolean setNotificationReadLib(String notificationid){ + Validate.isTrue(notificationid != null, "Notificationid cannot be null"); + logger.debug("Request for setting notification read"); + String thisMethodSignature = "set-notification-read-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?notid=" + notificationid;; + return HttpClient.post(new GenericType>(){}, request, notificationid); + } + + public List getAllNotificationByUserLib(String userid, int limit) { + logger.debug("Request for getting notification by user"); + String thisMethodSignature = "get-all-notifications-user"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&limit=" + limit; + return HttpClient.get(new GenericType>>(){}, request); + } + + public List getUnreadNotificationsByUserLib(String userid) { + logger.debug("Request for getting unread notification by user"); + String thisMethodSignature = "get-unread-notifications-user"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid; + return HttpClient.get(new GenericType>>(){}, request); + } + + public List getRangeNotificationsByUserLib(String userid,int from, int quantity) { + logger.debug("Request for getting range notification by user"); + String thisMethodSignature = "get-range-notifications-user"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&from=" + from + "&quantity=" + quantity; + return HttpClient.get(new GenericType>>(){}, request); + } + + public boolean setAllNotificationReadByUserLib(String userid) { + Validate.isTrue(userid != null, "userid cannot be null"); + logger.debug("Request for setting all notification read"); + String thisMethodSignature = "set-all-notification-read-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;; + return HttpClient.post(new GenericType>(){}, request, userid); + } + public boolean checkUnreadNotificationsLib(String userid) { + Validate.isTrue(userid != null, "userid cannot be null"); + logger.debug("Request for check unread notifications"); + String thisMethodSignature = "check-unread-notification-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;; + return HttpClient.post(new GenericType>(){}, request, userid); + } + public boolean checkUnreadMessagesNotificationsLib(String userid) { + Validate.isTrue(userid != null, "userid cannot be null"); + logger.debug("Request for check unread messages notifications"); + String thisMethodSignature = "check-unread-messages-notification-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;; + return HttpClient.post(new GenericType>(){}, request, userid); + + } + + public List getUserNotificationChannelsLib(String userid, NotificationType notificationType) { + Validate.isTrue(userid != null, "userid cannot be null"); + logger.debug("Request for get user notification channels"); + String thisMethodSignature = "get-user-notification-channels-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid; + return HttpClient.post(new GenericType>>(){}, request, notificationType); + + } + + public boolean setUserNotificationPreferencesLib(String userid, Map enabledChannels){ + Validate.isTrue(userid != null, "userid cannot be null"); + logger.debug("Request for set user notification preferences"); + String thisMethodSignature = "set-notification-preference-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;; + return HttpClient.post(new GenericType>(){}, request, enabledChannels); + + } + + public Map getUserNotificationPreferencesLib(String userid){ + Validate.isTrue(userid != null, "userid cannot be null"); + logger.debug("Request for getting notification preferences"); + String thisMethodSignature = "get-notification-preference-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;; + return HttpClient.get(new GenericType>>(){}, request); + } } diff --git a/src/main/java/org/gcube/social_networking/social_networking_client_library/PostClient.java b/src/main/java/org/gcube/social_networking/social_networking_client_library/PostClient.java index c909791..1de15f7 100644 --- a/src/main/java/org/gcube/social_networking/social_networking_client_library/PostClient.java +++ b/src/main/java/org/gcube/social_networking/social_networking_client_library/PostClient.java @@ -8,8 +8,8 @@ import java.util.List; import javax.ws.rs.core.GenericType; import org.apache.commons.lang.Validate; -import org.gcube.portal.databook.shared.Feed; -import org.gcube.portal.databook.shared.Post; +import org.gcube.portal.databook.shared.*; + import org.gcube.social_networking.social_networking_client_library.utils.HttpClient; import org.gcube.social_networking.socialnetworking.model.beans.PostInputBean; import org.gcube.social_networking.socialnetworking.model.output.ResponseBean; @@ -184,4 +184,141 @@ public class PostClient extends BaseClient{ } + + + //library api calls + + public boolean saveUserPostLib(Post post){ + Validate.isTrue(post != null, "Post to write cannot be null"); + + logger.debug("Request for save user post"); + String thisMethodSignature = "save-user-post-lib"; + String request = getServiceEndpoint() + thisMethodSignature; + return HttpClient.post(new GenericType>(){}, request, post); + } //bool + + public boolean saveAttachmentEntryLib(String key, Attachment attachment){ + Validate.isTrue(attachment != null, "attachment to write cannot be null"); + + logger.debug("Request for save attachment"); + String thisMethodSignature = "save-attachment-entry-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + key; + return HttpClient.post(new GenericType>(){}, request, attachment); + } + + public boolean saveAppPostLib(Post post){ + Validate.isTrue(post != null, "Post to write cannot be null"); + + logger.debug("Request for saving application post"); + String thisMethodSignature = "save-app-post-lib"; + String request = getServiceEndpoint() + thisMethodSignature; + return HttpClient.post(new GenericType>(){}, request, post); + } //bool + + public boolean savePostToVRETimelineLib(String postkey, String vreid){ + Validate.isTrue(postkey != null, "Post to write cannot be null"); + + logger.debug("Request for writing post to vretimeline"); + String thisMethodSignature = "save-post-to-vretimeline-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + postkey + "&vreid=" + vreid; + return HttpClient.post(new GenericType>(){}, request, postkey); + } //bool + + public Post readPostLib(String postid){ + logger.debug("Request for getting post with id"); + String thisMethodSignature = "read-post-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + postid; + return HttpClient.get(new GenericType>(){}, request); + } //post + + public List getRecentPostsByUserAndDateLib(String userid, long timeinmillis){ + logger.debug("Request for getting recent posts by user"); + String thisMethodSignature = "get-recent-posts-by-user-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&time=" + timeinmillis; + return HttpClient.get(new GenericType>>(){}, request); + } //list + + public boolean deletePostLib(String postid){ + Validate.isTrue(postid != null, "feed to delete cannot be null"); + + logger.debug("Request for delete user post"); + String thisMethodSignature = "delete-post-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + postid; + return HttpClient.post(new GenericType>(){}, request, postid); + } //bool + + public List getAllPostsByUserLib(String userid) { + logger.debug("Request for getting all posts by user"); + String thisMethodSignature = "get-all-posts-by-user-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid ; + return HttpClient.get(new GenericType>>(){}, request); + } + + public List getAllPostsByAppLib(String appid) { + logger.debug("Request for getting all posts by app"); + String thisMethodSignature = "get-all-posts-by-app-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?appid=" + appid ; + return HttpClient.get(new GenericType>>(){}, request); + + } + + public List getRecentCommentedPostsByUserAndDateLib(String userid, + long timeInMillis) { + logger.debug("Request for getting recent commented posts by user and date"); + String thisMethodSignature = "get-recent-commented-posts-by-user-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&time=" + timeInMillis; + return HttpClient.get(new GenericType>>(){}, request); + + } + + public List getAllPortalPrivacyLevelPostsLib(){ + logger.debug("Request for getting portal privacy level posts"); + String thisMethodSignature = "get-portal-privacy-level-posts-lib"; + String request = getServiceEndpoint() + thisMethodSignature; + return HttpClient.get(new GenericType>>(){}, request); + } //list + + public List getRecentPostsByUserLib(String userid, int quantity) { + logger.debug("Request for getting recent posts by user"); + String thisMethodSignature = "get-recent-posts-by-user-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&quantity=" + quantity ; + return HttpClient.get(new GenericType>>(){}, request); + } + + public List getAllPostsByVRELib(String vreid) { + logger.debug("Request for getting all posts by vre"); + String thisMethodSignature = "get-all-posts-by-vre-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid ; + return HttpClient.get(new GenericType>>(){}, request); + } + + public List getRecentPostsByVRELib(String vreid, int quantity) { + logger.debug("Request for getting recent posts by vre"); + String thisMethodSignature = "get-recent-posts-by-vre-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&quantity=" + quantity ; + return HttpClient.get(new GenericType>>(){}, request); + + } + + public RangePosts getRecentPostsByVREAndRangeLib(String vreid, int from, int quantity) { + logger.debug("Request for getting recent posts by vre and range"); + String thisMethodSignature = "get-recent-posts-by-vre-range-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&from=" + from + "&quantity=" + quantity; + return HttpClient.get(new GenericType>(){}, request); + } + + public List getAttachmentsByFeedIdLib(String feedId) { + logger.debug("Request for getting attachment by postid"); + String thisMethodSignature = "get-attachment-by-postid-lib"; + String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + feedId ; + return HttpClient.get(new GenericType>>(){}, request); + } + + public List getAllVREIdsLib(){ + logger.debug("Request for getting all vre ids"); + String thisMethodSignature = "get-all-vre-ids-lib"; + String request = getServiceEndpoint() + thisMethodSignature ; + return HttpClient.get(new GenericType>>(){}, request); + } + }