private void deleteDeprecatedEvents(Project project, SensorContext context) { String version = project.getAnalysisVersion(); for (Iterator<Event> it = context.getEvents(project).iterator(); it.hasNext(); ) { Event event = it.next(); if (event.isVersionCategory() && version.equals(event.getName())) { it.remove(); context.deleteEvent(event); } } }
@Override public Event addEvent( Resource resource, String name, String description, String category, Date date) { Event event = new Event(name, description, category); event.setDate(date); event.setCreatedAt(new Date()); persistence.saveEvent(resource, event); return null; }
@Override public Event addEvent( Resource resource, String name, String description, String category, @Nullable Date date) { Event event = new Event(name, description, category); if (date != null) { event.setDate(date); } if (eventPersister != null) { eventPersister.saveEvent(resource, event); } return null; }