Package org.gcube.portal.databook.server
Interface DatabookStore
- All Known Implementing Classes:
DBCassandraAstyanaxImpl
public interface DatabookStore
High-level interface for querying and managing social data in the DatabookStore.
Provides methods for managing friendships, posts, feeds, comments, likes, notifications, and user/app timelines. Most methods return true if the operation was successful.
Note: Many methods are deprecated in favor of the new Post-based API.
- Author:
- Massimiliano Assante ISTI-CNR, Costantino Perciante ISTI-CNR
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddComment(Comment comment) add a comment to a feedbooleanapproveFriendship(String from, String to) Approves a friendship request from one user to another.booleanbooleancheckUnreadNotifications(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) Denies a friendship request from one user to another.booleaneditComment(Comment comment) edit a commentgetAllCommentByFeed(String feedid) Deprecated.use getAllCommentByPostgetAllCommentByPost(String postid) getAllFeedsByApp(String appid) Deprecated.use getAllPostsByApp insteadgetAllFeedsByUser(String userid) Deprecated.use getAllPostsByUser insteadgetAllFeedsByVRE(String vreid) Deprecated.use getAllPostsByVREgetAllLikedFeedIdsByUser(String userid) Deprecated.use getAllLikedPostIdsByUsergetAllLikedFeedsByUser(String userid, int limit) Deprecated.use getAllLikedPostsByUsergetAllLikedPostIdsByUser(String userid) getAllLikedPostsByUser(String userid, int limit) getAllLikesByFeed(String postid) Deprecated.use getAllLikesByPostgetAllLikesByPost(String postid) getAllNotificationByUser(String userid, int limit) Deprecated.use getAllPortalPrivacyLevelPosts instead return all the feeds whose Level is PORTALreturn all the feeds whose Level is PORTALgetAllPostsByApp(String appid) getAllPostsByUser(String userid) getAllPostsByVRE(String vreid) Returns all posts for a specified VRE.Retrieve all the ids of the vregetAttachmentsByFeedId(String feedId) getFriends(String userid) Gets the list of friends for a specified user.getInvitedEmailsByVRE(String vreid, InviteStatus... status) Use to get the list of invites per VREgetPendingFriendRequests(String userid) Gets the list of pending friend requests for a specified user.getRangeNotificationsByUser(String userid, int from, int quantity) getRecentCommentedFeedsByUserAndDate(String userid, long timeInMillis) Deprecated.use getRecentCommentedPostsByUserAndDate insteadgetRecentCommentedPostsByUserAndDate(String userid, long timeInMillis) getRecentCommentsByUserAndDate(String userid, long timeInMillis) getRecentFeedsByUser(String userid, int quantity) Deprecated.getRecentFeedsByUserAndDate(String userid, long timeInMillis) Deprecated.use getRecentPostsByUserAndDategetRecentFeedsByVRE(String vreid, int quantity) Deprecated.use getRecentPostsByVRE return the most recent feeds for this vre up to quantity paramgetRecentFeedsByVREAndRange(String vreid, int from, int quantity) Deprecated.UsegetRecentPostsByVREAndRange(String, int, int)instead.getRecentLikedFeedsByUserAndDate(String userid, long timeInMillis) Deprecated.use getRecentLikedPostsByUserAndDategetRecentLikedPostsByUserAndDate(String userid, long timeInMillis) getRecentPostsByUser(String userid, int quantity) return the most recent feeds for this user up to quantity paramgetRecentPostsByUserAndDate(String userid, long timeInMillis) getRecentPostsByVRE(String vreid, int quantity) Returns the most recent posts for a VRE, up to the specified quantity.getRecentPostsByVREAndRange(String vreid, int from, int quantity) Returns the most recent posts for a VRE within a specified range, and provides the last index of posts in the timeline for pagination purposes.getUnreadNotificationsByUser(String userid) Returns all unread notifications for a user (excluding message notifications).getUserNotificationChannels(String userid, NotificationType notificationType) Returns the notification channels a user has chosen for a given notification type.getUserNotificationPreferences(String userid) Gets the notification preferences map (enable or disable the channels to be used for notifying the user).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 VRE.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.getVREPostsByHashtag(String vreid, String hashtag) Returns all posts in a VRE that contain a specific hashtag.isExistingInvite(String vreid, String email) booleanadd a like to a feedreadCommentById(String commentId) Deprecated.use readPost read a feed from a given idreadInvite(String inviteid) read an invite from a given idreadNotification(String notificationid) Reads a notification from a given ID.read a feed from a given idbooleanrequestFriendship(String from, String to) Requests a friendship from one user to another.booleansaveAppFeed(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 postbooleansaveAttachmentEntry(String feedId, Attachment toSave) save an attachmentbooleansaveFeedToVRETimeline(String feedKey, String vreid) Deprecated.use savePostToVRETimelinebooleansaveHashTags(String postid, String vreid, List<String> hashtags) booleansaveHashTagsComment(String commentId, String vreid, List<String> hashtags) saveInvite(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 a feed
-
Method Details
-
requestFriendship
Requests a friendship from one user to another.- Parameters:
from- The user ID requesting the friendship.to- The user ID receiving the friendship request.- Returns:
- true if the operation was successful.
-
approveFriendship
Approves a friendship request from one user to another.- Parameters:
from- The user ID approving the friendship.to- The user ID being approved.- Returns:
- true if the operation was successful.
-
denyFriendship
Denies a friendship request from one user to another.- Parameters:
from- The user ID denying the friendship.to- The user ID being denied.- Returns:
- true if the operation was successful.
-
getFriends
Gets the list of friends for a specified user.- Parameters:
userid- The user ID to get friends for.- Returns:
- A
Listof user IDs representing the friends of the given user.
-
getPendingFriendRequests
Gets the list of pending friend requests for a specified user.- Parameters:
userid- The user ID to get pending friend requests for.- Returns:
- A
Listof user IDs representing pending friend requests for the given user.
-
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
Deprecated.use savePostToVRETimelineSave a post in the VRES TimeLine in the store- Parameters:
feedKey- feedKeyvreid- vre identifier- Throws:
FeedIDNotFoundException
-
savePostToVRETimeline
save a post in the VRES TimeLine in the store- Parameters:
postKey- the post idvreid- vre identifier- Throws:
FeedIDNotFoundException
-
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
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
- 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, PrivacyLevelTypeNotFoundExceptionDeprecated.use getAllPortalPrivacyLevelPosts instead return all the feeds whose Level is PORTAL -
getAllPortalPrivacyLevelPosts
List<Post> getAllPortalPrivacyLevelPosts() throws FeedTypeNotFoundException, ColumnNameNotFoundException, PrivacyLevelTypeNotFoundExceptionreturn 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
Listof 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
Listof 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 Returns all posts for a specified VRE.- Parameters:
vreid- The VRE identifier.- Returns:
- A
Listof all posts belonging to the specified VRE. - Throws:
FeedTypeNotFoundException- If a feed type is not recognized.PrivacyLevelTypeNotFoundException- If a privacy level is not recognized.ColumnNameNotFoundException- If a column name is not found.FeedIDNotFoundException- If a feed ID is not found.
-
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
Listof most recent feeds for this vre - Throws:
FeedTypeNotFoundExceptionPrivacyLevelTypeNotFoundExceptionColumnNameNotFoundExceptionIllegalArgumentExceptionFeedIDNotFoundException
-
getRecentPostsByVRE
List<Post> getRecentPostsByVRE(String vreid, int quantity) throws IllegalArgumentException, PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, FeedIDNotFoundException Returns the most recent posts for a VRE, up to the specified quantity.- Parameters:
vreid- The VRE identifier.quantity- The maximum number of most recent posts to return.- Returns:
- A
Listof most recent posts for this VRE. - Throws:
IllegalArgumentException- If vreid is null or quantity is invalid.FeedTypeNotFoundException- If a feed type is not recognized.PrivacyLevelTypeNotFoundException- If a privacy level is not recognized.ColumnNameNotFoundException- If a column name is not found.FeedIDNotFoundException- If a feed ID is not found.
-
getRecentFeedsByVREAndRange
RangeFeeds getRecentFeedsByVREAndRange(String vreid, int from, int quantity) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, FeedIDNotFoundException Deprecated.UsegetRecentPostsByVREAndRange(String, int, int)instead.Returns the most recent posts for this VRE up to the specified quantity and the last index of the posts in the timeline. The lastReturnedFeedTimelineIndex is useful to know from where to start the range the next time you query, as there may be deletions.- Parameters:
vreid- The VRE identifier.from- The range start (most recent posts for this VRE). Must be greater than 0.quantity- The number of most recent posts for this VRE starting from the "from" parameter.- Returns:
- A
RangeFeedscontaining the most recent posts for this VRE and the last index in the timeline. - Throws:
FeedTypeNotFoundException- If a feed type is not recognized.PrivacyLevelTypeNotFoundException- If a privacy level is not recognized.ColumnNameNotFoundException- If a column name is not found.FeedIDNotFoundException- If a feed ID is not found.
-
getRecentPostsByVREAndRange
RangePosts getRecentPostsByVREAndRange(String vreid, int from, int quantity) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, FeedIDNotFoundException Returns the most recent posts for a VRE within a specified range, and provides the last index of posts in the timeline for pagination purposes.- Parameters:
vreid- The VRE identifier.from- The starting index (0-based) for retrieving posts. Must be greater than 0.quantity- The maximum number of posts to retrieve starting from the "from" index.- Returns:
- A
RangePostscontaining the most recent posts for this VRE and pagination metadata. - Throws:
FeedTypeNotFoundException- If a feed type is not recognized.PrivacyLevelTypeNotFoundException- If a privacy level is not recognized.ColumnNameNotFoundException- If a column name is not found.FeedIDNotFoundException- If a feed ID is not found.
-
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
-
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 Reads a notification from a given ID.- Parameters:
notificationid- The notification ID to read.- Returns:
- The
Notificationcorresponding to the given ID. - Throws:
ColumnNameNotFoundException- If a column name is not found.NotificationIDNotFoundException- If a notification ID is not found.NotificationTypeNotFoundException- If a notification type is not recognized.
-
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:
ColumnNameNotFoundException- If a column name is not found.NotificationIDNotFoundException- If a notification ID is not found.NotificationTypeNotFoundException- If a notification type is not recognized.
-
getUnreadNotificationsByUser
List<Notification> getUnreadNotificationsByUser(String userid) throws NotificationTypeNotFoundException, ColumnNameNotFoundException, NotificationIDNotFoundException Returns all unread notifications for a user (excluding message notifications).- Parameters:
userid- The user identifier.- Returns:
- A
Listof unread notifications for this user. - Throws:
NotificationTypeNotFoundException- If a notification type is not recognized.ColumnNameNotFoundException- If a column name is not found.NotificationIDNotFoundException- If a notification ID is not found.
-
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:
ColumnNameNotFoundException- If a column name is not found.NotificationTypeNotFoundException- If a notification type is not recognized.NotificationIDNotFoundException- If a notification ID is not found.
-
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 Gets the notification preferences map (enable or disable the channels to be used for notifying the user).- Parameters:
userid- The user identifier.- Returns:
- The map of
NotificationTypetoNotificationChannelType. - Throws:
NotificationTypeNotFoundException- If a notification type is not recognized.NotificationChannelTypeNotFoundException- If a notification channel type is not recognized.
-
readCommentById
- Parameters:
commentId- comment unique identifier- Returns:
- the comment belonging to the commentId
- Throws:
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
- 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 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
-
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
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<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
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 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
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
Mapof 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 this timestamp.- Returns:
- a
Mapof 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 Returns all posts in a VRE that contain a specific hashtag.- Parameters:
vreid- The VRE identifier.hashtag- The hashtag to search for (including the '#'). Case-sensitive.- Returns:
- A
Listof posts containing the specified hashtag. - Throws:
PrivacyLevelTypeNotFoundException- If a privacy level is not recognized.FeedTypeNotFoundException- If a feed type is not recognized.FeedIDNotFoundException- If a feed ID is not found.ColumnNameNotFoundException- If a column name is not found.
-
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
read an invite from a given id -
getAttachmentsByFeedId
- 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
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
-