2012-12-07 15:06:26 +01:00
|
|
|
package org.gcube.applicationsupportlayer.social;
|
|
|
|
|
2013-07-11 17:25:21 +02:00
|
|
|
import java.util.Date;
|
2013-03-25 12:08:25 +01:00
|
|
|
import java.util.List;
|
2017-01-20 14:45:53 +01:00
|
|
|
import java.util.Set;
|
2013-03-25 12:08:25 +01:00
|
|
|
|
2018-06-26 17:29:06 +02:00
|
|
|
import org.gcube.applicationsupportlayer.social.shared.SocialFileItem;
|
|
|
|
import org.gcube.applicationsupportlayer.social.shared.SocialSharedFolder;
|
2015-06-11 14:08:50 +02:00
|
|
|
import org.gcube.portal.databook.shared.NotificationType;
|
2014-09-30 12:36:37 +02:00
|
|
|
import org.gcube.portal.databook.shared.RunningJob;
|
2012-12-07 15:06:26 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @author Massimiliano Assante, ISTI-CNR
|
|
|
|
*
|
|
|
|
*/
|
2013-01-03 16:28:36 +01:00
|
|
|
public interface NotificationsManager {
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user he got a workspace folder shared
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param sharedFolder the shared {@link SocialSharedFolder} instance
|
2018-06-19 18:57:22 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyFolderSharing(String userIdToNotify, SocialSharedFolder sharedFolder) throws Exception;
|
2014-09-29 18:47:23 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user he got a workspace folder shared
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
|
|
|
* @param unsharedFolderId the unshared folder id
|
|
|
|
* @param unsharedFolderName the unshared folder name
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
|
|
|
boolean notifyFolderUnsharing(String userIdToNotify, String unsharedFolderId, String unsharedFolderName) throws Exception;
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user he got upgraded to Administrator of a folder shared
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param sharedFolder the shared {@link SocialSharedFolder} instance
|
2018-06-19 18:57:22 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*
|
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyAdministratorUpgrade(String userIdToNotify, SocialSharedFolder sharedFolder) throws Exception;
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user he got downgraded from Administrator of a folder shared
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param sharedFolder the shared {@link SocialSharedFolder}
|
2018-06-19 18:57:22 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyAdministratorDowngrade(String userIdToNotify, SocialSharedFolder sharedFolder) throws Exception;
|
2013-03-20 15:45:06 +01:00
|
|
|
/**
|
|
|
|
* use to notify a user he got a workspace folder renamed
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
|
|
|
* @param previousName the previous name of the folder
|
|
|
|
* @param newName the new name of the folder
|
|
|
|
* @param renamedFolderId the folderId
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
|
|
|
boolean notifyFolderRenaming(String userIdToNotify, String previousName, String newName, String renamedFolderId) throws Exception;
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user that a new user was added in on of his workspace shared folder
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param sharedFolder the shared {@link SocialSharedFolder} instance
|
2018-06-19 18:57:22 +02:00
|
|
|
* @param newAddedUserId the new user that was added
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyFolderAddedUser(String userIdToNotify, SocialSharedFolder sharedFolder, String newAddedUserId) throws Exception;
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user that a new user was added in on of his workspace shared folder
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param sharedFolder the shared {@link SocialSharedFolder} instance
|
2018-06-19 18:57:22 +02:00
|
|
|
* @param newAddedUserIds List of new users that were added
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyFolderAddedUsers(String userIdToNotify, SocialSharedFolder sharedFolder, List<String> newAddedUserIds) throws Exception;
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user that an existing user was removed from one of his workspace shared folder
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param sharedFolder the shared {@link SocialSharedFolder}
|
2018-06-19 18:57:22 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyFolderRemovedUser(String userIdToNotify, SocialSharedFolder sharedFolder) throws Exception;
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user he got a workspace item new in some of his workspace shared folder
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param newItem the new shared {@link SocialFileItem} instance
|
|
|
|
* @param sharedFolder the shared folder {@link SocialSharedFolder} instance
|
2018-06-19 18:57:22 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyAddedItem(String userIdToNotify, SocialFileItem item, SocialSharedFolder sharedFolder) throws Exception;
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user he got a workspace item deleted from one of his workspace shared folder
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param removedItem the removed item instance of {@link SocialFileItem}
|
|
|
|
* @param sharedFolder the shared folder {@link SocialSharedFolder}
|
2018-06-19 18:57:22 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyMovedItem(String userIdToNotify, SocialFileItem item, SocialSharedFolder sharedFolder) throws Exception;
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user he got a workspace item deleted from one of his workspace shared folder
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param removedItem the removed name
|
|
|
|
* @param sharedFolder the shared folder {@link SocialSharedFolder}
|
2018-06-19 18:57:22 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyRemovedItem(String userIdToNotify, String item, SocialSharedFolder sharedFolder) throws Exception;
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user he got a workspace item updated from one of his workspace shared folder
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param updatedItem the updated shared {@link SocialFileItem}
|
|
|
|
* @param sharedFolder the shared folder {@link SocialSharedFolder}
|
2018-06-19 18:57:22 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyUpdatedItem(String userIdToNotify, SocialFileItem item, SocialSharedFolder sharedFolder) throws Exception;
|
2018-06-19 18:57:22 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user he got a workspace item renamed
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
|
|
|
* @param previousName the previous name of the folder
|
2018-06-26 17:29:06 +02:00
|
|
|
* @param renamedItem the renamed {@link SocialFileItem}
|
|
|
|
* @param rootSharedFolder the root shared {@link SocialSharedFolder} of the {@link SocialFileItem}
|
2018-06-19 18:57:22 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
2013-03-25 14:38:14 +01:00
|
|
|
*/
|
2018-06-26 17:29:06 +02:00
|
|
|
boolean notifyItemRenaming(String userIdToNotify, String previousName, SocialFileItem renamedItem, SocialSharedFolder rootSharedFolder) throws Exception;
|
2012-12-07 16:29:09 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2015-10-09 10:02:47 +02:00
|
|
|
* @param messageUniqueIdentifier the unique identifier of the message
|
2013-01-09 17:47:22 +01:00
|
|
|
* @param subject the subject of the message sent
|
2015-10-09 10:02:47 +02:00
|
|
|
* @param messageText the text of the message (text/plain)
|
2015-10-14 17:27:13 +02:00
|
|
|
* @param otherRecipientsFullNames the Full Names of the other recipients. if any
|
2012-12-07 16:29:09 +01:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2015-10-14 17:27:13 +02:00
|
|
|
boolean notifyMessageReceived(String userIdToNotify, String messageUniqueIdentifier, String subject, String messageText, String ... otherRecipientsFullNames);
|
2013-07-11 17:25:21 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
|
|
|
* @param eventTitle the title of the event
|
|
|
|
* @param eventType the type of the event
|
|
|
|
* @param startDate staring date
|
|
|
|
* @param endingDate ending date
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
|
|
|
boolean notifyNewCalendarEvent(String userIdToNotify, String eventTitle, String eventType, Date startDate, Date endingDate);
|
2013-07-12 16:59:26 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
|
|
|
* @param eventTitle the title of the event
|
|
|
|
* @param eventType the type of the event
|
|
|
|
* @param startDate staring date
|
|
|
|
* @param endingDate ending date
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
|
|
|
boolean notifyEditedCalendarEvent(String userIdToNotify, String eventTitle, String eventType, Date startDate, Date endingDate);
|
2013-07-12 17:06:34 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
|
|
|
* @param eventTitle the title of the event
|
|
|
|
* @param eventType the type of the event
|
|
|
|
* @param startDate staring date
|
|
|
|
* @param endingDate ending date
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
|
|
|
boolean notifyDeletedCalendarEvent(String userIdToNotify, String eventTitle, String eventType, Date startDate, Date endingDate);
|
2017-01-20 14:45:53 +01:00
|
|
|
|
2014-03-05 00:40:14 +01:00
|
|
|
/**
|
|
|
|
* use to notify a user that someone created this post
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-25 16:01:04 +02:00
|
|
|
* @param postid the liked postid
|
|
|
|
* @param postText the liked post text or a portion of it
|
2014-03-05 00:40:14 +01:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2017-01-20 14:45:53 +01:00
|
|
|
@Deprecated
|
2018-06-25 16:01:04 +02:00
|
|
|
boolean notifyPost(String userIdToNotify, String postid, String postText, String ... hashtags);
|
2017-01-20 14:45:53 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* use to notify a user that someone created this post
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-25 16:01:04 +02:00
|
|
|
* @param postid the liked postid
|
|
|
|
* @param postText the liked post text or a portion of it
|
2017-01-20 14:45:53 +01:00
|
|
|
* @param mentionedVREGroups the names of the mentioned vre's groups, if any
|
|
|
|
* @param hashtags the set of hashtags in the post, if any
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-25 16:01:04 +02:00
|
|
|
boolean notifyPost(String userIdToNotify, String postid, String postText, Set<String> mentionedVREGroups, Set<String> hashtags);
|
2017-01-20 14:45:53 +01:00
|
|
|
|
2012-12-07 16:29:09 +01:00
|
|
|
/**
|
2013-01-11 12:36:44 +01:00
|
|
|
* use to notify a user that someone commented on his post
|
2012-12-07 16:29:09 +01:00
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-25 16:01:04 +02:00
|
|
|
* @param postid the liked postid
|
|
|
|
* @param postText the liked post text or a portion of it
|
2016-02-17 18:27:46 +01:00
|
|
|
* @param commentKey when sending email, stop the shown discussion at that comment
|
2012-12-07 16:29:09 +01:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-25 16:01:04 +02:00
|
|
|
boolean notifyOwnCommentReply(String userIdToNotify, String postid, String postText, String commentKey);
|
2012-12-07 16:29:09 +01:00
|
|
|
/**
|
2013-01-11 12:36:44 +01:00
|
|
|
* use to notify a user that commented on a post (Not his) that someone commented too
|
2012-12-07 16:29:09 +01:00
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-25 16:01:04 +02:00
|
|
|
* @param postid the liked postid
|
|
|
|
* @param postText the liked post text or a portion of it
|
|
|
|
* @param postOwnerFullName the full name of the user who created the post
|
|
|
|
* @param postOwnerId the username of the user who created the post
|
2016-02-17 18:27:46 +01:00
|
|
|
* @param commentKey when sending email, stop the shown discussion at that comment
|
2012-12-07 16:29:09 +01:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-25 16:01:04 +02:00
|
|
|
boolean notifyCommentReply(String userIdToNotify, String postid, String postText, String postOwnerFullName, String postOwnerId, String commentKey);
|
2013-04-18 16:34:07 +02:00
|
|
|
/**
|
2016-09-26 12:14:27 +02:00
|
|
|
* @deprecated use notifyCommentOnLike
|
|
|
|
* use to notify a user that someone commented on one of his liked posts
|
2013-04-18 16:34:07 +02:00
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-25 16:01:04 +02:00
|
|
|
* @param postid the liked postid
|
2013-04-18 17:32:04 +02:00
|
|
|
* @param commentText the commentText
|
2016-02-17 18:27:46 +01:00
|
|
|
* @param commentKey when sending email, stop the shown discussion at that comment
|
2013-04-18 16:34:07 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-25 16:01:04 +02:00
|
|
|
boolean notifyCommentOnFavorite(String userIdToNotify, String postid, String commentText, String commentKey);
|
2016-09-26 12:14:27 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-25 16:01:04 +02:00
|
|
|
* @param postid the liked postid
|
2016-09-26 12:14:27 +02:00
|
|
|
* @param commentText the commentText
|
|
|
|
* @param commentKey when sending email, stop the shown discussion at that comment
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-25 16:01:04 +02:00
|
|
|
boolean notifyCommentOnLike(String userIdToNotify, String postid, String commentText, String commentKey);
|
2013-04-18 11:21:31 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user that he was mentioned (tagged) on a post
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-25 16:01:04 +02:00
|
|
|
* @param postid the liked postid
|
2013-04-18 11:21:31 +02:00
|
|
|
* @param feedText the liked feed text or a portion of it
|
2016-02-17 18:27:46 +01:00
|
|
|
* @param commentKey when sending email, stop the shown discussion at that comment
|
2013-04-18 11:21:31 +02:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2018-06-25 16:01:04 +02:00
|
|
|
boolean notifyUserTag(String userIdToNotify, String postid, String commentText, String commentKey);
|
2012-12-07 16:29:09 +01:00
|
|
|
/**
|
2013-01-11 12:36:44 +01:00
|
|
|
* use to notify a user he got one of his post liked
|
2012-12-07 16:29:09 +01:00
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
2018-06-25 16:01:04 +02:00
|
|
|
* @param postid the liked postid
|
|
|
|
* @param postText the liked post text or a portion of it
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
* @deprecated use notifyLikedPost
|
|
|
|
*/
|
|
|
|
@Deprecated
|
|
|
|
boolean notifyLikedFeed(String userIdToNotify, String postid, String postText);
|
|
|
|
/**
|
|
|
|
* use to notify a user he got one of his post liked
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
|
|
|
* @param postid the liked postid
|
|
|
|
* @param postText the liked post text or a portion of it
|
2012-12-07 16:30:09 +01:00
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
2012-12-07 16:29:09 +01:00
|
|
|
*/
|
2018-06-25 16:01:04 +02:00
|
|
|
boolean notifyLikedPost(String userIdToNotify, String postid, String postText);
|
2013-01-03 16:28:36 +01:00
|
|
|
/**
|
2013-01-11 12:36:44 +01:00
|
|
|
* use to notify a user he got one of his job finished
|
2013-01-03 16:28:36 +01:00
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2017-01-20 14:45:53 +01:00
|
|
|
boolean notifyJobStatus(String userIdToNotify, RunningJob job);
|
2016-09-26 12:14:27 +02:00
|
|
|
|
2015-06-11 14:56:34 +02:00
|
|
|
boolean notifyTDMTabularResourceSharing(String userIdToNotify, String tabularResourceName, String encodedTabularResourceParams) throws Exception;
|
2015-06-11 14:08:50 +02:00
|
|
|
/**
|
|
|
|
* use to notify a user he got a Tabular Data Resource shared
|
|
|
|
*
|
|
|
|
* @param userIdToNotify the user you want to notify
|
|
|
|
* @param type type of the shared tdm object (TDM Rule or TDM Template at the moment)
|
|
|
|
* @param tdmObjectName the name
|
|
|
|
* @param encodedTabularResourceParams the parameters to be placed in the HTTP GET Request (must be encoded)
|
|
|
|
* @return true if the notification is correctly delivered, false otherwise
|
|
|
|
*/
|
2015-06-11 14:56:34 +02:00
|
|
|
boolean notifyTDMObjectSharing(String userIdToNotify, NotificationType type, String tdmObjectName, String encodedTabularResourceParams) throws Exception;
|
2013-01-29 16:24:44 +01:00
|
|
|
|
2012-12-07 15:06:26 +01:00
|
|
|
}
|