Delete a notification.

@param notification The notification to delete.
@return True if the operation was successful.
491338
public boolean deleteNotification(Notification notification) {
        boolean result = notification.canDelete();

        if (result) {
            broker.callRPC("RGCWXQ ALRPP", notification.getAlertId());
        }

        return result;
    }
600024
public function notify(NotificationInterface $notification, $level = self::INFO)
    {
        if (!$this->handlers)
        {
            $this->addHandler(new NullHandler());
        }

        foreach ($this->getHandlers() as $handler)
        {
            if ($handler->shouldHandle($notification, $level))
            {
                if (false === $handler->handle($notification, $level))
                {
                    return false;
                }
            }
        }

        return true;
    }
409298
@Override
    protected void enqueueNotification(final Notification not) {
        final Runnable r = new Runnable() {
            @Override
            public void run() {
                not.lastRun = System.currentTimeMillis();

                final SubscriptionSummary summary = postNotification(not.subscriber, not.mimeType, not.payload);

                if (!summary.isLastPublishSuccessful()) {
                    not.retryCount++;

                    if (not.retryCount <= 5) {
                        retry(not);
                    }
                }

                not.callback.onSummaryInfo(summary);
            }
        };

        exeuctor.execute(r);
    }
324101
public function deleteNotificationRequest()
    {
        $operation = array(
            'API' => 'DeleteBucketNotification',
            'Method' => 'DELETE',
            'Uri' => '/<bucket-name>?notification',
            'Headers' => array(
                'Host' => $this->properties['zone'] . '.' . $this->config->host,
            ),
            'Params' => array(
            ),
            'Elements' => array(
            ),
            'Properties' => $this->properties,
            'Body' => null
        );
        $this->deleteNotificationValidate($operation);
        $req = new Request($this->config, $operation);
        return $req;
    }
927535
public function delete()
    {
        try {
            if (is_null($id = Input::get('id'))) {
                throw new Exception('Invalid notification id provided');
            }
            $this->stack->deleteById($id);
        } catch (Exception $ex) {
            Log::alert($ex);
            return new JsonResponse(['message' => trans('antares/notifications::messages.sidebar.unable_to_delete_notification_item')], 500);
        }
    }
519510
public static void addNotification(Notification n) {
        NotificationManager.notifications.add(n);
        logger.fine("New notification added to notifications list. There is currently: " +
                    notifications.size()+" notifications\n Notification added: "
                    +NotificationManager.notifications.get(NotificationManager.notifications.size()-1));
    }
547567
private void checkUndefinedNotification(Notification notification) {
        String type = notification.getType();
        PathAddress source = notification.getSource();
        Map<String, NotificationEntry> descriptions = getRootResourceRegistration().getNotificationDescriptions(source, true);
        if (!descriptions.keySet().contains(type)) {
            missingNotificationDescriptionWarnings.add(ControllerLogger.ROOT_LOGGER.notificationIsNotDescribed(type, source));
        }
    }
733522
@Override
    public void notificationCreated(RuntimeUpdateManager updateManager, RuntimeUpdateNotification notification) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(this, tc, "GPCL: RuntimeUpdate notification " + notification.getName() + ", apps in service = " + appsInService);

        if (this.appsInService > 0 && notification.getName().equals(RuntimeUpdateNotification.CONFIG_UPDATES_DELIVERED)) {
            setFutureGeneratePluginTask();
            notification.onCompletion(new ConfigUpdateListener());
        }
    }
940064
def remove_notification_listener(self, notification_id):
    

    for v in self.notifications.values():
      toRemove = list(filter(lambda tup: tup[0] == notification_id, v))
      if len(toRemove) > 0:
        v.remove(toRemove[0])
        return True

    return False
5284
public function isAPINotification()
    {
        return (bool)(isset($this->notificationObj->unique_id) && !empty($this->notificationObj->unique_id));
    }
282194
@Override
	public void onReceiveNotification(ApptentiveNotification notification) {
		checkConversationQueue();

		if (notification.hasName(NOTIFICATION_ACTIVITY_STARTED) ||
			notification.hasName(NOTIFICATION_ACTIVITY_RESUMED)) {
			final Activity activity = notification.getRequiredUserInfo(NOTIFICATION_KEY_ACTIVITY, Activity.class);
			setCurrentForegroundActivity(activity);
		} else if (notification.hasName(NOTIFICATION_APP_ENTERED_FOREGROUND)) {
			appWentToForeground();
		} else if (notification.hasName(NOTIFICATION_APP_ENTERED_BACKGROUND)) {
			setCurrentForegroundActivity(null);
			appWentToBackground();
		} else if (notification.hasName(NOTIFICATION_PAYLOAD_WILL_START_SEND)) {
			final PayloadData payload = notification.getRequiredUserInfo(NOTIFICATION_KEY_PAYLOAD, PayloadData.class);
			if (payload.getType().equals(PayloadType.message)) {
				resumeSending();
			}
		} else if (notification.hasName(NOTIFICATION_PAYLOAD_DID_FINISH_SEND)) {
			final boolean successful = notification.getRequiredUserInfo(NOTIFICATION_KEY_SUCCESSFUL, Boolean.class);
			final PayloadData payload = notification.getRequiredUserInfo(NOTIFICATION_KEY_PAYLOAD, PayloadData.class);
			final Integer responseCode = notification.getRequiredUserInfo(NOTIFICATION_KEY_RESPONSE_CODE, Integer.class);
			final JSONObject responseData = successful ? notification.getRequiredUserInfo(NOTIFICATION_KEY_RESPONSE_DATA, JSONObject.class) : null;
			if (responseCode == -1) {
				pauseSending(SEND_PAUSE_REASON_NETWORK);
			}

			if (payload.getType().equals(PayloadType.message)) {
				onSentMessage(payload.getNonce(), responseCode, responseData);
			}
		}
	}
