Package org.cyclos.impl.messaging
Interface NotificationSettingsServiceLocal
-
- All Superinterfaces:
NotificationSettingsService,Service
public interface NotificationSettingsServiceLocal extends NotificationSettingsService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanallowMailing(User user, BulkActionNature nature)Returns whether the given mailing type is allowed for the uservoidappendAccountSettingsValidations(BasicUser owner, Property property)Appends validations of account settings according to the given ownerNotificationSettingsfindNotificationSettings(BasicUser user, boolean checkAccess)Returns the user's notifications preference or null if there's none, optionally checking access<T> List<T>getAvailableOptionsFor(User user, AdminNotificationType type)NotificationTypeSettingsDTOgetNotificationTypeSettings(Notification notification)Returns the notifications settings for an already generated notification.
This method never return null, if the user hasn't saved his preferences it creates a default one.AdminNotificationTypegetTypeBasedOnSetting(AdminNotificationType type)Returns the notification type which the given type is based on.
This method must be used when the given type does not have a corresponding setting, but uses settings from another type.
E.g:AdminNotificationType.USER_IMPORT_REGISTRATIONis based onAdminNotificationType.USER_REGISTRATIONbooleanisAllowedNotificationType(AdminNotificationType type, User user)It checks if the user has thePermission.MY_NOTIFICATIONS_ENABLEpermission and is allowed to be notified by the specified type.booleanisEnabled(UserNotificationType type, BasicUser user, SimpleEntity entity)It returns true if the notification type is enabled by permission and if the user had selected being notified by that type.booleanisPaymentAmountInRange(BasicUser user, UserAccountType accountType, BigDecimal amount)Returns whether the given amount is included in the payment amount range the given user has set for payments from / to the given account typeStringkeyForEmailUnsubscribe(BasicUser user, EmailUnsubscribeType type)Returns a key for unsubscribing from a particular e-mail.UserNotificationSettingsDTOresolveUserNotificationSettingsDTO(BasicUser user, BooleanPropertiesHolder<UserNotificationType> productNotifications, UserNotificationSettings settings)Returns the user notification settings dto for the given settings and user, if no productNotifications is given, it resolves ones for the given user.com.mysema.commons.lang.CloseableIterator<BasicUser>usersToForwardMessageIterator(IncomingMessage message)It returns an iterator over all users allowed to forward the corresponding incoming message.-
Methods inherited from interface org.cyclos.services.messaging.NotificationSettingsService
emailUnsubscribe, getData, getEmailUnsubscribeData, save
-
-
-
-
Method Detail
-
allowMailing
boolean allowMailing(User user, BulkActionNature nature)
Returns whether the given mailing type is allowed for the user
-
appendAccountSettingsValidations
void appendAccountSettingsValidations(BasicUser owner, Property property)
Appends validations of account settings according to the given owner
-
findNotificationSettings
NotificationSettings findNotificationSettings(BasicUser user, boolean checkAccess)
Returns the user's notifications preference or null if there's none, optionally checking access
-
getAvailableOptionsFor
<T> List<T> getAvailableOptionsFor(User user, AdminNotificationType type)
- Returns:
- the available options for the specified user and type
-
getNotificationTypeSettings
NotificationTypeSettingsDTO getNotificationTypeSettings(Notification notification)
Returns the notifications settings for an already generated notification.
This method never return null, if the user hasn't saved his preferences it creates a default one.
-
getTypeBasedOnSetting
AdminNotificationType getTypeBasedOnSetting(AdminNotificationType type)
Returns the notification type which the given type is based on.
This method must be used when the given type does not have a corresponding setting, but uses settings from another type.
E.g:AdminNotificationType.USER_IMPORT_REGISTRATIONis based onAdminNotificationType.USER_REGISTRATION
-
isAllowedNotificationType
boolean isAllowedNotificationType(AdminNotificationType type, User user)
It checks if the user has thePermission.MY_NOTIFICATIONS_ENABLEpermission and is allowed to be notified by the specified type. It assumes the user has selected being notified by the specified type- Parameters:
type- the notification type to be checkeduser- the user to check if he/she is allowed to be notified- Returns:
- true if the user can be notified.
-
isEnabled
boolean isEnabled(UserNotificationType type, BasicUser user, SimpleEntity entity)
It returns true if the notification type is enabled by permission and if the user had selected being notified by that type. The given entity is the one that triggered the notification, such as the performed payment, or the assigned broker.
-
isPaymentAmountInRange
boolean isPaymentAmountInRange(BasicUser user, UserAccountType accountType, BigDecimal amount)
Returns whether the given amount is included in the payment amount range the given user has set for payments from / to the given account type
-
keyForEmailUnsubscribe
String keyForEmailUnsubscribe(BasicUser user, EmailUnsubscribeType type)
Returns a key for unsubscribing from a particular e-mail.
-
resolveUserNotificationSettingsDTO
UserNotificationSettingsDTO resolveUserNotificationSettingsDTO(BasicUser user, BooleanPropertiesHolder<UserNotificationType> productNotifications, UserNotificationSettings settings)
Returns the user notification settings dto for the given settings and user, if no productNotifications is given, it resolves ones for the given user.
-
usersToForwardMessageIterator
com.mysema.commons.lang.CloseableIterator<BasicUser> usersToForwardMessageIterator(IncomingMessage message)
It returns an iterator over all users allowed to forward the corresponding incoming message.
-
-