The user can use this method to add notifications manually.

@param n
the notification to add.
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));
    }
317110
public synchronized void postNotification(final String name, final Map<String, Object> userInfo) {
		ApptentiveLog.v(NOTIFICATIONS, "Post notification: name=%s userInfo={%s}", name, StringUtils.toString(userInfo));

		final ApptentiveNotificationObserverList list = findObserverList(name);
		if (list != null) {
			list.notifyObservers(new ApptentiveNotification(name, userInfo));
		}
	}
1051784
public void addServerNotificationListener(RESTRequest request, ServerNotificationRegistration serverNotificationRegistration, JSONConverter converter) {
        NotificationTargetInformation nti = toNotificationTargetInformation(request, serverNotificationRegistration.objectName.getCanonicalName());

        //Fetch the filter/handback objects
        NotificationFilter filter = (NotificationFilter) getObject(serverNotificationRegistration.filterID, serverNotificationRegistration.filter, converter);
        Object handback = getObject(serverNotificationRegistration.handbackID, serverNotificationRegistration.handback, converter);

        // Check whether the producer of the notification is local or remote.
        if (nti.getRoutingInformation() == null) {
            //Add to the MBeanServer
            MBeanServerHelper.addServerNotification(serverNotificationRegistration.objectName,
                                                    serverNotificationRegistration.listener,
                                                    filter,
                                                    handback,
                                                    converter);
        } else {
            // Add the notification listener to the Target-Client Manager through EventAdmin
            MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
            helper.addRoutedServerNotificationListener(nti,
                                                       serverNotificationRegistration.listener,
                                                       filter,
                                                       handback,
                                                       converter);
        }

        //Make the local ServerNotification
        ServerNotification serverNotification = new ServerNotification();
        serverNotification.listener = serverNotificationRegistration.listener;
        serverNotification.filter = serverNotificationRegistration.filterID;
        serverNotification.handback = serverNotificationRegistration.handbackID;

        //See if there's a list already
        List<ServerNotification> list = serverNotifications.get(nti);

        if (list == null) {
            list = Collections.synchronizedList(new ArrayList<ServerNotification>());
            List<ServerNotification> mapList = serverNotifications.putIfAbsent(nti, list);

            if (mapList != null) {
                list = mapList;
            }
        }

        //Add the new notification into the list
        list.add(serverNotification);
    }
1070929
public GSection setNotifications(int notifications) {
        String textNotification;

        textNotification = String.valueOf(notifications);

        if(notifications < 1) {
            textNotification = "";
        }
        if(notifications > 99) {
            textNotification = "99+";
        }

        this.notifications.setText(textNotification);
        numberNotifications = notifications;

        return this;
    }
760406
public void addOnInstalled(AddOn addOn) {
        for (ExtensionHook hook : extensionHooks.values()) {
            for (AddOnInstallationStatusListener listener : hook.getAddOnInstallationStatusListeners()) {
                try {
                    listener.addOnInstalled(addOn);
                } catch (Exception e) {
                    logger.error("An error occurred while notifying: " + listener.getClass().getCanonicalName(), e);
                }
            }
        }
    }
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);
    }
1070522
@Override
    public void sendNotification(NotificationContext notificationContext) {
        SystemAssert.requireArgument(notificationContext != null, "Notification context cannot be null.");

        Map<String, String> additionalFields = new HashMap<>();

        additionalFields.put("Notification status", "Notification created.");
        _createAnnotation(notificationContext, additionalFields);
        sendAdditionalNotification(notificationContext);
        _dispose();
    }
381162
public void addListeners()
    {
        super.addListeners();
        
        this.getField(Person.NAME).removeListener(this.getField(Person.NAME).getListener(CopyLastHandler.class), true);    // Only if dest is null (ie., company name is null)
        this.getField(Person.NAME).addListener(new CopyFieldHandler(this.getField(Person.NAME_SORT)));
        this.getField(Company.NAME_SORT).addListener(new CheckForTheHandler(null));
        
        CopyLastHandler listener = new CopyLastHandler(this.getField(Company.NAME_SORT));
        this.getField(Company.CONTACT).addListener(listener);    // Only if dest is null (ie., company name is null)
        listener.setOnlyIfDestNull(true);
    }
935054
public function addNotifications(array $notifications)
    {
        foreach ($notifications as $notification) {
            if (in_array($notification, $this->notifications, true)) {
                continue;
            }

            $this->addNotification($notification);
        }
    }
626728
final void add(Message message)
        throws NullPointerException {

        if (message == null) {
            throw new NullPointerException("Message can't be null");
        }

        this.messages.get(message.getLevel()).add(message);
    }
846781
protected void appendNode(Node n)
    {
        if (mRootNode != null) {
            mRootNode.appendChild(n);
        } else {
            mElement.appendChild(n);
        }
    }
475763
function postPublicNotification(Notification $n)
	{
		return $this->manialinkPublisher->postPublicNotification($n->message, $n->link, $n->iconStyle, $n->iconSubStyle);
	}
713517
protected void ensureNotifications() {

        I_CmsNotificationWidget oldWidget = CmsNotification.get().getWidget();
        if (oldWidget == null) {
            CmsNotificationWidget newWidget = new CmsNotificationWidget();
            CmsNotification.get().setWidget(newWidget);
            RootPanel.get().add(newWidget);
        }
    }
291952
public void setName(String n) {
    if (n.length() > 65535) {
      throw new IllegalArgumentException("Tap name too long");
    }
    totalbody += n.length() - name.length();
    keylength = (short) n.length();
    name = n;
  }
968017
public void addClientNotificationListener(RESTRequest request, NotificationRegistration notificationRegistration, JSONConverter converter) {
        String objectNameStr = notificationRegistration.objectName.getCanonicalName();

        NotificationTargetInformation nti = toNotificationTargetInformation(request, objectNameStr);

        // Get the listener
        ClientNotificationListener listener = listeners.get(nti);
        if (listener == null) {
            listener = new ClientNotificationListener(this);
            ClientNotificationListener mapListener = listeners.putIfAbsent(nti, listener);

            if (mapListener != null) {
                listener = mapListener;
            }
        }

        // Grab the wrapper filter which will be registered in the MBeanServer
        NotificationFilter filter = listener.getClientWrapperFilter();

        // Check whether the producer of the notification is local or remote.
        if (nti.getRoutingInformation() == null) {
            // Add the notification in the MBeanServer        
            MBeanServerHelper.addClientNotification(notificationRegistration.objectName,
                                                    listener,
                                                    filter,
                                                    null,
                                                    converter);
        } else {
            // Add the notification listener to the Target-Client Manager through EventAdmin
            MBeanRoutedNotificationHelper helper = MBeanRoutedNotificationHelper.getMBeanRoutedNotificationHelper();
            helper.addRoutedNotificationListener(nti, listener, converter);
        }

        // Add the filters to the listener
        listener.addClientNotification(notificationRegistration.filters);
    }
838463
public void addNode(int n)
  {

    if (!m_mutable)
      throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESETDTM_NOT_MUTABLE, null)); //"This NodeSetDTM is not mutable!");

    this.addElement(n);
  }
206456
public void addMention(Mention mention)
    {
        if (!mention.getSentence().equals(this))
            throw new IllegalArgumentException();
        mentions.add(mention);
    }