예제 #1
0
  @Override
  public List<Event> getEventsByYear(int year) {
    try {
      List<Event> events = eventDao.getEventsByYear(year);
      filterAndEnrich(events);

      return events;
    } catch (Exception e) {
      EventException ee = new EventException("Error getting events for year " + year, e);
      logError(ee);
      throw ee;
    }
  }
예제 #2
0
  @Override
  public List<Event> getFutureEvents(int pageSize) {
    try {
      List<Event> events = eventDao.getFutureEvents(pageSize);
      filterAndEnrich(events);

      return events;
    } catch (Exception e) {
      EventException ee = new EventException("Error getting future events", e);
      logError(ee);
      throw ee;
    }
  }
예제 #3
0
  @Override
  public List<Event> getEvents(ContentSource contentSource, int pageSize) {
    try {
      List<Event> events = eventDao.getEvents(contentSource, pageSize);
      filterAndEnrich(events);

      return events;
    } catch (Exception e) {
      EventException ee =
          new EventException("Error getting events for content source with ID " + contentSource, e);
      logError(ee);
      throw ee;
    }
  }
예제 #4
0
  @Override
  public List<Event> getEventsByMonth(int year, int month) {
    try {
      List<Event> events = eventDao.getEventsByMonth(year, month);
      filterAndEnrich(events);

      return events;
    } catch (Exception e) {
      EventException ee =
          new EventException("Error getting events for month " + year + "/" + month, e);
      logError(ee);
      throw ee;
    }
  }
예제 #5
0
  @Override
  public Event getEvent(int id) {
    try {
      List<Event> events = new LinkedList<>();
      Event event = eventDao.getEvent(id);
      events.add(event);
      filterAndEnrich(events);

      return event;
    } catch (Exception e) {
      EventException ee = new EventException("Error getting event with ID " + id, e);
      logError(ee);
      throw ee;
    }
  }
예제 #6
0
 @Override
 public long getNumberOfEvents(ContentSource contentSource, Date start, Date end) {
   try {
     return eventDao.getNumberOfEvents(contentSource, start, end);
   } catch (Exception e) {
     EventException ee =
         new EventException(
             "Error getting number of events for content source with ID "
                 + contentSource.getId()
                 + " between "
                 + start
                 + " and "
                 + end,
             e);
     logError(ee);
     throw ee;
   }
 }