Ejemplo n.º 1
0
  @Override
  protected final void checkUpdates() {

    try {
      final List<LogEntry> changes = _parser.readFromURL(getPath().getPath()); // is immutable

      final Collection<LogEntry> toNotify = new LinkedHashSet<LogEntry>();

      for (final LogEntry change : changes) {
        if (!_seenChanges.contains(change.getChangeID())) {
          toNotify.add(change);
        }
      }

      notifyAllListeners(toNotify);

      _seenChanges.clear();
      _seenChanges.addAll(extractChangesetInfo(changes));
    } catch (final SAXException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (final IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
Ejemplo n.º 2
0
  protected static final Set<String> extractChangesetInfo(final Collection<LogEntry> logs) {
    final Set<String> changesets = new LinkedHashSet<String>();

    for (final LogEntry e : logs) {
      changesets.add(e.getChangeID());
    }

    return Collections.unmodifiableSet(changesets);
  }