Converts list of notification entity objects to list of notificationDto objects.

@param   notifications  list of notification objects. Cannot be null.

@return  list of notificationDto objects

@throws  WebApplicationException  If an error occurs.
515945
public static List<NotificationDto> transformToDto(List<Notification> notifications) {
        if (notifications == null) {
            throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
        }

        List<NotificationDto> result = new ArrayList<NotificationDto>();

        for (Notification notification : notifications) {
            result.add(transformToDto(notification));
        }
        return result;
    }
1190176
public static List<DashboardDto> transformToDto(List<Dashboard> dashboards) {
        if (dashboards == null) {
            throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
        }

        List<DashboardDto> result = new ArrayList<DashboardDto>();

        for (Dashboard dashboard : dashboards) {
            result.add(transformToDto(dashboard));
        }
        return result;
    }
336582
public static List<PushedNotification> findSuccessfulNotifications(List<PushedNotification> notifications) {
		List<PushedNotification> filteredList = new Vector<PushedNotification>();
		for (PushedNotification notification : notifications) {
			if (notification.isSuccessful()) filteredList.add(notification);
		}
		return filteredList;
	}
618936
public void sendNotification(final Notification notification) {

    ContextAwareTimer.Context timer = this.notificationTimer.time();
    if(!this.notificationTargets.isEmpty()) {
        for (final Map.Entry<UUID, Function<Notification, Void>> entry : this.notificationTargets.entrySet()) {
          try {
            entry.getValue().apply(notification);
          } catch (RuntimeException exception) {
            LOG.warn("RuntimeException when running notification target. Skipping.", exception);
          }
        }
    }

    if(getParent().isPresent()) {
      getParent().get().sendNotification(notification);
    }
    timer.stop();
  }
327330
def process_notifications(self, messages):
        """"""
        for object_id, object_size, metadata_size in messages:
            if object_size > 0 and object_id in self._waiting_dict:
                linked_list = self._waiting_dict[object_id]
                self._complete_future(linked_list)
1164890
@Override
    public <T> void send(NotificationType type, List<T> messages) throws NotificationException {
        String[] strMessages = new String[messages.size()];
        for (int index = 0; index < messages.size(); index++) {
            strMessages[index] = getMessageJson(messages.get(index));
        }
        sendInternal(type, strMessages);
    }
21310
@SuppressLint("SetTextI18n")
	public void setNotifications(Integer notifications) {

		if ((notifications != null) && (notifications > 0)) {
			setVisibility(VISIBLE);
			if (notifications > maximum) {
				this.setText(maximum + "+");
			} else {
				this.setText(notifications.toString());
			}
		} else {
			setVisibility(GONE);
		}
	}
1083734
public List<ValueNotification> getByElementID(String elementID) {
        if(elementID == null)
            return null;
        List<ValueNotification> found = new ArrayList<ValueNotification>();
        for (Notification n: NotificationManager.notifications){
            try{
                if (((ValueNotification)n).getElementID().equals(elementID)) {
                    logger.fine("...found a match for getByElementID query. With elementID: "+elementID);
                    found.add((ValueNotification) n);
                }
            } catch (ClassCastException e) {
                // Nothing to do. Its normal when comparts value an interaction notifications.  
            }
        }
        if(found.size()>0)        
            return found;
        return null;
    }
1018210
public CreateIssueParams notifiedUserIds(List notifiedUserIds) {
        for (Object notifiedUserId : notifiedUserIds) {
            parameters.add(new NameValuePair("notifiedUserId[]", notifiedUserId.toString()));
        }
        return this;

    }
1208346
public java.util.List<NotificationConfiguration> getNotificationConfigurations() {
        if (notificationConfigurations == null) {
            notificationConfigurations = new com.amazonaws.internal.SdkInternalList<NotificationConfiguration>();
        }
        return notificationConfigurations;
    }
391818
public void addNotfication(Notification notification) {
        Object source = notification.getSource();
        NotificationRecord nr;
        if (source instanceof ObjectName) {
            nr = new NotificationRecord(notification, (ObjectName) source);
        } else {
            nr = new NotificationRecord(notification, (source != null) ? source.toString() : null);
        }
        addNotficationRecord(nr);
    }
1222062
public void showNotification(Context context, Bundle extras) {
        // parse the title and message from the extras
        String title = getTitle(context, extras);
        String message = getMessage(context, extras);

        // if the message is empty, bail
        if (message == null)
            return;

        // create the notification
        NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
        long when = System.currentTimeMillis();

        NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
                .setAutoCancel(true)
                .setSmallIcon(getIcon(context))
                .setContentTitle(title)
                .setContentText(message)
                .setContentIntent(getContentIntent(context, extras, when))
                .setStyle(new NotificationCompat.BigTextStyle().bigText(message));

        // display the notification
        mNotificationManager.notify((int) when, mBuilder.build());
    }
