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
DatabookStore is the high level interface for querying and adding data to DatabookStore
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanaddComment(Comment comment)add a comment to a feedbooleanapproveFriendship(String from, String to)userid from approves a friendship to userid tobooleancheckUnreadMessagesNotifications(String userid)booleancheckUnreadNotifications(String userid)voidcloseConnection()close 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(Comment comment)edit a commentList<Comment>getAllCommentByFeed(String feedid)Deprecated.use getAllCommentByPostList<Comment>getAllCommentByPost(String postid)List<Feed>getAllFeedsByApp(String appid)Deprecated.use getAllPostsByApp insteadList<Feed>getAllFeedsByUser(String userid)Deprecated.use getAllPostsByUser insteadList<Feed>getAllFeedsByVRE(String vreid)Deprecated.use getAllPostsByVREList<String>getAllLikedFeedIdsByUser(String userid)Deprecated.use getAllLikedPostIdsByUserList<Feed>getAllLikedFeedsByUser(String userid, int limit)Deprecated.use getAllLikedPostsByUserList<String>getAllLikedPostIdsByUser(String userid)List<Post>getAllLikedPostsByUser(String userid, int limit)List<Like>getAllLikesByFeed(String postid)Deprecated.use getAllLikesByPostList<Like>getAllLikesByPost(String postid)List<Notification>getAllNotificationByUser(String userid, int limit)List<Feed>getAllPortalPrivacyLevelFeeds()Deprecated.use getAllPortalPrivacyLevelPosts instead return all the feeds whose Level is PORTALList<Post>getAllPortalPrivacyLevelPosts()return all the feeds whose Level is PORTALList<Post>getAllPostsByApp(String appid)List<Post>getAllPostsByUser(String userid)List<Post>getAllPostsByVRE(String vreid)List<String>getAllVREIds()Retrieve all the ids of the vreList<Attachment>getAttachmentsByFeedId(String feedId)List<String>getFriends(String userid)List<Invite>getInvitedEmailsByVRE(String vreid, InviteStatus... status)Use to get the list of invites per VREList<String>getPendingFriendRequests(String userid)List<Notification>getRangeNotificationsByUser(String userid, int from, int quantity)List<Feed>getRecentCommentedFeedsByUserAndDate(String userid, long timeInMillis)Deprecated.use getRecentCommentedPostsByUserAndDate insteadList<Post>getRecentCommentedPostsByUserAndDate(String userid, long timeInMillis)List<Comment>getRecentCommentsByUserAndDate(String userid, long timeInMillis)List<Feed>getRecentFeedsByUser(String userid, int quantity)Deprecated.List<Feed>getRecentFeedsByUserAndDate(String userid, long timeInMillis)Deprecated.use getRecentPostsByUserAndDateList<Feed>getRecentFeedsByVRE(String vreid, int quantity)Deprecated.use getRecentPostsByVRE return the most recent feeds for this vre up to quantity paramRangeFeedsgetRecentFeedsByVREAndRange(String vreid, int from, int quantity)Deprecated.use getRecentPostsByVREAndRangeList<Feed>getRecentLikedFeedsByUserAndDate(String userid, long timeInMillis)Deprecated.use getRecentLikedPostsByUserAndDateList<Post>getRecentLikedPostsByUserAndDate(String userid, long timeInMillis)List<Post>getRecentPostsByUser(String userid, int quantity)return the most recent feeds for this user up to quantity paramList<Post>getRecentPostsByUserAndDate(String userid, long timeInMillis)List<Post>getRecentPostsByVRE(String vreid, int quantity)return the most recent posts for this vre up to quantity paramRangePostsgetRecentPostsByVREAndRange(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<Notification>getUnreadNotificationsByUser(String userid)return the not yet read notifications (not including messages)List<NotificationChannelType>getUserNotificationChannels(String userid, NotificationType notificationType)return the channels a user chose for being notified for a given notification typeMap<NotificationType,NotificationChannelType[]>getUserNotificationPreferences(String userid)get the notification preferences map (enableor disable the channels to be used for notifying the user)List<Feed>getVREFeedsByHashtag(String vreid, String hashtag)Deprecated.use getVREPostsByHashtagMap<String,Integer>getVREHashtagsWithOccurrence(String vreid)get a map of vre hashtags where the key is the hashtag and the value is the occurrence of the hashtag in the VREMap<String,Integer>getVREHashtagsWithOccurrenceFilteredByTime(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<Post>getVREPostsByHashtag(String vreid, String hashtag)StringisExistingInvite(String vreid, String email)booleanlike(Like like)add a like to a feedCommentreadCommentById(String commentId)FeedreadFeed(String feedid)Deprecated.use readPost read a feed from a given idInvitereadInvite(String inviteid)read an invite from a given idNotificationreadNotification(String notificationid)read a notification from a given idPostreadPost(String postid)read a feed from a given idbooleanrequestFriendship(String from, String to)userid from requests a friendship to userid tobooleansaveAppFeed(Feed feed)Deprecated.use saveAppPost save a Post instance in the storebooleansaveAppFeed(Feed feed, List<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(Post feed)save a Post instance in the storebooleansaveAppPost(Post feed, List<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)InviteOperationResultsaveInvite(Invite invite)Save the invite for a given email into a given vrebooleansaveNotification(Notification notification)save a Notification instance in the storebooleansavePostToVRETimeline(String postKey, String vreid)save a post in the VRES TimeLine in the storebooleansaveUserFeed(Feed feed)Deprecated.use saveUserPost save a Feed instance in the storebooleansaveUserFeed(Feed feed, List<Attachment> attachments)Deprecated.use saveUserPostbooleansaveUserPost(Post feed)save a Post instance in the storebooleansaveUserPost(Post post, List<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, InviteStatus status)set the status of an invite, seeInviteStatusbooleansetNotificationRead(String notificationidToSet)set an existing Notification instance in the to readbooleansetUserNotificationPreferences(String userid, Map<NotificationType,NotificationChannelType[]> enabledChannels)set the notification preferences map (enable or disable the channels to be used for notifying the user)booleanunlike(String userid, String likeid, String feedid)unlike a feed
-
-
-
Method Detail
-
requestFriendship
boolean requestFriendship(String from, String to)
userid from requests a friendship to userid to- Returns:
- true if everything went fine
-
approveFriendship
boolean approveFriendship(String from, String to)
userid from approves a friendship to userid to- Returns:
- true if everything went fine
-
denyFriendship
boolean denyFriendship(String from, String to)
userid from denies a friendship to userid to- Returns:
- true if everything went fine
-
getFriends
List<String> getFriends(String userid)
- Parameters:
userid- the user id you want to know friends- Returns:
- a List of userid representing the friends for the given userid
-
getPendingFriendRequests
List<String> getPendingFriendRequests(String userid)
- 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
-
saveUserFeed
boolean saveUserFeed(Feed feed)
Deprecated.use saveUserPost save a Feed instance in the store- Returns:
- true if everything went fine
-
saveUserPost
boolean saveUserPost(Post feed)
save a Post instance in the store- Returns:
- true if everything went fine
-
saveUserFeed
boolean saveUserFeed(Feed feed, List<Attachment> attachments)
Deprecated.use saveUserPostSave a Feed instance in the store having more than one attachment Use this if you need to attach more than one file to the post- Parameters:
attachments- a list of attachments starting from the second- Returns:
- true if everything went fine
-
saveUserPost
boolean saveUserPost(Post post, List<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 post- Parameters:
attachments- a list of attachments starting from the second- Returns:
- true if everything went fine
-
deleteFeed
boolean deleteFeed(String feedid) throws FeedIDNotFoundException, PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException
Deprecated.use saveUserPostDelete a Feed from the store- Returns:
- true if everything went fine
- Throws:
FeedIDNotFoundExceptionPrivacyLevelTypeNotFoundExceptionFeedTypeNotFoundExceptionColumnNameNotFoundException
-
deletePost
boolean deletePost(String postid) throws FeedIDNotFoundException, PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException
delete a Feed from the store- Returns:
- true if everything went fine
- Throws:
FeedIDNotFoundExceptionPrivacyLevelTypeNotFoundExceptionFeedTypeNotFoundExceptionColumnNameNotFoundException
-
saveFeedToVRETimeline
boolean saveFeedToVRETimeline(String feedKey, String vreid) throws FeedIDNotFoundException
Deprecated.use savePostToVRETimelineSave a post in the VRES TimeLine in the store- Parameters:
feedKey- feedKeyvreid- vre identifier- Throws:
FeedIDNotFoundException
-
savePostToVRETimeline
boolean savePostToVRETimeline(String postKey, String vreid) throws FeedIDNotFoundException
save a post in the VRES TimeLine in the store- Parameters:
postKey- the post idvreid- vre identifier- Throws:
FeedIDNotFoundException
-
saveAppFeed
boolean saveAppFeed(Feed feed)
Deprecated.use saveAppPost save a Post instance in the store- Returns:
- true if everything went fine
-
saveAppPost
boolean saveAppPost(Post feed)
save a Post instance in the store- Returns:
- true if everything went fine
-
saveAppFeed
boolean saveAppFeed(Feed feed, List<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 post- Parameters:
attachments- a list of attachments starting from the second- Returns:
- true if everything went fine
-
saveAppPost
boolean saveAppPost(Post feed, List<Attachment> attachments)
Save a Post instance in the store Use this if your app needs to attach more than one file to the post- Parameters:
attachments- a list of attachments starting from the second- Returns:
- true if everything went fine
-
readFeed
Feed readFeed(String feedid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException
Deprecated.use readPost read a feed from a given id
-
readPost
Post readPost(String postid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException
read a feed from a given id
-
getAllFeedsByUser
List<Feed> getAllFeedsByUser(String userid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException
Deprecated.use getAllPostsByUser instead- Parameters:
userid- user identifier return all the feeds belonging to the userid- Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionFeedIDNotFoundException
-
getAllPostsByUser
List<Post> getAllPostsByUser(String userid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException
- Parameters:
userid- user identifier return all the feeds belonging to the userid- Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionFeedIDNotFoundException
-
getAllFeedsByApp
List<Feed> getAllFeedsByApp(String appid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException
Deprecated.use getAllPostsByApp instead- Parameters:
appid- application identifier return all the feeds belonging to the appid- Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionFeedIDNotFoundException
-
getAllPostsByApp
List<Post> getAllPostsByApp(String appid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException
- Parameters:
appid- application identifier return all the feeds belonging to the appid- Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionFeedIDNotFoundException
-
getRecentCommentedFeedsByUserAndDate
List<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<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<Feed> getAllPortalPrivacyLevelFeeds() throws FeedTypeNotFoundException, ColumnNameNotFoundException, PrivacyLevelTypeNotFoundException
Deprecated.use getAllPortalPrivacyLevelPosts instead return all the feeds whose Level is PORTAL
-
getAllPortalPrivacyLevelPosts
List<Post> getAllPortalPrivacyLevelPosts() throws FeedTypeNotFoundException, ColumnNameNotFoundException, PrivacyLevelTypeNotFoundException
return all the feeds whose Level is PORTAL
-
getRecentFeedsByUser
List<Feed> getRecentFeedsByUser(String userid, int quantity) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, 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
List of most recent feeds for this user - Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionFeedIDNotFoundException
-
getRecentPostsByUser
List<Post> getRecentPostsByUser(String userid, int quantity) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, 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
List of most recent feeds for this user - Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionFeedIDNotFoundException
-
getAllFeedsByVRE
List<Feed> getAllFeedsByVRE(String vreid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, FeedIDNotFoundException
Deprecated.use getAllPostsByVRE- Parameters:
vreid- vre identifier return all the feeds belonging to the userid- Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionFeedIDNotFoundException
-
getAllPostsByVRE
List<Post> getAllPostsByVRE(String vreid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, FeedIDNotFoundException
- Parameters:
vreid- vre identifier return all the feeds belonging to the userid- Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionFeedIDNotFoundException
-
getRecentFeedsByVRE
List<Feed> getRecentFeedsByVRE(String vreid, int quantity) throws IllegalArgumentException, PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, 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
List of most recent feeds for this vre - Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionIllegalArgumentExceptionFeedIDNotFoundException
-
getRecentPostsByVRE
List<Post> getRecentPostsByVRE(String vreid, int quantity) throws IllegalArgumentException, PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, 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
List of most recent posts for this vre - Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionIllegalArgumentExceptionFeedIDNotFoundException
-
getRecentFeedsByVREAndRange
RangeFeeds getRecentFeedsByVREAndRange(String vreid, int from, int quantity) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, 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
lastReturnedFeedTimelineIndex containing of most recent feeds for this vre - Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionFeedIDNotFoundException
-
getRecentPostsByVREAndRange
RangePosts getRecentPostsByVREAndRange(String vreid, int from, int quantity) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, 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
RangePosts containing of most recent feeds for this vre - Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionFeedIDNotFoundException
-
getRecentFeedsByUserAndDate
List<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<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
-
saveNotification
boolean saveNotification(Notification notification)
save a Notification instance in the store- Returns:
- true if everything went fine
-
setNotificationRead
boolean setNotificationRead(String notificationidToSet) throws NotificationIDNotFoundException, NotificationTypeNotFoundException, ColumnNameNotFoundException
set an existing Notification instance in the to read- Returns:
- true if everything went fine
- Throws:
NotificationIDNotFoundExceptionNotificationTypeNotFoundExceptionColumnNameNotFoundException
-
readNotification
Notification readNotification(String notificationid) throws NotificationIDNotFoundException, NotificationTypeNotFoundException, ColumnNameNotFoundException
read a notification from a given id
-
getAllNotificationByUser
List<Notification> getAllNotificationByUser(String userid, int limit) throws NotificationTypeNotFoundException, ColumnNameNotFoundException, 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:
NotificationTypeNotFoundExceptionColumnNameNotFoundExceptionNotificationIDNotFoundException
-
getRangeNotificationsByUser
List<Notification> getRangeNotificationsByUser(String userid, int from, int quantity) throws NotificationTypeNotFoundException, ColumnNameNotFoundException, 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:
NotificationTypeNotFoundExceptionColumnNameNotFoundExceptionNotificationIDNotFoundException
-
setAllNotificationReadByUser
boolean setAllNotificationReadByUser(String userid) throws NotificationIDNotFoundException, NotificationTypeNotFoundException, ColumnNameNotFoundException
This is a fast way to set all notification to read quickly- Parameters:
userid-- Returns:
- true if everything went fine
- Throws:
NotificationIDNotFoundExceptionNotificationTypeNotFoundExceptionColumnNameNotFoundException
-
getUnreadNotificationsByUser
List<Notification> getUnreadNotificationsByUser(String userid) throws NotificationTypeNotFoundException, ColumnNameNotFoundException, NotificationIDNotFoundException
return the not yet read notifications (not including messages)- Parameters:
userid- user identifier- Returns:
- a
List of not yet read notifications for this user - Throws:
NotificationTypeNotFoundExceptionColumnNameNotFoundExceptionNotificationIDNotFoundException
-
checkUnreadNotifications
boolean checkUnreadNotifications(String userid) throws NotificationIDNotFoundException, NotificationTypeNotFoundException, ColumnNameNotFoundException
- Parameters:
userid- user identifier- Returns:
- true if there are unread notifications (not including messages), false if they are all read
- Throws:
ColumnNameNotFoundExceptionNotificationTypeNotFoundExceptionNotificationIDNotFoundException
-
checkUnreadMessagesNotifications
boolean checkUnreadMessagesNotifications(String userid) throws NotificationIDNotFoundException, NotificationTypeNotFoundException, ColumnNameNotFoundException
- Parameters:
userid- user identifier- Returns:
- true if there are unread messages notifications (including messages), false if they are all read
- Throws:
ColumnNameNotFoundExceptionNotificationTypeNotFoundException- self explainingNotificationChannelTypeNotFoundException- self explainingNotificationIDNotFoundException
-
getUserNotificationChannels
List<NotificationChannelType> getUserNotificationChannels(String userid, NotificationType notificationType) throws NotificationChannelTypeNotFoundException, NotificationTypeNotFoundException
return the channels a user chose for being notified for a given notification type- Parameters:
userid- user identifiernotificationType- the type of the notification- Returns:
- a list of
NotificationChannelType that represents the channels this user wants to be notified - Throws:
NotificationChannelTypeNotFoundExceptionNotificationTypeNotFoundException
-
setUserNotificationPreferences
boolean setUserNotificationPreferences(String userid, Map<NotificationType,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<NotificationType,NotificationChannelType[]> getUserNotificationPreferences(String userid) throws NotificationTypeNotFoundException, 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:
NotificationTypeNotFoundException- self explainingNotificationChannelTypeNotFoundException- self explaining
-
readCommentById
Comment readCommentById(String commentId) throws CommentIDNotFoundException
- Parameters:
commentId- comment unique identifier- Returns:
- the comment belonging to the commentId
- Throws:
CommentIDNotFoundException
-
addComment
boolean addComment(Comment comment) throws FeedIDNotFoundException
add a comment to a feed- Parameters:
comment- the Comment instance to add- Throws:
FeedIDNotFoundException
-
getAllCommentByFeed
List<Comment> getAllCommentByFeed(String feedid)
Deprecated.use getAllCommentByPost- Parameters:
feedid- feed identifier return all the comments belonging to the feedid
-
getAllCommentByPost
List<Comment> getAllCommentByPost(String postid)
- Parameters:
postid- the post identifier return all the comments belonging to the postid
-
getRecentCommentsByUserAndDate
List<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
-
editComment
boolean editComment(Comment comment) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, CommentIDNotFoundException, FeedIDNotFoundException
edit a comment- Parameters:
comment- the comment to edit- Returns:
- true if success, false otherwise
- Throws:
PrivacyLevelTypeNotFoundExceptionFeedTypeNotFoundExceptionColumnNameNotFoundExceptionCommentIDNotFoundExceptionFeedIDNotFoundException
-
deleteComment
boolean deleteComment(String commentid, String feedid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, CommentIDNotFoundException, 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:
PrivacyLevelTypeNotFoundExceptionFeedTypeNotFoundExceptionColumnNameNotFoundExceptionCommentIDNotFoundExceptionFeedIDNotFoundException
-
like
boolean like(Like like) throws FeedIDNotFoundException
add a like to a feed- Parameters:
like- instance- Throws:
FeedIDNotFoundException
-
unlike
boolean unlike(String userid, String likeid, String feedid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, LikeIDNotFoundException, 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:
PrivacyLevelTypeNotFoundExceptionFeedTypeNotFoundExceptionColumnNameNotFoundExceptionLikeIDNotFoundExceptionFeedIDNotFoundException
-
getAllLikedFeedIdsByUser
List<String> getAllLikedFeedIdsByUser(String userid)
Deprecated.use getAllLikedPostIdsByUser- Parameters:
userid- user identifier return all the feedids a user has liked
-
getAllLikedPostIdsByUser
List<String> getAllLikedPostIdsByUser(String userid)
- Parameters:
userid- user identifier return all the feedids a user has liked
-
getAllLikedFeedsByUser
List<Feed> getAllLikedFeedsByUser(String userid, int limit) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException
Deprecated.use getAllLikedPostsByUser- Parameters:
userid- user identifierlimit- set 0 to get everything, an int to get the most recent -limit- liked feeds- Throws:
ColumnNameNotFoundException- .FeedIDNotFoundException- .FeedTypeNotFoundException- .PrivacyLevelTypeNotFoundExceptionFeedIDNotFoundException- . return all the feeds a user has liked
-
getAllLikedPostsByUser
List<Post> getAllLikedPostsByUser(String userid, int limit) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException
- Parameters:
userid- user identifierlimit- set 0 to get everything, an int to get the most recent -limit- liked posts- Throws:
ColumnNameNotFoundException- .FeedIDNotFoundException- .FeedTypeNotFoundException- .PrivacyLevelTypeNotFoundExceptionFeedIDNotFoundException- . return all the feeds a user has liked
-
getRecentLikedFeedsByUserAndDate
List<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<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
List<Like> getAllLikesByFeed(String postid)
Deprecated.use getAllLikesByPost- Parameters:
postid- postid identifier return all the likes belonging to the postid
-
getAllLikesByPost
List<Like> getAllLikesByPost(String postid)
- Parameters:
postid- postid identifier return all the likes belonging to the postid
-
saveHashTags
boolean saveHashTags(String postid, String vreid, List<String> hashtags) throws 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:
FeedIDNotFoundException
-
saveHashTagsComment
boolean saveHashTagsComment(String commentId, String vreid, List<String> hashtags) throws 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:
CommentIDNotFoundException
-
deleteHashTags
boolean deleteHashTags(String postid, String vreid, List<String> hashtags) throws 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:
FeedIDNotFoundException
-
deleteHashTagsComment
boolean deleteHashTagsComment(String commentId, String vreid, List<String> hashtags) throws 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:
CommentIDNotFoundException
-
getVREHashtagsWithOccurrence
Map<String,Integer> getVREHashtagsWithOccurrence(String vreid)
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
of vre Hashtags associated with their occurrence
-
getVREHashtagsWithOccurrenceFilteredByTime
Map<String,Integer> getVREHashtagsWithOccurrenceFilteredByTime(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 VRE- Parameters:
vreid- vre identifier (scope)timestamp- do not consider hashtags used before timestamp- Returns:
- a HashMap
of vre Hashtags associated with their occurrence
-
getVREFeedsByHashtag
List<Feed> getVREFeedsByHashtag(String vreid, String hashtag) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, 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:
ColumnNameNotFoundException- .FeedIDNotFoundException- .FeedTypeNotFoundException- .PrivacyLevelTypeNotFoundExceptionFeedIDNotFoundException- .
-
getVREPostsByHashtag
List<Post> getVREPostsByHashtag(String vreid, String hashtag) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, 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:
ColumnNameNotFoundException- .FeedIDNotFoundException- .FeedTypeNotFoundException- .PrivacyLevelTypeNotFoundExceptionFeedIDNotFoundException- .
-
saveInvite
InviteOperationResult saveInvite(Invite invite) throws javax.mail.internet.AddressException
Save the invite for a given email into a given vre- Parameters:
invite- the invite object instanc to save- Returns:
InviteOperationResultSUCCESS, FAILED or ALREADY_INVITED (if an invite is sent to en existing email in the same environment more than once)- Throws:
javax.mail.internet.AddressException
-
isExistingInvite
String isExistingInvite(String vreid, String email)
- 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
Invite readInvite(String inviteid) throws InviteIDNotFoundException, InviteStatusNotFoundException
read an invite from a given id
-
setInviteStatus
boolean setInviteStatus(String vreid, String email, InviteStatus status) throws InviteIDNotFoundException, InviteStatusNotFoundException
set the status of an invite, seeInviteStatus
-
getInvitedEmailsByVRE
List<Invite> getInvitedEmailsByVRE(String vreid, InviteStatus... status) throws InviteIDNotFoundException, InviteStatusNotFoundException
Use to get the list of invites per VRE- Parameters:
vreid- the vre idstatus- optional, if you want to restict on the status, e.g. all pending invites- Returns:
- return the list of invites
- Throws:
InviteIDNotFoundExceptionInviteStatusNotFoundException
-
getAttachmentsByFeedId
List<Attachment> getAttachmentsByFeedId(String feedId) throws 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:
FeedIDNotFoundException
-
getAllVREIds
List<String> 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
-
-