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 Details

    • 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(org.gcube.portal.databook.shared.Feed feed)
      Deprecated.
      use saveUserPost save a Feed instance in the store
      Returns:
      true if everything went fine
    • saveUserPost

      boolean saveUserPost(org.gcube.portal.databook.shared.Post feed)
      save a Post instance in the store
      Returns:
      true if everything went fine
    • saveUserFeed

      boolean saveUserFeed(org.gcube.portal.databook.shared.Feed feed, List<org.gcube.portal.databook.shared.Attachment> attachments)
      Deprecated.
      use saveUserPost
      Save 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(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 post
      Parameters:
      attachments - a list of attachments starting from the second
      Returns:
      true if everything went fine
    • 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 saveUserPost
      Delete a Feed from the store
      Returns:
      true if everything went fine
      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
    • 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.FeedIDNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
    • saveFeedToVRETimeline

      boolean saveFeedToVRETimeline(String feedKey, String vreid) throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
      Deprecated.
      use savePostToVRETimeline
      Save a post in the VRES TimeLine in the store
      Parameters:
      feedKey - feedKey
      vreid - 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 id
      vreid - vre identifier
      Throws:
      org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
    • saveAppFeed

      boolean saveAppFeed(org.gcube.portal.databook.shared.Feed feed)
      Deprecated.
      use saveAppPost save a Post instance in the store
      Returns:
      true if everything went fine
    • saveAppPost

      boolean saveAppPost(org.gcube.portal.databook.shared.Post feed)
      save a Post instance in the store
      Returns:
      true if everything went fine
    • saveAppFeed

      boolean saveAppFeed(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 post
      Parameters:
      attachments - a list of attachments starting from the second
      Returns:
      true if everything went fine
    • saveAppPost

      boolean saveAppPost(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 post
      Parameters:
      attachments - a list of attachments starting from the second
      Returns:
      true if everything went fine
    • 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.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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.rossi
      timeInMillis - 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.rossi
      timeInMillis - 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.PrivacyLevelTypeNotFoundException
      Deprecated.
      use getAllPortalPrivacyLevelPosts instead return all the feeds whose Level is PORTAL
      Throws:
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.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.PrivacyLevelTypeNotFoundException
      return all the feeds whose Level is PORTAL
      Throws:
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.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 identifier
      quantity - the number of most recent feeds for this user
      Returns:
      a List of most recent feeds for this user
      Throws:
      org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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 identifier
      quantity - the number of most recent feeds for this user
      Returns:
      a List of most recent feeds for this user
      Throws:
      org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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 identifier
      quantity - the number of most recent feeds for this vre
      Returns:
      a List of most recent feeds for this vre
      Throws:
      org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      IllegalArgumentException
      org.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 identifier
      quantity - the number of most recent posts for this vre
      Returns:
      a List of most recent posts for this vre
      Throws:
      org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      IllegalArgumentException
      org.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 getRecentPostsByVREAndRange
      return 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 identifier
      from - the range start (most recent feeds for this vre) has to be greater than 0
      quantity - the number of most recent feeds for this vre starting from "from" param
      Returns:
      a RangeFeeds containing of most recent feeds for this vre
      Throws:
      org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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 identifier
      from - the range start (most recent feeds for this vre) has to be greater than 0
      quantity - the number of most recent feeds for this vre starting from "from" param
      Returns:
      a RangePosts containing of most recent feeds for this vre
      Throws:
      org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException
      org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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 identifier
      timeInMillis - 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 identifier
      timeInMillis - 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(org.gcube.portal.databook.shared.Notification notification)
      save a Notification instance in the store
      Returns:
      true if everything went fine
    • 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.NotificationIDNotFoundException
      org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException
      org.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 found
      org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException - if the notification ID is not found
      org.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 identifier
      limit - 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.NotificationTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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 identifier
      from - the range start has to be greater than 0
      quantity - 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.NotificationTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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 found
      org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException - if the notification ID is not found
      org.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 List of not yet read notifications for this user
      Throws:
      org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException
      org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException
      org.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.ColumnNameNotFoundException
      org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException
      org.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.ColumnNameNotFoundException
      org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException - self explaining
      org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException
    • getUserNotificationChannels

      List<org.gcube.portal.databook.shared.NotificationChannelType> getUserNotificationChannels(String userid, org.gcube.portal.databook.shared.NotificationType notificationType) throws org.gcube.portal.databook.shared.ex.NotificationChannelTypeNotFoundException, org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException
      return the channels a user chose for being notified for a given notification type
      Parameters:
      userid - user identifier
      notificationType - the type of the notification
      Returns:
      a list of NotificationChannelType that represents the channels this user wants to be notified
      Throws:
      org.gcube.portal.databook.shared.ex.NotificationChannelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException
    • 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 identifier
      enabledChannels - 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 explaining
      org.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
    • addComment

      boolean addComment(org.gcube.portal.databook.shared.Comment comment) throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
      add a comment to a feed
      Parameters:
      comment - the Comment instance to add
      Throws:
      org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
    • getAllCommentByFeed

      List<org.gcube.portal.databook.shared.Comment> getAllCommentByFeed(String feedid)
      Deprecated.
      use getAllCommentByPost
      Parameters:
      feedid - feed identifier return all the comments belonging to the feedid
    • getAllCommentByPost

      List<org.gcube.portal.databook.shared.Comment> getAllCommentByPost(String postid)
      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 identifier
      timeInMillis - 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(org.gcube.portal.databook.shared.Comment comment) 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
      edit a comment
      Parameters:
      comment - the comment to edit
      Returns:
      true if success, false otherwise
      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
    • 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 delete
      feedid - the feedid to which the comment is associated
      Returns:
      true if success, false otherwise
      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
    • like

      boolean like(org.gcube.portal.databook.shared.Like like) throws org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
      add a like to a feed
      Parameters:
      like - instance
      Throws:
      org.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 identifier
      likeid - the like identifier to delete
      feedid - the feedid to which the comment is associated
      Returns:
      true if success, false otherwise
      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
    • 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<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 identifier
      limit - 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.PrivacyLevelTypeNotFoundException
      org.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 identifier
      limit - 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.PrivacyLevelTypeNotFoundException
      org.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 identifier
      timeInMillis - 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 identifier
      timeInMillis - 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<org.gcube.portal.databook.shared.Like> getAllLikesByFeed(String postid)
      Deprecated.
      use getAllLikesByPost
      Parameters:
      postid - postid identifier return all the likes belonging to the postid
    • getAllLikesByPost

      List<org.gcube.portal.databook.shared.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 org.gcube.portal.databook.shared.ex.FeedIDNotFoundException
      Parameters:
      hashtags - the hashtag including the '#'
      postid - the postid to which the hashtag is associated
      vreid - 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 associated
      vreid - 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 associated
      vreid - 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 associated
      vreid - VRE identifier
      Returns:
      true if success, false otherwise
      Throws:
      org.gcube.portal.databook.shared.ex.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>String, Integer< 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>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 identifier
      hashtag - 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.PrivacyLevelTypeNotFoundException
      org.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 identifier
      hashtag - 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.PrivacyLevelTypeNotFoundException
      org.gcube.portal.databook.shared.ex.FeedIDNotFoundException - .
    • saveInvite

      org.gcube.portal.databook.shared.InviteOperationResult saveInvite(org.gcube.portal.databook.shared.Invite invite) throws jakarta.mail.internet.AddressException
      Save the invite for a given email into a given vre
      Parameters:
      invite - the invite object instanc to save
      Returns:
      InviteOperationResult SUCCESS, FAILED or ALREADY_INVITED (if an invite is sent to en existing email in the same environment more than once)
      Throws:
      jakarta.mail.internet.AddressException
    • isExistingInvite

      String isExistingInvite(String vreid, String email)
      Parameters:
      vreid - the environment where you want to check the invite
      email - 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.InviteIDNotFoundException
      org.gcube.portal.databook.shared.ex.InviteStatusNotFoundException
    • setInviteStatus

      boolean setInviteStatus(String vreid, String email, org.gcube.portal.databook.shared.InviteStatus status) throws org.gcube.portal.databook.shared.ex.InviteIDNotFoundException, org.gcube.portal.databook.shared.ex.InviteStatusNotFoundException
      set the status of an invite, see InviteStatus
      Throws:
      org.gcube.portal.databook.shared.ex.InviteIDNotFoundException
      org.gcube.portal.databook.shared.ex.InviteStatusNotFoundException
    • getInvitedEmailsByVRE

      List<org.gcube.portal.databook.shared.Invite> getInvitedEmailsByVRE(String vreid, org.gcube.portal.databook.shared.InviteStatus... status) throws org.gcube.portal.databook.shared.ex.InviteIDNotFoundException, org.gcube.portal.databook.shared.ex.InviteStatusNotFoundException
      Use to get the list of invites per VRE
      Parameters:
      vreid - the vre id
      status - optional, if you want to restict on the status, e.g. all pending invites
      Returns:
      return the list of invites
      Throws:
      org.gcube.portal.databook.shared.ex.InviteIDNotFoundException
      org.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

      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