class CleanupServiceImpl implements CleanupService<TimeBasedCleanupPolicy> {

  public CleanupResult cleanup(TimeBasedCleanupPolicy cleanupPolicy) {
    long affectedRows = 0;
    int errorCount = 0;
    for (Cleanable cleanable : cleanables) {
      LOGGER.info("Running the purge process for DAO: [{}] with cleanup policy: [{}]", cleanable, cleanupPolicy);
      try {
        affectedRows += cleanable.cleanup(cleanupPolicy);
      }
      catch (Exception ex) {
        LOGGER.error("Running the purge process for DAO: [{}] failed with: {}", cleanable, ex);
        errorCount++;
      }
    }

    return new Result(affectedRows, errorCount);
  }

  @Inject protected  CleanupServiceImpl(Set<Cleanable> cleanables);

}