Package io.jmix.notifications.impl
Class NotificationManagerImpl.NotificationRequestBuilderImpl
java.lang.Object
io.jmix.notifications.impl.NotificationManagerImpl.NotificationRequestBuilderImpl
- All Implemented Interfaces:
NotificationManager.InputBody,NotificationManager.InputChannels,NotificationManager.InputContentType,NotificationManager.InputOptionals,NotificationManager.InputRecipients,NotificationManager.InputSubject,NotificationManager.InputType,NotificationManager.NotificationRequestBuilder,NotificationManager.SendNotification
- Enclosing class:
- NotificationManagerImpl
public class NotificationManagerImpl.NotificationRequestBuilderImpl
extends Object
implements NotificationManager.NotificationRequestBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Set<NotificationChannel>protected ContentTypeprotected Set<org.springframework.security.core.userdetails.UserDetails>protected Stringprotected NotificationType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Set<NotificationChannel>getEffectiveChannelsSet(Stream<String> channelNamesStream) protected Set<org.springframework.security.core.userdetails.UserDetails>getEffectiveRecipientsSet(Stream<String> usernamesStream) protected org.springframework.security.core.userdetails.UserDetailsgetUserByUsernameOrNull(String username) voidsend()Creates and sends notification request.toChannels(NotificationChannel... channels) Sets notification channels.toChannels(Collection<NotificationChannel> channels) Sets notification channels.toChannelsByNames(String... channelNames) Sets notification channels by provided names.toChannelsByNames(Collection<String> channelNames) Sets notification channels by provided names.Sets notification body.withContentType(ContentType contentType) Set notification body content type.SetsContentType.HTMLcontent type for notification body.SetsContentType.PLAINcontent type for notification body.withRecipients(Collection<org.springframework.security.core.userdetails.UserDetails> recipients) Sets notification recipients.withRecipients(org.springframework.security.core.userdetails.UserDetails... recipients) Sets notification recipients.withRecipientUsernames(String... recipientUsernames) Sets notification recipients by provided usernames.withRecipientUsernames(Collection<String> recipientUsernames) Sets notification recipients by provided usernames.withSubject(String subject) Sets notification subject.withType(NotificationType type) Sets notification type.withTypeName(String typeName) Sets notification type by provided name.
-
Field Details
-
recipients
-
subject
-
body
-
contentType
-
type
-
channels
-
-
Constructor Details
-
NotificationRequestBuilderImpl
public NotificationRequestBuilderImpl()
-
-
Method Details
-
withSubject
Description copied from interface:NotificationManager.InputSubjectSets notification subject.- Specified by:
withSubjectin interfaceNotificationManager.InputSubject- Parameters:
subject- subject- Returns:
- builder
-
withRecipientUsernames
Description copied from interface:NotificationManager.InputRecipientsSets notification recipients by provided usernames.- Specified by:
withRecipientUsernamesin interfaceNotificationManager.InputRecipients- Parameters:
recipientUsernames- usernames- Returns:
- builder
-
withRecipientUsernames
public NotificationManager.NotificationRequestBuilder withRecipientUsernames(Collection<String> recipientUsernames) Description copied from interface:NotificationManager.InputRecipientsSets notification recipients by provided usernames.- Specified by:
withRecipientUsernamesin interfaceNotificationManager.InputRecipients- Parameters:
recipientUsernames- usernames- Returns:
- builder
-
withRecipients
public NotificationManager.InputChannels withRecipients(org.springframework.security.core.userdetails.UserDetails... recipients) Description copied from interface:NotificationManager.InputRecipientsSets notification recipients.- Specified by:
withRecipientsin interfaceNotificationManager.InputRecipients- Parameters:
recipients- recipients- Returns:
- builder
-
withRecipients
public NotificationManager.InputChannels withRecipients(Collection<org.springframework.security.core.userdetails.UserDetails> recipients) Description copied from interface:NotificationManager.InputRecipientsSets notification recipients.- Specified by:
withRecipientsin interfaceNotificationManager.InputRecipients- Parameters:
recipients- recipients- Returns:
- builder
-
toChannelsByNames
Description copied from interface:NotificationManager.InputChannelsSets notification channels by provided names.- Specified by:
toChannelsByNamesin interfaceNotificationManager.InputChannels- Parameters:
channelNames- channel names- Returns:
- builder
-
toChannelsByNames
public NotificationManager.NotificationRequestBuilder toChannelsByNames(Collection<String> channelNames) Description copied from interface:NotificationManager.InputChannelsSets notification channels by provided names.- Specified by:
toChannelsByNamesin interfaceNotificationManager.InputChannels- Parameters:
channelNames- channel names- Returns:
- builder
-
toChannels
Description copied from interface:NotificationManager.InputChannelsSets notification channels.- Specified by:
toChannelsin interfaceNotificationManager.InputChannels- Parameters:
channels- channels- Returns:
- builder
-
toChannels
public NotificationManager.NotificationRequestBuilder toChannels(Collection<NotificationChannel> channels) Description copied from interface:NotificationManager.InputChannelsSets notification channels.- Specified by:
toChannelsin interfaceNotificationManager.InputChannels- Parameters:
channels- channels- Returns:
- builder
-
withContentType
Description copied from interface:NotificationManager.InputContentTypeSet notification body content type.- Specified by:
withContentTypein interfaceNotificationManager.InputContentType- Parameters:
contentType- content type- Returns:
- builder
-
withPlainTextContentType
Description copied from interface:NotificationManager.InputContentTypeSetsContentType.PLAINcontent type for notification body.- Specified by:
withPlainTextContentTypein interfaceNotificationManager.InputContentType- Returns:
- builder
-
withHtmlContentType
Description copied from interface:NotificationManager.InputContentTypeSetsContentType.HTMLcontent type for notification body.- Specified by:
withHtmlContentTypein interfaceNotificationManager.InputContentType- Returns:
- builder
-
withBody
Description copied from interface:NotificationManager.InputBodySets notification body.- Specified by:
withBodyin interfaceNotificationManager.InputBody- Parameters:
body- body- Returns:
- builder
-
withTypeName
Description copied from interface:NotificationManager.InputTypeSets notification type by provided name.- Specified by:
withTypeNamein interfaceNotificationManager.InputType- Parameters:
typeName- notification type name- Returns:
- builder
-
withType
Description copied from interface:NotificationManager.InputTypeSets notification type.- Specified by:
withTypein interfaceNotificationManager.InputType- Parameters:
type- notification type- Returns:
- builder
-
send
public void send()Description copied from interface:NotificationManager.SendNotificationCreates and sends notification request.- Specified by:
sendin interfaceNotificationManager.SendNotification
-
getEffectiveRecipientsSet
-
getUserByUsernameOrNull
@Nullable protected org.springframework.security.core.userdetails.UserDetails getUserByUsernameOrNull(String username) -
getEffectiveChannelsSet
-