Package org.gcube.portal.databook.server
Interface DatabookStore
- All Known Implementing Classes:
DBCassandraAstyanaxImpl
public interface DatabookStore
- Author:
- Massimiliano Assante ISTI-CNR, Costantino Perciante ISTI-CNR
DatabookStoreis the high level interface for querying and adding data to DatabookStore
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddComment(org.gcube.portal.databook.shared.Comment comment) add a comment to a feedbooleanapproveFriendship(String from, String to) userid from approves a friendship to userid tobooleanbooleancheckUnreadNotifications(String userid) voidclose the connection to the underlying databasebooleandeleteComment(String commentid, String feedid) deletes a commentbooleandeleteFeed(String feedid) Deprecated.use saveUserPostbooleandeleteHashTags(String postid, String vreid, List<String> hashtags) booleandeleteHashTagsComment(String commentId, String vreid, List<String> hashtags) booleandeletePost(String postid) delete a Feed from the storebooleandenyFriendship(String from, String to) userid from denies a friendship to userid tobooleaneditComment(org.gcube.portal.databook.shared.Comment comment) edit a commentList<org.gcube.portal.databook.shared.Comment>getAllCommentByFeed(String feedid) Deprecated.use getAllCommentByPostList<org.gcube.portal.databook.shared.Comment>getAllCommentByPost(String postid) List<org.gcube.portal.databook.shared.Feed>getAllFeedsByApp(String appid) Deprecated.use getAllPostsByApp insteadList<org.gcube.portal.databook.shared.Feed>getAllFeedsByUser(String userid) Deprecated.use getAllPostsByUser insteadList<org.gcube.portal.databook.shared.Feed>getAllFeedsByVRE(String vreid) Deprecated.use getAllPostsByVREgetAllLikedFeedIdsByUser(String userid) Deprecated.use getAllLikedPostIdsByUserList<org.gcube.portal.databook.shared.Feed>getAllLikedFeedsByUser(String userid, int limit) Deprecated.use getAllLikedPostsByUsergetAllLikedPostIdsByUser(String userid) List<org.gcube.portal.databook.shared.Post>getAllLikedPostsByUser(String userid, int limit) List<org.gcube.portal.databook.shared.Like>getAllLikesByFeed(String postid) Deprecated.use getAllLikesByPostList<org.gcube.portal.databook.shared.Like>getAllLikesByPost(String postid) List<org.gcube.portal.databook.shared.Notification>getAllNotificationByUser(String userid, int limit) List<org.gcube.portal.databook.shared.Feed>Deprecated.use getAllPortalPrivacyLevelPosts instead return all the feeds whose Level is PORTALList<org.gcube.portal.databook.shared.Post>return all the feeds whose Level is PORTALList<org.gcube.portal.databook.shared.Post>getAllPostsByApp(String appid) List<org.gcube.portal.databook.shared.Post>getAllPostsByUser(String userid) List<org.gcube.portal.databook.shared.Post>getAllPostsByVRE(String vreid) Retrieve all the ids of the vreList<org.gcube.portal.databook.shared.Attachment>getAttachmentsByFeedId(String feedId) getFriends(String userid) List<org.gcube.portal.databook.shared.Invite>getInvitedEmailsByVRE(String vreid, org.gcube.portal.databook.shared.InviteStatus... status) Use to get the list of invites per VREgetPendingFriendRequests(String userid) List<org.gcube.portal.databook.shared.Notification>getRangeNotificationsByUser(String userid, int from, int quantity) List<org.gcube.portal.databook.shared.Feed>getRecentCommentedFeedsByUserAndDate(String userid, long timeInMillis) Deprecated.use getRecentCommentedPostsByUserAndDate insteadList<org.gcube.portal.databook.shared.Post>getRecentCommentedPostsByUserAndDate(String userid, long timeInMillis) List<org.gcube.portal.databook.shared.Comment>getRecentCommentsByUserAndDate(String userid, long timeInMillis) List<org.gcube.portal.databook.shared.Feed>getRecentFeedsByUser(String userid, int quantity) Deprecated.List<org.gcube.portal.databook.shared.Feed>getRecentFeedsByUserAndDate(String userid, long timeInMillis) Deprecated.use getRecentPostsByUserAndDateList<org.gcube.portal.databook.shared.Feed>getRecentFeedsByVRE(String vreid, int quantity) Deprecated.use getRecentPostsByVRE return the most recent feeds for this vre up to quantity paramorg.gcube.portal.databook.shared.RangeFeedsgetRecentFeedsByVREAndRange(String vreid, int from, int quantity) Deprecated.use getRecentPostsByVREAndRangeList<org.gcube.portal.databook.shared.Feed>getRecentLikedFeedsByUserAndDate(String userid, long timeInMillis) Deprecated.use getRecentLikedPostsByUserAndDateList<org.gcube.portal.databook.shared.Post>getRecentLikedPostsByUserAndDate(String userid, long timeInMillis) List<org.gcube.portal.databook.shared.Post>getRecentPostsByUser(String userid, int quantity) return the most recent feeds for this user up to quantity paramList<org.gcube.portal.databook.shared.Post>getRecentPostsByUserAndDate(String userid, long timeInMillis) List<org.gcube.portal.databook.shared.Post>getRecentPostsByVRE(String vreid, int quantity) return the most recent posts for this vre up to quantity paramorg.gcube.portal.databook.shared.RangePostsgetRecentPostsByVREAndRange(String vreid, 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 deletionsList<org.gcube.portal.databook.shared.Notification>getUnreadNotificationsByUser(String userid) return the not yet read notifications (not including messages)List<org.gcube.portal.databook.shared.NotificationChannelType>getUserNotificationChannels(String userid, org.gcube.portal.databook.shared.NotificationType notificationType) return the channels a user chose for being notified for a given notification typeMap<org.gcube.portal.databook.shared.NotificationType,org.gcube.portal.databook.shared.NotificationChannelType[]> getUserNotificationPreferences(String userid) get the notification preferences map (enableor disable the channels to be used for notifying the user)List<org.gcube.portal.databook.shared.Feed>getVREFeedsByHashtag(String vreid, String hashtag) Deprecated.use getVREPostsByHashtagget a map of vre hashtags where the key is the hashtag and the value is the occurrence of the hashtag in the VREgetVREHashtagsWithOccurrenceFilteredByTime(String vreid, long timestamp) get a map of vre hashtags where the key is the hashtag and the value is the occurrence of the hashtag in the VREList<org.gcube.portal.databook.shared.Post>getVREPostsByHashtag(String vreid, String hashtag) isExistingInvite(String vreid, String email) booleanlike(org.gcube.portal.databook.shared.Like like) add a like to a feedorg.gcube.portal.databook.shared.CommentreadCommentById(String commentId) org.gcube.portal.databook.shared.FeedDeprecated.use readPost read a feed from a given idorg.gcube.portal.databook.shared.InvitereadInvite(String inviteid) read an invite from a given idorg.gcube.portal.databook.shared.NotificationreadNotification(String notificationid) read a notification from a given idorg.gcube.portal.databook.shared.Postread a feed from a given idbooleanrequestFriendship(String from, String to) userid from requests a friendship to userid tobooleansaveAppFeed(org.gcube.portal.databook.shared.Feed feed) Deprecated.use saveAppPost save a Post instance in the storebooleansaveAppFeed(org.gcube.portal.databook.shared.Feed feed, List<org.gcube.portal.databook.shared.Attachment> attachments) Deprecated.use saveAppPost Save a Post instance in the store Use this if your app needs to attach more than one file to the postbooleansaveAppPost(org.gcube.portal.databook.shared.Post feed) save a Post instance in the storebooleansaveAppPost(org.gcube.portal.databook.shared.Post feed, List<org.gcube.portal.databook.shared.Attachment> attachments) Save a Post instance in the store Use this if your app needs to attach more than one file to the postbooleansaveFeedToVRETimeline(String feedKey, String vreid) Deprecated.use savePostToVRETimelinebooleansaveHashTags(String postid, String vreid, List<String> hashtags) booleansaveHashTagsComment(String commentId, String vreid, List<String> hashtags) org.gcube.portal.databook.shared.InviteOperationResultsaveInvite(org.gcube.portal.databook.shared.Invite invite) Save the invite for a given email into a given vrebooleansaveNotification(org.gcube.portal.databook.shared.Notification notification) save a Notification instance in the storebooleansavePostToVRETimeline(String postKey, String vreid) save a post in the VRES TimeLine in the storebooleansaveUserFeed(org.gcube.portal.databook.shared.Feed feed) Deprecated.use saveUserPost save a Feed instance in the storebooleansaveUserFeed(org.gcube.portal.databook.shared.Feed feed, List<org.gcube.portal.databook.shared.Attachment> attachments) Deprecated.use saveUserPostbooleansaveUserPost(org.gcube.portal.databook.shared.Post feed) save a Post instance in the storebooleansaveUserPost(org.gcube.portal.databook.shared.Post post, List<org.gcube.portal.databook.shared.Attachment> attachments) Save a Post instance in the store having more than one attachment Use this if you need to attach more than one file to the postbooleansetAllNotificationReadByUser(String userid) This is a fast way to set all notification to read quicklybooleansetInviteStatus(String vreid, String email, org.gcube.portal.databook.shared.InviteStatus status) set the status of an invite, seeInviteStatusbooleansetNotificationRead(String notificationidToSet) set an existing Notification instance in the to readbooleansetUserNotificationPreferences(String userid, Map<org.gcube.portal.databook.shared.NotificationType, org.gcube.portal.databook.shared.NotificationChannelType[]> enabledChannels) set the notification preferences map (enable or disable the channels to be used for notifying the user)booleanunlike a feed
-
Method Details
-
requestFriendship
userid from requests a friendship to userid to- Returns:
- true if everything went fine
-
approveFriendship
userid from approves a friendship to userid to- Returns:
- true if everything went fine
-
denyFriendship
userid from denies a friendship to userid to- Returns:
- true if everything went fine
-
getFriends
- Parameters:
userid- the user id you want to know friends- Returns:
- a List of userid representing the friends for the given userid
-
getPendingFriendRequests
- Parameters:
userid- the user id you want to know the pending friend requests- Returns:
- a List of userid representing the friends for the given userid
-
deleteFeed
boolean deleteFeed(String feedid) throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException Deprecated.use saveUserPostDelete a Feed from the store- Returns:
- true if everything went fine
- Throws:
org.gcube.portal.databook.shared.ex.FeedIDNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
-
deletePost
boolean deletePost(String postid) throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException delete a Feed from the store- Returns:
- true if everything went fine
- Throws:
org.gcube.portal.databook.shared.ex.FeedIDNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
-
saveFeedToVRETimeline
boolean saveFeedToVRETimeline(String feedKey, String vreid) throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException Deprecated.use savePostToVRETimelineSave a post in the VRES TimeLine in the store- Parameters:
feedKey- feedKeyvreid- vre identifier- Throws:
org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
savePostToVRETimeline
boolean savePostToVRETimeline(String postKey, String vreid) throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException save a post in the VRES TimeLine in the store- Parameters:
postKey- the post idvreid- vre identifier- Throws:
org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
readFeed
org.gcube.portal.databook.shared.Feed readFeed(String feedid) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException Deprecated.use readPost read a feed from a given id- Throws:
org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
readPost
org.gcube.portal.databook.shared.Post readPost(String postid) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException read a feed from a given id- Throws:
org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getAllFeedsByUser
List<org.gcube.portal.databook.shared.Feed> getAllFeedsByUser(String userid) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException Deprecated.use getAllPostsByUser instead- Parameters:
userid- user identifier return all the feeds belonging to the userid- Throws:
org.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getAllPostsByUser
List<org.gcube.portal.databook.shared.Post> getAllPostsByUser(String userid) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException - Parameters:
userid- user identifier return all the feeds belonging to the userid- Throws:
org.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getAllFeedsByApp
List<org.gcube.portal.databook.shared.Feed> getAllFeedsByApp(String appid) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException Deprecated.use getAllPostsByApp instead- Parameters:
appid- application identifier return all the feeds belonging to the appid- Throws:
org.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getAllPostsByApp
List<org.gcube.portal.databook.shared.Post> getAllPostsByApp(String appid) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException - Parameters:
appid- application identifier return all the feeds belonging to the appid- Throws:
org.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getRecentCommentedFeedsByUserAndDate
List<org.gcube.portal.databook.shared.Feed> getRecentCommentedFeedsByUserAndDate(String userid, long timeInMillis) throws Exception Deprecated.use getRecentCommentedPostsByUserAndDate instead- Parameters:
userid- the user identifier like andrea.rossitimeInMillis- the initial time in millis to be considered- Returns:
- a list of feeds commented by userid starting from timeInMillis
- Throws:
Exception
-
getRecentCommentedPostsByUserAndDate
List<org.gcube.portal.databook.shared.Post> getRecentCommentedPostsByUserAndDate(String userid, long timeInMillis) throws Exception - Parameters:
userid- the user identifier like andrea.rossitimeInMillis- the initial time in millis to be considered- Returns:
- a list of feeds commented by userid starting from timeInMillis
- Throws:
Exception
-
getAllPortalPrivacyLevelFeeds
List<org.gcube.portal.databook.shared.Feed> getAllPortalPrivacyLevelFeeds() throws org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionDeprecated.use getAllPortalPrivacyLevelPosts instead return all the feeds whose Level is PORTAL- Throws:
org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
-
getAllPortalPrivacyLevelPosts
List<org.gcube.portal.databook.shared.Post> getAllPortalPrivacyLevelPosts() throws org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionreturn all the feeds whose Level is PORTAL- Throws:
org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
-
getRecentFeedsByUser
List<org.gcube.portal.databook.shared.Feed> getRecentFeedsByUser(String userid, int quantity) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException Deprecated.return the most recent feeds for this user up to quantity param- Parameters:
userid- user identifierquantity- the number of most recent feeds for this user- Returns:
- a
Listof most recent feeds for this user - Throws:
org.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getRecentPostsByUser
List<org.gcube.portal.databook.shared.Post> getRecentPostsByUser(String userid, int quantity) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException return the most recent feeds for this user up to quantity param- Parameters:
userid- user identifierquantity- the number of most recent feeds for this user- Returns:
- a
Listof most recent feeds for this user - Throws:
org.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getAllFeedsByVRE
List<org.gcube.portal.databook.shared.Feed> getAllFeedsByVRE(String vreid) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException Deprecated.use getAllPostsByVRE- Parameters:
vreid- vre identifier return all the feeds belonging to the userid- Throws:
org.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getAllPostsByVRE
List<org.gcube.portal.databook.shared.Post> getAllPostsByVRE(String vreid) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException - Parameters:
vreid- vre identifier return all the feeds belonging to the userid- Throws:
org.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getRecentFeedsByVRE
List<org.gcube.portal.databook.shared.Feed> getRecentFeedsByVRE(String vreid, int quantity) throws IllegalArgumentException, org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException Deprecated.use getRecentPostsByVRE return the most recent feeds for this vre up to quantity param- Parameters:
vreid- VRES identifierquantity- the number of most recent feeds for this vre- Returns:
- a
Listof 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.ColumnNameNotFoundExceptionIllegalArgumentExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getRecentPostsByVRE
List<org.gcube.portal.databook.shared.Post> getRecentPostsByVRE(String vreid, int quantity) throws IllegalArgumentException, org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException return the most recent posts for this vre up to quantity param- Parameters:
vreid- VRES identifierquantity- the number of most recent posts for this vre- Returns:
- a
Listof most recent posts for this vre - Throws:
org.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionIllegalArgumentExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getRecentFeedsByVREAndRange
org.gcube.portal.databook.shared.RangeFeeds getRecentFeedsByVREAndRange(String vreid, int from, int quantity) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException Deprecated.use getRecentPostsByVREAndRangereturn the most recent posts for this vre up to quantity param and the last index of the feeds in the timeline lastReturnedFeedTimelineIndex is usuful to know from where to start the range the second time you ask because there are deletions- Parameters:
vreid- VRES identifierfrom- 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
RangeFeedscontaining 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.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getRecentPostsByVREAndRange
org.gcube.portal.databook.shared.RangePosts getRecentPostsByVREAndRange(String vreid, int from, int quantity) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException 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 deletions- Parameters:
vreid- VRES identifierfrom- 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
RangePostscontaining 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.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getRecentFeedsByUserAndDate
List<org.gcube.portal.databook.shared.Feed> getRecentFeedsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException Deprecated.use getRecentPostsByUserAndDate- Parameters:
userid- user identifiertimeInMillis- time in milliseconds from which you want to start retrieve the feeds- Returns:
- the number of feeds in the range from: today to: timeInMillis
- Throws:
IllegalArgumentException
-
getRecentPostsByUserAndDate
List<org.gcube.portal.databook.shared.Post> getRecentPostsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException - Parameters:
userid- user identifiertimeInMillis- time in milliseconds from which you want to start retrieve the feeds- Returns:
- the number of feeds in the range from: today to: timeInMillis
- Throws:
IllegalArgumentException
-
setNotificationRead
boolean setNotificationRead(String notificationidToSet) throws org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException, org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException set an existing Notification instance in the to read- Returns:
- true if everything went fine
- Throws:
org.gcube.portal.databook.shared.ex.NotificationIDNotFoundExceptionorg.gcube.portal.databook.shared.ex.NotificationTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
-
readNotification
org.gcube.portal.databook.shared.Notification readNotification(String notificationid) throws org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException, org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException read a notification from a given id- Throws:
org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException- if a column name is not foundorg.gcube.portal.databook.shared.ex.NotificationIDNotFoundException- if the notification ID is not foundorg.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException- if the notification type is not found
-
getAllNotificationByUser
List<org.gcube.portal.databook.shared.Notification> getAllNotificationByUser(String userid, int limit) throws org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException - Parameters:
userid- user identifierlimit- set 0 to get everything, an int to get the most recent -limit- notifications return all the notifications belonging to the userid up to limit, set 0 to get everything- Throws:
org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.NotificationIDNotFoundException
-
getRangeNotificationsByUser
List<org.gcube.portal.databook.shared.Notification> getRangeNotificationsByUser(String userid, int from, int quantity) throws org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException - Parameters:
userid- user identifierfrom- the range start has to be greater than 0quantity- the number of most recent notifications for this user starting from "from" param- Returns:
- all the notifications for the userid in the range requested
- Throws:
org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.NotificationIDNotFoundException
-
setAllNotificationReadByUser
boolean setAllNotificationReadByUser(String userid) throws org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException, org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException This is a fast way to set all notification to read quickly- Parameters:
userid-- Returns:
- true if everything went fine
- Throws:
org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException- if a column name is not foundorg.gcube.portal.databook.shared.ex.NotificationIDNotFoundException- if the notification ID is not foundorg.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException- if the notification type is not found
-
getUnreadNotificationsByUser
List<org.gcube.portal.databook.shared.Notification> getUnreadNotificationsByUser(String userid) throws org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException return the not yet read notifications (not including messages)- Parameters:
userid- user identifier- Returns:
- a
Listof not yet read notifications for this user - Throws:
org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.NotificationIDNotFoundException
-
checkUnreadNotifications
boolean checkUnreadNotifications(String userid) throws org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException, org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException - Parameters:
userid- user identifier- Returns:
- true if there are unread notifications (not including messages), false if they are all read
- Throws:
org.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.NotificationTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.NotificationIDNotFoundException
-
checkUnreadMessagesNotifications
boolean checkUnreadMessagesNotifications(String userid) throws org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException, org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException - Parameters:
userid- user identifier- Returns:
- true if there are unread messages notifications (including messages), false if they are all read
- Throws:
org.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException- self explainingorg.gcube.portal.databook.shared.ex.NotificationIDNotFoundException
-
setUserNotificationPreferences
boolean setUserNotificationPreferences(String userid, Map<org.gcube.portal.databook.shared.NotificationType, org.gcube.portal.databook.shared.NotificationChannelType[]> enabledChannels) set the notification preferences map (enable or disable the channels to be used for notifying the user)- Parameters:
userid- user identifierenabledChannels- a map of the channels to which reach the user per notification, empty array or null values to set the key notification type off- Returns:
- true if everything was fine
-
getUserNotificationPreferences
Map<org.gcube.portal.databook.shared.NotificationType,org.gcube.portal.databook.shared.NotificationChannelType[]> getUserNotificationPreferences(String userid) throws org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException, org.gcube.portal.databook.shared.ex.NotificationChannelTypeNotFoundException get the notification preferences map (enableor disable the channels to be used for notifying the user)- Parameters:
userid- user identifier- Returns:
- the map
- Throws:
org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException- self explainingorg.gcube.portal.databook.shared.ex.NotificationChannelTypeNotFoundException- self explaining
-
readCommentById
org.gcube.portal.databook.shared.Comment readCommentById(String commentId) throws org.gcube.portal.databook.shared.ex.CommentIDNotFoundException - Parameters:
commentId- comment unique identifier- Returns:
- the comment belonging to the commentId
- Throws:
org.gcube.portal.databook.shared.ex.CommentIDNotFoundException
-
getAllCommentByFeed
Deprecated.use getAllCommentByPost- Parameters:
feedid- feed identifier return all the comments belonging to the feedid
-
getAllCommentByPost
- Parameters:
postid- the post identifier return all the comments belonging to the postid
-
getRecentCommentsByUserAndDate
List<org.gcube.portal.databook.shared.Comment> getRecentCommentsByUserAndDate(String userid, long timeInMillis) throws Exception - Parameters:
userid- user identifiertimeInMillis- time in milliseconds from which you want to start retrieve the feeds- Returns:
- a list of comments (sorted starting from the most recent one) made by the user since timeInMillis up to now
- Throws:
Exception
-
deleteComment
boolean deleteComment(String commentid, String feedid) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.CommentIDNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException deletes a comment- Parameters:
commentid- the comment identifier to deletefeedid- the feedid to which the comment is associated- Returns:
- true if success, false otherwise
- Throws:
org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.CommentIDNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
unlike
boolean unlike(String userid, String likeid, String feedid) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException, org.gcube.portal.databook.shared.ex.LikeIDNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException unlike a feed- Parameters:
userid- user identifierlikeid- the like identifier to deletefeedid- the feedid to which the comment is associated- Returns:
- true if success, false otherwise
- Throws:
org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.ColumnNameNotFoundExceptionorg.gcube.portal.databook.shared.ex.LikeIDNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getAllLikedFeedIdsByUser
Deprecated.use getAllLikedPostIdsByUser- Parameters:
userid- user identifier return all the feedids a user has liked
-
getAllLikedPostIdsByUser
- Parameters:
userid- user identifier return all the feedids a user has liked
-
getAllLikedFeedsByUser
List<org.gcube.portal.databook.shared.Feed> getAllLikedFeedsByUser(String userid, int limit) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException Deprecated.use getAllLikedPostsByUser- Parameters:
userid- user identifierlimit- set 0 to get everything, an int to get the most recent -limit- liked feeds- Throws:
org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException- .org.gcube.portal.databook.shared.ex.FeedIDNotFoundException- .org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException- .org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException- . return all the feeds a user has liked
-
getAllLikedPostsByUser
List<org.gcube.portal.databook.shared.Post> getAllLikedPostsByUser(String userid, int limit) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException - Parameters:
userid- user identifierlimit- set 0 to get everything, an int to get the most recent -limit- liked posts- Throws:
org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException- .org.gcube.portal.databook.shared.ex.FeedIDNotFoundException- .org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException- .org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException- . return all the feeds a user has liked
-
getRecentLikedFeedsByUserAndDate
List<org.gcube.portal.databook.shared.Feed> getRecentLikedFeedsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException Deprecated.use getRecentLikedPostsByUserAndDate- Parameters:
userid- user identifiertimeInMillis- time in milliseconds from which you want to start retrieve the feeds- Returns:
- the likes made to feeds in the range from: today to: timeInMillis
- Throws:
IllegalArgumentException
-
getRecentLikedPostsByUserAndDate
List<org.gcube.portal.databook.shared.Post> getRecentLikedPostsByUserAndDate(String userid, long timeInMillis) throws IllegalArgumentException - Parameters:
userid- user identifiertimeInMillis- time in milliseconds from which you want to start retrieve the feeds- Returns:
- the likes made to feeds in the range from: today to: timeInMillis
- Throws:
IllegalArgumentException
-
getAllLikesByFeed
Deprecated.use getAllLikesByPost- Parameters:
postid- postid identifier return all the likes belonging to the postid
-
getAllLikesByPost
- Parameters:
postid- postid identifier return all the likes belonging to the postid
-
saveHashTags
boolean saveHashTags(String postid, String vreid, List<String> hashtags) throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException - Parameters:
hashtags- the hashtag including the '#'postid- the postid to which the hashtag is associatedvreid- VRE identifier- Returns:
- true if success, false otherwise
- Throws:
org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
saveHashTagsComment
boolean saveHashTagsComment(String commentId, String vreid, List<String> hashtags) throws org.gcube.portal.databook.shared.ex.CommentIDNotFoundException - Parameters:
hashtags- the hashtag including the '#'commentId- the commentId to which the hashtag is associatedvreid- VRE identifier- Returns:
- true if success, false otherwise
- Throws:
org.gcube.portal.databook.shared.ex.CommentIDNotFoundException
-
deleteHashTags
boolean deleteHashTags(String postid, String vreid, List<String> hashtags) throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException - Parameters:
hashtags- the hashtag including the '#'postid- the postid to which the hashtag is associatedvreid- VRE identifier- Returns:
- true if success, false otherwise
- Throws:
org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
deleteHashTagsComment
boolean deleteHashTagsComment(String commentId, String vreid, List<String> hashtags) throws org.gcube.portal.databook.shared.ex.CommentIDNotFoundException - Parameters:
hashtags- the hashtag including the '#'commentId- the commentId to which the hashtag is associatedvreid- VRE identifier- Returns:
- true if success, false otherwise
- Throws:
org.gcube.portal.databook.shared.ex.CommentIDNotFoundException
-
getVREHashtagsWithOccurrence
get a map of vre hashtags where the key is the hashtag and the value is the occurrence of the hashtag in the VRE- Parameters:
vreid- vre identifier (scope)- Returns:
- a HashMap>String, Integer< of vre Hashtags associated with their occurrence
-
getVREHashtagsWithOccurrenceFilteredByTime
get a map of vre hashtags where the key is the hashtag and the value is the occurrence of the hashtag in the VRE- Parameters:
vreid- vre identifier (scope)timestamp- do not consider hashtags used before timestamp- Returns:
- a HashMap>String, Integer< of vre Hashtags associated with their occurrence
-
getVREFeedsByHashtag
List<org.gcube.portal.databook.shared.Feed> getVREFeedsByHashtag(String vreid, String hashtag) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException Deprecated.use getVREPostsByHashtag- Parameters:
vreid- VRE identifierhashtag- the hashtag to look for including the '#', it is case sensitive- Returns:
- all the feeds having the hashtag passed as parameter
- Throws:
org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException- .org.gcube.portal.databook.shared.ex.FeedIDNotFoundException- .org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException- .org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException- .
-
getVREPostsByHashtag
List<org.gcube.portal.databook.shared.Post> getVREPostsByHashtag(String vreid, String hashtag) throws org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException, org.gcube.portal.databook.shared.ex.FeedIDNotFoundException, org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException - Parameters:
vreid- VRE identifierhashtag- the hashtag to look for including the '#', it is case sensitive- Returns:
- all the feeds having the hashtag passed as parameter
- Throws:
org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException- .org.gcube.portal.databook.shared.ex.FeedIDNotFoundException- .org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException- .org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundExceptionorg.gcube.portal.databook.shared.ex.FeedIDNotFoundException- .
-
isExistingInvite
- Parameters:
vreid- the environment where you want to check the inviteemail- the email of the invite to check in the environmnet- Returns:
- the InviteId if present, null otherwise
-
readInvite
org.gcube.portal.databook.shared.Invite readInvite(String inviteid) throws org.gcube.portal.databook.shared.ex.InviteIDNotFoundException, org.gcube.portal.databook.shared.ex.InviteStatusNotFoundException read an invite from a given id- Throws:
org.gcube.portal.databook.shared.ex.InviteIDNotFoundExceptionorg.gcube.portal.databook.shared.ex.InviteStatusNotFoundException
-
getAttachmentsByFeedId
List<org.gcube.portal.databook.shared.Attachment> getAttachmentsByFeedId(String feedId) throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException - Parameters:
feedId-- Returns:
- the list of attachments of the feed feedId, starting from the second one (first attachment is included in Feed instance already)
- Throws:
org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
-
getAllVREIds
Retrieve all the ids of the vre- Returns:
- the set of ids of the vre available or empty list in case of errors.
-
closeConnection
void closeConnection()close the connection to the underlying database
-