351277
public function sendNotification(Notification $notification)
    {
        try {
            $connection = $this->getConnection($notification->getType());
            $connection->setNotification($notification);

            $this->logger->info(
                sprintf(
                    "Dispatching notification id: %s",
                    $notification->getIdentifier()
                )
            );

            $this
                ->responseHandler
                ->addIdentifiedResponse(
                    $notification->getIdentifier(),
                    $connection->sendRequest()
                );

            return true;

        } catch (ClientException $e) {
            $this->logger->error(
                sprintf("Client connection error: %s", $e->getMessage())
            );

        } catch (RuntimeException $e) {
            $this->logger->error(
                sprintf("Runtime error: %s", $e->getMessage())
            );

        } catch (\Exception $e) {
            $this->logger->error(
                sprintf("Error occurs: %s", $e->getMessage())
            );
        }

        return false;
    }
1321873
public static NotificationDto transformToDto(Notification notification) {
        if (notification == null) {
            throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
        }

        NotificationDto result = createDtoObject(NotificationDto.class, notification);

        result.setAlertId(notification.getAlert().getId());
        for (Trigger trigger : notification.getTriggers()) {
            result.addTriggersIds(trigger);
        }
        return result;
    }
618288
public function removeNotification($notification)
    {
        $ids = clone $this->notificationIds;
        $ids->offsetUnset($notification->id);
        $this->set('notificationIds', $ids);

        $ids = clone $this->newNotificationIds;
        $ids->offsetUnset($notification->id);
        $this->set('newNotificationIds', $ids);

        $notification->removeSubscribers(array($this->_mixer));
    }
568439
private static function get_notification_details( $notification ) {
		$notifications = array_filter(
			self::$notifications,
			function ( $value ) use ( $notification ) {
				if ( isset( $value['id'] ) && isset( $notification['id'] ) && $value['id'] === $notification['id'] ) {
					return true;
				}

				return false;
			}
		);

		return ! empty( $notifications ) ? reset( $notifications ) : [];
	}
1284161
private void sendClosingSignal() {
        URL clientURL = null;
        HttpsURLConnection connection = null;
        try {
            // Get the appropriate URL to delete notification client
            if (serverConnection.serverVersion >= 4) {
                //V4+ clients use /{clientID} to delete the notification client
                clientURL = getNotificationClientURL();
            } else {
                //Pre-V4 clients use /{clientID}/inbox to delete the notification client
                clientURL = getInboxURL();
            }

            if (logger.isLoggable(Level.FINEST)) {
                logger.logp(Level.FINEST,
                            logger.getName(),
                            "sendClosingSignal",
                            "Making a call to delete inbox [" + clientURL + "] from ["
                                            + RESTClientMessagesUtil.getObjID(this) + "]");
            }
            // Get connection to server
            connection = serverConnection.getConnection(clientURL, HttpMethod.DELETE, true);
            connection.setReadTimeout(serverConnection.getConnector().getReadTimeout());

            // Check response code from server
            int responseCode = 0;
            try {
                responseCode = connection.getResponseCode();
            } catch (ConnectException ce) {
                logger.logp(Level.FINE, logger.getName(), "sendClosingSignal", ce.getMessage(), ce);
            }

            if (logger.isLoggable(Level.FINEST)) {
                logger.logp(Level.FINEST, logger.getName(), "sendClosingSignal", "Response code: " + responseCode);
            }

        } catch (IOException io) {
            logger.logp(Level.FINE, logger.getName(), "sendClosingSignal", io.getMessage(), io);
        }
    }
318234
public synchronized void handleNotification(Notification notification, Object handback) {
        String type = notification.getType();
        if (REGISTRATION_NOTIFICATION.equals(type)) {
            jolokiaMBeanServer = lookupJolokiaMBeanServer();
            // We need to add the listener provided during construction time to add the Jolokia MBeanServer
            // so that it is kept updated, too.
            if (jolokiaMBeanServerListener != null) {
                JmxUtil.addMBeanRegistrationListener(jolokiaMBeanServer, jolokiaMBeanServerListener, null);
            }
        } else if (UNREGISTRATION_NOTIFICATION.equals(type)) {
            jolokiaMBeanServer = null;
        }

        allMBeanServers.clear();
        if (jolokiaMBeanServer != null) {
            allMBeanServers.add(jolokiaMBeanServer);
        }
        allMBeanServers.addAll(detectedMBeanServers);
    }