Returns a list of recipients associated with a scheduled notification.

@param notification A scheduled notification.
@param result Recipients associated with the notification.
162434
public void getScheduledNotificationRecipients(ScheduledNotification notification, Collection<Recipient> result) {
        List<String> lst = broker.callRPCList("RGCWXQ SCHRECIP", null, notification.getIen());
        result.clear();

        for (String data : lst) {
            result.add(new Recipient(data));
        }
    }
1305182
public void setNotifications(java.util.Collection<Notification> notifications) {
        if (notifications == null) {
            this.notifications = null;
            return;
        }

        this.notifications = new java.util.ArrayList<Notification>(notifications);
    }
325807
public void publish(final Notification notification) {
        LOGGER.debug("Dispatching notification: " + notification.getClass().toString());
        final ArrayList<Subscription> subscriptions = SUBSCRIPTION_MAP.get(notification.getClass());
        if (subscriptions == null) {
            LOGGER.debug("No subscribers to inform from notification: " + notification.getClass().getName());
            return;
        }
        for (final Subscription subscription: subscriptions) {
            if (subscription.getScope() != null && subscription.getGroup() != null && subscription.getLevel() != null) { // subscription was the most specific
                if (subscription.getScope().equals(notification.getScope()) && subscription.getGroup().equals(notification.getGroup()) && subscription.getLevel() == notification.getLevel()) {
                    alertSubscriber(notification, subscription.getSubscriber());
                }
            } else if (subscription.getGroup() != null && subscription.getLevel() != null) { // subscription was very specific
                if (subscription.getGroup().equals(notification.getGroup()) && subscription.getLevel() == notification.getLevel()) {
                    alertSubscriber(notification, subscription.getSubscriber());
                }
            } else if (subscription.getGroup() != null) { // subscription was somewhat specific
                if (subscription.getGroup().equals(notification.getGroup())) {
                    alertSubscriber(notification, subscription.getSubscriber());
                }
            } else if (subscription.getLevel() != null) { // subscription was somewhat specific
                if (subscription.getLevel() == notification.getLevel()) {
                    alertSubscriber(notification, subscription.getSubscriber());
                }
            } else { // subscription was not specific
                alertSubscriber(notification, subscription.getSubscriber());
            }
        }
    }
1191892
public NotificationRecord[] fetchNotifications() {
        if (notifications.isEmpty()) {
            //Need to have a timedOut flag because of possible spurious wakeup
            final long timedOut = System.nanoTime() + deliveryInterval;

            synchronized (waitFlag) {
                while (notifications.isEmpty() && (System.nanoTime() < timedOut)) {
                    try {
                        waitFlag.wait(deliveryInterval / 1000000L);
                    } catch (InterruptedException e) {
                        //keep waiting until conditions aren't met anymore
                    }
                }
            }
        }

        NotificationRecord[] fetchedNotifications = null;

        if (!notifications.isEmpty()) {
            synchronized (notifications) {
                fetchedNotifications = notifications.toArray(new NotificationRecord[notifications.size()]);
                notifications.clear();
            }
        }

        //Update the timestamp
        lastAccessTimeStamp = System.nanoTime();

        return fetchedNotifications;
    }
1310200
public static Recipient[] toRecipient(EmailAddress[] to) {
		Recipient[] addresses = new Recipient[to.length];
		int i = 0;
		for (EmailAddress t : to) {
			addresses[i++] = new Recipient(t);
		}
		return addresses;
	}
1073223
public PushedNotifications getSuccessfulNotifications() {
		PushedNotifications filteredList = new PushedNotifications(this);
		for (PushedNotification notification : this) {
			if (notification.isSuccessful()) filteredList.add(notification);
		}
		return filteredList;
	}
1311294
@Override
	public void cacheResult(
		List<CommerceNotificationAttachment> commerceNotificationAttachments) {
		for (CommerceNotificationAttachment commerceNotificationAttachment : commerceNotificationAttachments) {
			if (entityCache.getResult(
						CommerceNotificationAttachmentModelImpl.ENTITY_CACHE_ENABLED,
						CommerceNotificationAttachmentImpl.class,
						commerceNotificationAttachment.getPrimaryKey()) == null) {
				cacheResult(commerceNotificationAttachment);
			}
			else {
				commerceNotificationAttachment.resetOriginalValues();
			}
		}
	}
485193
def get_notifications(self, **params):
        """"""
        response = self._get('v2', 'notifications', params=params)
        return self._make_api_object(response, Notification)
61325
public static void deliverMail (String[] recipients, String sender,
                                    String subject, String body,
                                    String[] headers, String[] values)
        throws IOException
    {
        if (recipients == null || recipients.length < 1) {
            throw new IOException("Must specify one or more recipients.");
        }

        try {
            MimeMessage message = createEmptyMessage();
            int hcount = (headers == null) ? 0 : headers.length;
            for (int ii = 0; ii < hcount; ii++) {
                message.addHeader(headers[ii], values[ii]);
            }
            message.setText(body);
            deliverMail(recipients, sender, subject, message);

        } catch (Exception e) {
            String errmsg = "Failure sending mail [from=" + sender +
                ", to=" + StringUtil.toString(recipients) +
                ", subject=" + subject + "]";
            IOException ioe = new IOException(errmsg);
            ioe.initCause(e);
            throw ioe;
        }
    }
