using System.Collections.Generic; using System.Threading.Tasks; using Abp.Domain.Entities; namespace Abp.Notifications { /// /// Used to manage subscriptions for notifications. /// public interface INotificationSubscriptionManager { /// /// Subscribes to a notification for given user and notification informations. /// /// User /// Name of the notification. /// entity identifier Task SubscribeAsync(UserIdentifier user, string notificationName, EntityIdentifier entityIdentifier = null); /// /// Subscribes to all available notifications for given user. /// It does not subscribe entity related notifications. /// /// User. Task SubscribeToAllAvailableNotificationsAsync(UserIdentifier user); /// /// Unsubscribes from a notification. /// /// User. /// Name of the notification. /// entity identifier Task UnsubscribeAsync(UserIdentifier user, string notificationName, EntityIdentifier entityIdentifier = null); /// /// Gets all subscribtions for given notification (including all tenants). /// This only works for single database approach in a multitenant application! /// /// Name of the notification. /// entity identifier Task> GetSubscriptionsAsync(string notificationName, EntityIdentifier entityIdentifier = null); /// /// Gets all subscribtions for given notification. /// /// Tenant id. Null for the host. /// Name of the notification. /// entity identifier Task> GetSubscriptionsAsync(int? tenantId, string notificationName, EntityIdentifier entityIdentifier = null); /// /// Gets subscribed notifications for a user. /// /// User. Task> GetSubscribedNotificationsAsync(UserIdentifier user); /// /// Checks if a user subscribed for a notification. /// /// User. /// Name of the notification. /// entity identifier Task IsSubscribedAsync(UserIdentifier user, string notificationName, EntityIdentifier entityIdentifier = null); } }