Clear notifications from container
423108
protected function getNotificationsFromContainer()
    {
        if (!empty($this->notifications) || $this->isAdded) {
            return;
        }

        $container = $this->getContainer();
        $namespaces = [];

        foreach ($container as $namespace => $notification) {
            $this->notifications[$namespace] = $notification;
            $namespaces[] = $namespace;
        }

        $this->clearNotificationsFromContainer($namespaces);
    }
268081
def _notifyDone(self):
        '''
        
        '''
        if self.notified:
            return

        self.doneevent.set()

        for buid in self.mybldgbuids:
            del self.allbldgbuids[buid]

        self.notified = True
1220498
def clear( self ):
        
        self.blockSignals(True)
        self.setUpdatesEnabled(False)
        for child in self.findChildren(XRolloutItem):
            child.setParent(None)
            child.deleteLater()
        self.setUpdatesEnabled(True)
        self.blockSignals(False)
974572
def removeNotificationListener(listener, filter=nil, handback=nil)
      found = false
      listeners.delete_if do |clistener, (cfilter, chandback)|
        v = listener == clistener && filter == cfilter && handback == chandback
        found = true if v
        v
      end
      raise javax.management.ListenerNotFoundException.new unless found
    end
1270637
public function callback_dismiss_notification() {
        if ( isset( $_POST['namespace'] ) || isset( $_POST['id'] ) ) {
            $namespace = $_POST['namespace'];
            $id = $_POST['id'];

			$n_class = get_class();
            $notify = new $n_class( $namespace );
            $notify->hide_notification( $id );
        }
        exit;
    }
285011
def DeletePendingNotification(self, timestamp):
    
    shown_notifications = self.Get(self.Schema.SHOWN_NOTIFICATIONS)
    if not shown_notifications:
      shown_notifications = self.Schema.SHOWN_NOTIFICATIONS()

    pending = self.Get(self.Schema.PENDING_NOTIFICATIONS)
    if not pending:
      return

    # Remove all notifications with the given timestamp from pending
    # and add them to the shown notifications.
    delete_count = 0
    for idx in reversed(range(0, len(pending))):
      if pending[idx].timestamp == timestamp:
        shown_notifications.Append(pending[idx])
        pending.Pop(idx)
        delete_count += 1

    if delete_count > 1:
      raise UniqueKeyError("Multiple notifications at %s" % timestamp)

    self.Set(self.Schema.PENDING_NOTIFICATIONS, pending)
    self.Set(self.Schema.SHOWN_NOTIFICATIONS, shown_notifications)
374889
function _clearMessagePopover() {
            if (self._$messagePopover && self._$messagePopover.length > 0) {
                // self._$messagePopover.remove() is done by PopUpManager
                self._$messagePopover = null;
            }
            _removeListeners();
        }
969428
def Flush(self):
    """"""
    DB.DeleteSubjects(self.delete_subject_requests, sync=False)

    for req in self.delete_attributes_requests:
      subject, attributes, start, end = req
      DB.DeleteAttributes(subject, attributes, start=start, end=end, sync=False)

    for req in self.set_requests:
      subject, values, timestamp, replace, to_delete = req
      DB.MultiSet(
          subject,
          values,
          timestamp=timestamp,
          replace=replace,
          to_delete=to_delete,
          sync=False)

    if (self.delete_subject_requests or self.delete_attributes_requests or
        self.set_requests):
      DB.Flush()

    for queue, notifications in self.new_notifications:
      DB.CreateNotifications(queue, notifications)
    self.new_notifications = []

    self.delete_subject_requests = []
    self.set_requests = []
    self.delete_attributes_requests = []
1042283
def stop_notifying(cls, user_or_email, instance):
        """"""
        super(InstanceEvent, cls).stop_notifying(user_or_email,
                                                 object_id=instance.pk)