67384
public void distribute(CmsObject cms, List<I_CmsNewsletterRecipient> recipients, I_CmsNewsletter newsletter) {

        Iterator<I_CmsNewsletterRecipient> recipientsIterator = recipients.iterator();
        while (recipientsIterator.hasNext()) {
            I_CmsNewsletterRecipient recipient = recipientsIterator.next();
            try {
                Email mail = newsletter.getEmail(cms, recipient);
                mail.addTo(recipient.getEmail(), recipient.getFullName());
                mail.send();
            } catch (Exception e) {
                LOG.error(e.getMessage(), e);
            }
        }
    }
90416
@Override
    public void onMessageDelivered(MessageDeliveredEvent event) {
        for (IMessagingListener listener : messagingListeners) {
            try {
                listener.onMessageDelivered(event);
            } catch (Exception e) {
                logError(e, "message delivered "+event.getMessageId());
            }
        }
    }
196496
public boolean hasSubscriptions(final Notification notification) {
        final ArrayList<Subscription> subscriptions = SUBSCRIPTION_MAP.get(notification.getClass());
        return subscriptions != null;
    }
580885
def recipients(self):
        
        return [email for email in (self.to + self.cc + self.bcc) if email]
32351
private void deliverFoundAnnouncement(final DeviceAnnouncement announcement) {
        for (final DeviceAnnouncementListener listener : getDeviceAnnouncementListeners()) {
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    try {
                        listener.deviceFound(announcement);
                    } catch (Throwable t) {
                        logger.warn("Problem delivering device found announcement to listener", t);
                    }
                }
            });
        }
    }
428798
public void processIntermediateMatches(List targets, Object result)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "processIntermediateMatches",
        "targets: " + targets + ";results: " + result);

    //((List) result).addAll(targets);
    if (result != null)
       ((TopicAclTraversalResults) result).consolidate(targets);    
       
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "processIntermediateMatches");

  }
1048043
def send(self, message):
        
        body = {
            'notificationType': self._notification_type,
            'priority': self._priority,
            'isOrganization': self._is_organization,
            'message': message,
        }

        if self._recipients:
            body['recipients'] = self._recipients

        self._tcex.log.debug('notification body: {}'.format(json.dumps(body)))

        # create our tcex resource
        resource = resource = self._tcex.resource('Notification')
        resource.http_method = 'POST'
        resource.body = json.dumps(body)

        results = resource.request()  # do the request
        if results.get('response').status_code == 200:
            # everything worked
            response = results.get('response').json()
        elif results.get('response').status_code == 400:
            # failed..but known... user doesn't exist
            # just return and let calling app handle it
            err = 'Failed to send notification ({})'.format(results.get('response').text)
            self._tcex.log.error(err)
            response = results.get('response').json()
        else:
            # somekind of unknown error...raise
            err = 'Failed to send notification ({})'.format(results.get('response').text)
            self._tcex.log.error(err)
            raise RuntimeError(err)
        return response
619920
private function processResultMessages(Message $message, array $recipients, $resultMessages): ResultCollection
    {
        if (is_scalar($resultMessages)) {
            $key = $this->responseParser->parse($resultMessages);

            if ($key === 'signature_not_allowed') {
                throw new SenderNameNotAllowedException(sprintf(
                    'The signature (sender) "%s" not allowed.',
                    $message->getSender()
                ));
            } elseif ($key === 'signature_invalid') {
                throw new InvalidSenderNameException(sprintf(
                    'Invalid signature (sender): %s',
                    $message->getSender()
                ));
            }

            throw new SendSmsException(sprintf(
                'Cannot resolve the error for sending SMS. Error: %s',
                $resultMessages
            ));
        }

        $sendResult = $resultMessages[0];
        $sendResultKey = $this->responseParser->parse($sendResult);

        if ($sendResultKey === 'missing_required_parameters') {
            throw new MissingRequiredParameterException('Missing required parameters.');
        }

        if ($sendResultKey !== 'success' && $sendResultKey !== 'fail') {
            throw new SendSmsException(sprintf(
                'Fail send sms. Result messages: %s',
                json_encode($resultMessages)
            ));
        }

        array_shift($resultMessages);

        $resultData = [];

        foreach ($recipients as $recipient) {
            $messageId = array_shift($resultMessages);
            $success = preg_match('/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/', $messageId);

            if ($success) {
                $resultData[] = Result::successfully($recipient, $messageId);
            } else {
                $reason = $this->tryResolveErrorReason($messageId);
                $resultData[] = Result::failed($recipient, new Error($reason, $messageId));
            }
        }

        return new ResultCollection(...$resultData);
    }