Ejemplo n.º 1
0
 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);
     }
   }
 }
Ejemplo n.º 2
0
  @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;
  }
Ejemplo n.º 3
0
  @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;
  }