public Document compile(List<LakeviewContentGroup> contents) { Element feed = createElement("Feed", LAKEVIEW); feed.addAttribute(new Attribute("ProviderName", PROVIDER_NAME)); // This is specified. Don't use lastUpdated.... String lastModified = DATETIME_FORMAT.print(clock.now()); Set<String> seenItems = Sets.newHashSet(); for (LakeviewContentGroup contentGroup : contents) { List<Element> groupElements = elementsForGroup(lastModified, contentGroup, seenItems); for (Element element : groupElements) { feed.appendChild(element); } } return new Document(feed); }
public void schedule(final Runnable rawRunnable, final RepetitionRule rule) { ScheduledTask task = ScheduledTask.from(rawRunnable); rule.schedule(clock.now(), timer, new ReschedulingTask(task, rule)); task.setExecutor(executor); tasks.add(task); }