public Event(@NotNull long timestamp, @NotNull EventSeverity severity, @NotNull EventSource source, @NotNull String detail) { if(source==null) throw new IllegalArgumentException("Source must not be null."); this.timestamp = timestamp; this.severity = severity; this.detail = detail; this.sourceLocation = source.getLocation(); this.source = source; }
warningEvent = new Event(eventSource.getEventDefinition().getName(), eventSource.getLocation(), now, EventSeverity.WARN, warningMessage, eventSource); eventSet.add(warningEvent);
int matched = stats.matched; processCacheElements(cacheElements, event.getSeverity(), event.getTimestamp(), stats, "sourceLocation=" + source.getLocation(), event.getDetail()); if (matched < stats.matched) { break;
ps.setString(paramIndex++, eventSource.getEventDefinition().getResourceType().getPlugin()); ps.setInt(paramIndex++, eventSource.getResource().getId()); ps.setString(paramIndex++, eventSource.getLocation()); ps.setString(paramIndex++, eventSource.getEventDefinition().getName()); ps.setString(paramIndex++, eventSource.getEventDefinition().getResourceType().getName()); ps.setString(paramIndex++, eventSource.getEventDefinition().getResourceType().getPlugin()); ps.setInt(paramIndex++, eventSource.getResource().getId()); ps.setString(paramIndex++, eventSource.getLocation()); ps.setString(paramIndex++, eventSource.getEventDefinition().getResourceType().getPlugin()); ps.setInt(paramIndex++, eventSource.getResource().getId()); ps.setString(paramIndex++, eventSource.getLocation()); ps.setLong(paramIndex++, event.getTimestamp()); ps.setString(paramIndex++, event.getSeverity().toString());
private EventSourceRest convertEventSource(EventSource source) { EventSourceRest esr = new EventSourceRest(); esr.setId(source.getId()); esr.setDescription(source.getEventDefinition().getDescription()); esr.setDisplayName(source.getEventDefinition().getDisplayName()); esr.setName(source.getEventDefinition().getName()); esr.setLocation(source.getLocation()); esr.setResourceId(source.getResourceId()); return esr; }