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
Modifier and TypeFieldDescriptionprotected String
protected Set<NotificationChannel>
protected ContentType
protected Set<org.springframework.security.core.userdetails.UserDetails>
protected String
protected NotificationType
-
Constructor Summary
-
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.UserDetails
getUserByUsernameOrNull
(String username) void
send()
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.HTML
content type for notification body.SetsContentType.PLAIN
content 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.InputSubject
Sets notification subject.- Specified by:
withSubject
in interfaceNotificationManager.InputSubject
- Parameters:
subject
- subject- Returns:
- builder
-
withRecipientUsernames
Description copied from interface:NotificationManager.InputRecipients
Sets notification recipients by provided usernames.- Specified by:
withRecipientUsernames
in interfaceNotificationManager.InputRecipients
- Parameters:
recipientUsernames
- usernames- Returns:
- builder
-
withRecipientUsernames
public NotificationManager.NotificationRequestBuilder withRecipientUsernames(Collection<String> recipientUsernames) Description copied from interface:NotificationManager.InputRecipients
Sets notification recipients by provided usernames.- Specified by:
withRecipientUsernames
in interfaceNotificationManager.InputRecipients
- Parameters:
recipientUsernames
- usernames- Returns:
- builder
-
withRecipients
public NotificationManager.InputChannels withRecipients(org.springframework.security.core.userdetails.UserDetails... recipients) Description copied from interface:NotificationManager.InputRecipients
Sets notification recipients.- Specified by:
withRecipients
in 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.InputRecipients
Sets notification recipients.- Specified by:
withRecipients
in interfaceNotificationManager.InputRecipients
- Parameters:
recipients
- recipients- Returns:
- builder
-
toChannelsByNames
Description copied from interface:NotificationManager.InputChannels
Sets notification channels by provided names.- Specified by:
toChannelsByNames
in interfaceNotificationManager.InputChannels
- Parameters:
channelNames
- channel names- Returns:
- builder
-
toChannelsByNames
public NotificationManager.NotificationRequestBuilder toChannelsByNames(Collection<String> channelNames) Description copied from interface:NotificationManager.InputChannels
Sets notification channels by provided names.- Specified by:
toChannelsByNames
in interfaceNotificationManager.InputChannels
- Parameters:
channelNames
- channel names- Returns:
- builder
-
toChannels
Description copied from interface:NotificationManager.InputChannels
Sets notification channels.- Specified by:
toChannels
in interfaceNotificationManager.InputChannels
- Parameters:
channels
- channels- Returns:
- builder
-
toChannels
public NotificationManager.NotificationRequestBuilder toChannels(Collection<NotificationChannel> channels) Description copied from interface:NotificationManager.InputChannels
Sets notification channels.- Specified by:
toChannels
in interfaceNotificationManager.InputChannels
- Parameters:
channels
- channels- Returns:
- builder
-
withContentType
Description copied from interface:NotificationManager.InputContentType
Set notification body content type.- Specified by:
withContentType
in interfaceNotificationManager.InputContentType
- Parameters:
contentType
- content type- Returns:
- builder
-
withPlainTextContentType
Description copied from interface:NotificationManager.InputContentType
SetsContentType.PLAIN
content type for notification body.- Specified by:
withPlainTextContentType
in interfaceNotificationManager.InputContentType
- Returns:
- builder
-
withHtmlContentType
Description copied from interface:NotificationManager.InputContentType
SetsContentType.HTML
content type for notification body.- Specified by:
withHtmlContentType
in interfaceNotificationManager.InputContentType
- Returns:
- builder
-
withBody
Description copied from interface:NotificationManager.InputBody
Sets notification body.- Specified by:
withBody
in interfaceNotificationManager.InputBody
- Parameters:
body
- body- Returns:
- builder
-
withTypeName
Description copied from interface:NotificationManager.InputType
Sets notification type by provided name.- Specified by:
withTypeName
in interfaceNotificationManager.InputType
- Parameters:
typeName
- notification type name- Returns:
- builder
-
withType
Description copied from interface:NotificationManager.InputType
Sets notification type.- Specified by:
withType
in interfaceNotificationManager.InputType
- Parameters:
type
- notification type- Returns:
- builder
-
send
public void send()Description copied from interface:NotificationManager.SendNotification
Creates and sends notification request.- Specified by:
send
in interfaceNotificationManager.SendNotification
-
getEffectiveRecipientsSet
-
getUserByUsernameOrNull
@Nullable protected org.springframework.security.core.userdetails.UserDetails getUserByUsernameOrNull(String username) -
getEffectiveChannelsSet
-