Event warningEvent;
String warningMessage;
long now = System.currentTimeMillis();
for (Map.Entry<EventSource, Integer> entry : this.eventsDropped.entrySet()) {
EventSource eventSource = entry.getKey();
Integer droppedCount = entry.getValue();
Set<Event> eventSet = getEventsForEventSource(eventSource);
if (eventSet.size() >= this.maxEventsPerSource) {
// this event source hit its individual limit
warningMessage = "Event Report Limit Reached: reached the maximum allowed events ["
+ this.maxEventsPerSource + "] for this event source - dropped [" + droppedCount + "] events";
} else {
// this report reached its total limit, even though this event source did not hit its individual limit
warningMessage = "Event Report Limit Reached: reached total maximum allowed events ["
+ this.maxEventsPerReport + "] - dropped [" + droppedCount + "] events";
}
warningEvent = new Event(eventSource.getEventDefinition().getName(), eventSource.getLocation(), now,
EventSeverity.WARN, warningMessage, eventSource);
eventSet.add(warningEvent);
this.addedLimitWarningEvents = true;
}