/**
  * Fetch the log entries as an atom feed. May trigger a purge of old messages, according to this
  * log service's purge policy. Includes paging options.
  *
  * @param maxResults maximum number of log results
  * @param startIndex starting index of log results
  * @return a {@code Feed} containing all the entries in the log
  */
 public synchronized Feed getFeed(Integer maxResults, Integer startIndex) {
   Feed feed = new Feed();
   feed.setTitle(
       "Plugin management log for "
           + applicationProperties.getDisplayName()
           + " ("
           + applicationProperties.getBaseUrl()
           + ")");
   feed.setModified(lastModified);
   addLink(feed, applicationProperties.getBaseUrl(), "base");
   addAuditLogEntries(feed, maxResults, startIndex);
   return feed;
 }
  protected WireFeed parseFeed(Element eFeed) {

    com.sun.syndication.feed.atom.Feed feed = new com.sun.syndication.feed.atom.Feed(getType());

    Element e = eFeed.getChild("title", getAtomNamespace());
    if (e != null) {
      feed.setTitleEx(parseContent(e));
    }

    List<Element> eList = eFeed.getChildren("link", getAtomNamespace());
    feed.setAlternateLinks(parseAlternateLinks(eList));
    feed.setOtherLinks(parseOtherLinks(eList));

    e = eFeed.getChild("author", getAtomNamespace());
    if (e != null) {
      List<Person> authors = new ArrayList<Person>();
      authors.add(parsePerson(e));
      feed.setAuthors(authors);
    }

    eList = eFeed.getChildren("contributor", getAtomNamespace());
    if (eList.size() > 0) {
      feed.setContributors(parsePersons(eList));
    }

    e = eFeed.getChild("tagline", getAtomNamespace());
    if (e != null) {
      feed.setTagline(parseContent(e));
    }

    e = eFeed.getChild("id", getAtomNamespace());
    if (e != null) {
      feed.setId(e.getText());
    }

    e = eFeed.getChild("generator", getAtomNamespace());
    if (e != null) {
      Generator gen = new Generator();
      gen.setValue(e.getText());
      String att = getAttributeValue(e, "url");
      if (att != null) {
        gen.setUrl(att);
      }
      att = getAttributeValue(e, "version");
      if (att != null) {
        gen.setVersion(att);
      }
      feed.setGenerator(gen);
    }

    e = eFeed.getChild("copyright", getAtomNamespace());
    if (e != null) {
      feed.setCopyright(e.getText());
    }

    e = eFeed.getChild("info", getAtomNamespace());
    if (e != null) {
      feed.setInfo(parseContent(e));
    }

    e = eFeed.getChild("modified", getAtomNamespace());
    if (e != null) {
      feed.setModified(DateParser.parseDate(e.getText()));
    }

    feed.setModules(parseFeedModules(eFeed));

    eList = eFeed.getChildren("entry", getAtomNamespace());
    if (eList.size() > 0) {
      feed.setEntries(parseEntries(eList));
    }

    List<Element> foreignMarkup = extractForeignMarkup(eFeed, feed, getAtomNamespace());
    if (foreignMarkup.size() > 0) {
      feed.setForeignMarkup(foreignMarkup);
    }
    return feed;
  }