1246835
private void cleanUpHistory() {
    long oldestAllowedTimestamp = System.currentTimeMillis() - historyLength;
    int trashedNotifications = 0;
    
    if (LOG.isDebugEnabled()) {
      LOG.debug("History cleanup: Checking old notifications to remove from history list ...");
    }
    
    HistoryTreeEntry key = new HistoryTreeEntry(oldestAllowedTimestamp, 0, (byte)0);
    int notificationsCount = 0;
    historyLock.writeLock().lock();
    try {
      notificationsCount = orderedHistoryList.size();
      LOG.warn("History cleanup: size of the history before cleanup: " + notificationsCount);

      if (!historyLimitDisabled && notificationsCount > historyLimit) {
        LOG.warn("History cleanup: Reached physical limit. Number of stored notifications: " + 
            notificationsCount + ". Clearing ...");
      }
      
      int index = Collections.binarySearch(orderedHistoryList, key, comparatorByTS);
      int toDeleteByTS = index >= 0 ? index : - (index + 1);
      int toDeleteByLimit = historyLimitDisabled ? 0 : notificationsCount - (int)historyLimit;
      toDeleteByLimit = toDeleteByLimit > 0 ? toDeleteByLimit : 0;
      
      int toDelete = Math.max(toDeleteByTS, toDeleteByLimit);
      
      // Delete items which are too old
      if (toDelete > 0) {
        LOG.warn("History cleanup: number of the history to cleanup: " + toDelete);
        for (int i = 0; i < toDelete; i++) {
          orderedHistoryList.get(i).removeFromTree();
        }
        
        orderedHistoryList.subList(0, toDelete).clear();
        
        if (toDeleteByLimit > toDeleteByTS) {
          // If we delete a notification because we don't have space left
          trashedNotifications ++;
        }
        notificationsCount = orderedHistoryList.size();
        LOG.warn("History cleanup: size of the history after cleanup: " + notificationsCount);
        
        // clean up history tree, remove the node that has no children and
        // no notifications associated with them.
        cleanUpHistoryTree(historyTree);
      }
      
    } finally {
      historyLock.writeLock().unlock();
    }
    
    core.getMetrics().trashedHistoryNotifications.inc(trashedNotifications);
    core.getMetrics().historySize.set(notificationsCount);
    core.getMetrics().historyQueues.set(historyQueuesCount);
  }
345378
public function clear($namespace = null)
    {
        $this->getNotificationsFromContainer();

        if ($namespace) {
            if (isset($this->notifications[$namespace])) {
                unset($this->notifications[$namespace]);
                return true;
            }

            return false;
        }

        foreach ($this->notifications as $nm => $type) {
            unset($this->notifications[$nm]);
        }

        return true;
    }
809253
def clean(self, *args, **kwargs):
        
        if self.from_user and self.from_user_id == self.to_user_id:
            raise ValidationError(_('A user cannot send a notification to herself/himself'))
1154665
def stop_notifications(self):
        
        with self._notifications_lock:
            if not self.has_active_notification_thread:
                return
            thread = self._notifications_thread
            self._notifications_thread = None
            stopping = thread.stop()
            api = self._get_api(mds.NotificationsApi)
            api.delete_long_poll_channel()
            return stopping.wait()
1331248
def remove_in_progress_notification(self, notification):
        
        if notification.uuid in self.notifications_in_progress:
            notification.status = ACT_STATUS_ZOMBIE
            del self.notifications_in_progress[notification.uuid]
148419
def delete_unregistered_notifications(self, apps=None):
        
        Notification = (apps or django_apps).get_model("edc_notification.notification")
        return Notification.objects.exclude(
            name__in=[n.name for n in site_notifications.registry.values()]
        ).delete()
197446
public function canNotifySubscribers()
    {
        $maintenancePeriods = Schedule::inProgress()->count();
        if ($maintenancePeriods === 0) {
            return true;
        }

        return !$this->config->get('setting.suppress_notifications_in_maintenance');
    }
703512
public final void clear() {
        items.clear();
        iconCount = 0;
        dividerCount = 0;

        if (rawItems != null) {
            rawItems.clear();
        }

        notifyOnDataSetChanged();
    }