@Override public SyndFeedInfo getFeedInfo(final URL feedUrl) { return backingCache.getFeedInfo(feedUrl); }
@Override public void setFeedInfo(final URL feedUrl, SyndFeedInfo syndFeedInfo) { // Make sure that syndFeedInfo is an instance of DeltaSyndFeedInfo if (!(syndFeedInfo instanceof DeltaSyndFeedInfo)) { syndFeedInfo = new DeltaSyndFeedInfo(syndFeedInfo); } backingCache.setFeedInfo(feedUrl, syndFeedInfo); }
@Override public void clear() { backingCache.clear(); }
public void callback(final String callbackPath, final SyndFeed feed) { if (!callbackPath.startsWith(callbackPrefix)) { throw new HttpStatusCodeException(404, "Not a valid callback prefix.", new Exception(callbackPath + " doesnt start with " + callbackPrefix)); } final String id = callbackPath.substring(callbackPrefix.length()); LOG.debug("Got callback for {}", id); final Subscription s = dao.findById(id); if (s == null) { throw new HttpStatusCodeException(404, "Not a valid callback.", null); } validateLink(feed, s.getSourceUrl()); SyndFeedInfo info = null; URL url = null; try { url = new URL(s.getSourceUrl()); info = cache.getFeedInfo(url); } catch (final MalformedURLException ex) { LOG.error("Malformed URL", ex); } if (info == null) { info = new SyndFeedInfo(); info.setId(s.getId()); info.setUrl(url); } info.setLastModified(System.currentTimeMillis()); info.setSyndFeed(feed); cache.setFeedInfo(url, info); s.getCallback().onNotify(s, info); }
@Override public SyndFeedInfo remove(final URL feedUrl) { return backingCache.remove(feedUrl); }
public void callback(final String callbackPath, final SyndFeed feed) { if (!callbackPath.startsWith(callbackPrefix)) { throw new HttpStatusCodeException(404, "Not a valid callback prefix.", new Exception(callbackPath + " doesnt start with " + callbackPrefix)); } final String id = callbackPath.substring(callbackPrefix.length()); LOG.debug("Got callback for {}", id); final Subscription s = dao.findById(id); if (s == null) { throw new HttpStatusCodeException(404, "Not a valid callback.", null); } validateLink(feed, s.getSourceUrl()); SyndFeedInfo info = null; URL url = null; try { url = new URL(s.getSourceUrl()); info = cache.getFeedInfo(url); } catch (final MalformedURLException ex) { LOG.error("Malformed URL", ex); } if (info == null) { info = new SyndFeedInfo(); info.setId(s.getId()); info.setUrl(url); } info.setLastModified(System.currentTimeMillis()); info.setSyndFeed(feed); cache.setFeedInfo(url, info); s.getCallback().onNotify(s, info); }
@Override public SyndFeedInfo remove(final URL feedUrl) { return backingCache.remove(feedUrl); }
@Override public SyndFeedInfo getFeedInfo(final URL feedUrl) { return backingCache.getFeedInfo(feedUrl); }
SyndFeedInfo syndFeedInfo = cache.getFeedInfo(feedUrl); cache.setFeedInfo(feedUrl, syndFeedInfo);
@Override public void setFeedInfo(final URL feedUrl, SyndFeedInfo syndFeedInfo) { // Make sure that syndFeedInfo is an instance of DeltaSyndFeedInfo if (!(syndFeedInfo instanceof DeltaSyndFeedInfo)) { syndFeedInfo = new DeltaSyndFeedInfo(syndFeedInfo); } backingCache.setFeedInfo(feedUrl, syndFeedInfo); }
@Override public void clear() { backingCache.clear(); }
SyndFeedInfo syndFeedInfo = cache.getFeedInfo(feedUrl); setRequestHeaders(connection, syndFeedInfo, ""); httpConnection.connect();
protected void retrieveAndCacheFeed(final URL feedUrl, final SyndFeedInfo syndFeedInfo, final HttpURLConnection connection) throws IllegalArgumentException, FeedException, FetcherException, IOException { handleErrorCodes(connection.getResponseCode()); resetFeedInfo(feedUrl, syndFeedInfo, connection); final FeedFetcherCache cache = getFeedInfoCache(); // resetting feed info in the cache // could be needed for some implementations // of FeedFetcherCache (eg, distributed HashTables) if (cache != null) { cache.setFeedInfo(feedUrl, syndFeedInfo); } }
final SyndFeedInfo cachedInfo = cache.getFeedInfo(orignalUrl); if (cachedInfo != null) { final SyndFeed cachedFeed = cachedInfo.getSyndFeed();
SyndFeedInfo syndFeedInfo = cache.getFeedInfo(feedUrl); setRequestHeaders(connection, syndFeedInfo, userAgent); httpConnection.connect();
final SyndFeedInfo cachedInfo = cache.getFeedInfo(feedUrl);
SyndFeedInfo feedInfo = feedCache.getFeedInfo(new URL(newSub.getFeedURL())); if(feedInfo.getLastModified() != null) { long lastUpdatedLong = (Long) feedInfo.getLastModified();