453344
public static EntityGetOperation<NotificationEndPointInfo> get(
            String notificationEndPointId) {
        return new DefaultGetOperation<NotificationEndPointInfo>(ENTITY_SET,
                notificationEndPointId, NotificationEndPointInfo.class);
    }
961664
public void setConnectionNotificationIds(java.util.Collection<String> connectionNotificationIds) {
        if (connectionNotificationIds == null) {
            this.connectionNotificationIds = null;
            return;
        }

        this.connectionNotificationIds = new com.amazonaws.internal.SdkInternalList<String>(connectionNotificationIds);
    }
598825
public void setApplicationVersions(java.util.Collection<ApplicationVersionDescription> applicationVersions) {
        if (applicationVersions == null) {
            this.applicationVersions = null;
            return;
        }

        this.applicationVersions = new com.amazonaws.internal.SdkInternalList<ApplicationVersionDescription>(applicationVersions);
    }
1083119
private function prepare(array $notifications): array
    {
        $requests = [];
        /** @var Notification $notification */
        foreach ($notifications as $notification) {
            $subscription = $notification->getSubscription();
            $endpoint = $subscription->getEndpoint();
            $userPublicKey = $subscription->getPublicKey();
            $userAuthToken = $subscription->getAuthToken();
            $contentEncoding = $subscription->getContentEncoding();
            $payload = $notification->getPayload();
            $options = $notification->getOptions($this->getDefaultOptions());
            $auth = $notification->getAuth($this->auth);

            if (!empty($payload) && !empty($userPublicKey) && !empty($userAuthToken)) {
                if (!$contentEncoding) {
                    throw new \ErrorException('Subscription should have a content encoding');
                }

                $encrypted = Encryption::encrypt($payload, $userPublicKey, $userAuthToken, $contentEncoding);
                $cipherText = $encrypted['cipherText'];
                $salt = $encrypted['salt'];
                $localPublicKey = $encrypted['localPublicKey'];

                $headers = [
                    'Content-Type' => 'application/octet-stream',
                    'Content-Encoding' => $contentEncoding,
                ];

                if ($contentEncoding === "aesgcm") {
                    $headers['Encryption'] = 'salt='.Base64Url::encode($salt);
                    $headers['Crypto-Key'] = 'dh='.Base64Url::encode($localPublicKey);
                }

                $encryptionContentCodingHeader = Encryption::getContentCodingHeader($salt, $localPublicKey, $contentEncoding);
                $content = $encryptionContentCodingHeader.$cipherText;

                $headers['Content-Length'] = Utils::safeStrlen($content);
            } else {
                $headers = [
                    'Content-Length' => 0,
                ];

                $content = '';
            }

            $headers['TTL'] = $options['TTL'];

            if (isset($options['urgency'])) {
                $headers['Urgency'] = $options['urgency'];
            }

            if (isset($options['topic'])) {
                $headers['Topic'] = $options['topic'];
            }

            // if GCM
            if (substr($endpoint, 0, strlen(self::GCM_URL)) === self::GCM_URL) {
                if (array_key_exists('GCM', $auth)) {
                    $headers['Authorization'] = 'key='.$auth['GCM'];
                } else {
                    throw new \ErrorException('No GCM API Key specified.');
                }
            }
            // if VAPID (GCM doesn't support it but FCM does)
            elseif (array_key_exists('VAPID', $auth) && $contentEncoding) {
                $audience = parse_url($endpoint, PHP_URL_SCHEME).'://'.parse_url($endpoint, PHP_URL_HOST);
                if (!parse_url($audience)) {
                    throw new \ErrorException('Audience "'.$audience.'"" could not be generated.');
                }

                $vapidHeaders = $this->getVAPIDHeaders($audience, $contentEncoding, $auth['VAPID']);

                $headers['Authorization'] = $vapidHeaders['Authorization'];

                if ($contentEncoding === 'aesgcm') {
                    if (array_key_exists('Crypto-Key', $headers)) {
                        $headers['Crypto-Key'] .= ';'.$vapidHeaders['Crypto-Key'];
                    } else {
                        $headers['Crypto-Key'] = $vapidHeaders['Crypto-Key'];
                    }
                }
            }

            $requests[] = new Request('POST', $endpoint, $headers, $content);
        }

        return $requests;
    }
419491
public static AlertDto transformToDto(Alert alert) {
        if (alert == null) {
            throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
        }

        AlertDto result = createDtoObject(AlertDto.class, alert);

        result.setOwnerName(alert.getOwner().getUserName());
        for (Trigger trigger : alert.getTriggers()) {
            result.addTriggersIds(trigger);
        }
        for (Notification notification : alert.getNotifications()) {
            result.addNotificationsIds(notification);
        }
        return result;
    }