public class RomeAdapter extends AbstractNewsAdapter
Note: This class can process and feed supported by ROME https://rome.dev.java.net/.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ANTISAMY_POLICY |
protected org.slf4j.Logger |
log |
static String |
PREFERENCE_DESCRIPTION_POLICY |
static String |
PREFERENCE_TITLE_POLICY |
| Constructor and Description |
|---|
RomeAdapter() |
| Modifier and Type | Method and Description |
|---|---|
long |
getConnectionManagerTimeout() |
int |
getConnectionTimeout() |
org.apache.http.impl.client.AbstractHttpClient |
getHttpClient() |
protected String[] |
getPolicyPref(String... policyKey) |
int |
getReadTimeout() |
PaginatingNewsFeed |
getSyndFeed(NewsConfiguration config,
int page,
int maxStories) |
protected PaginatingNewsFeed |
getSyndFeed(String url,
String titlePolicy,
String descriptionPolicy,
int maxStories)
Retrieve the entire feed using HTTPClient and clean using AntiSamy,
build an SyndFeed object using ROME.
|
int |
getTimesToRetry() |
void |
init() |
void |
setCache(net.sf.ehcache.Cache cache) |
void |
setCacheKeyPrefix(String prefix)
Cache prefix to support multiple instances of this class using the same cache.
|
void |
setConnectionManagerTimeout(long connectionManagerTimeout) |
void |
setConnectionTimeout(int connectionTimeout) |
void |
setHttpClient(org.apache.http.impl.client.AbstractHttpClient httpClient) |
void |
setProcessor(RomeNewsProcessorImpl processor) |
void |
setProxyHost(String proxyHost) |
void |
setProxyPort(String proxyPort) |
void |
setReadTimeout(int readTimeout) |
void |
setTimesToRetry(int timesToRetry) |
getClassName, getDescriptionKey, getNameKeyprotected final org.slf4j.Logger log
public static final String PREFERENCE_TITLE_POLICY
public static final String PREFERENCE_DESCRIPTION_POLICY
public static final String DEFAULT_ANTISAMY_POLICY
public org.apache.http.impl.client.AbstractHttpClient getHttpClient()
public void setHttpClient(org.apache.http.impl.client.AbstractHttpClient httpClient)
public void setProxyHost(String proxyHost)
public void setProxyPort(String proxyPort)
public int getConnectionTimeout()
public void setConnectionTimeout(int connectionTimeout)
public int getReadTimeout()
public void setReadTimeout(int readTimeout)
public long getConnectionManagerTimeout()
public void setConnectionManagerTimeout(long connectionManagerTimeout)
public int getTimesToRetry()
public void setTimesToRetry(int timesToRetry)
public void setProcessor(RomeNewsProcessorImpl processor)
public void setCacheKeyPrefix(String prefix)
prefix - Unique prefix for cache entries for this particular instancepublic PaginatingNewsFeed getSyndFeed(NewsConfiguration config, int page, int maxStories) throws NewsException
NewsExceptionprotected PaginatingNewsFeed getSyndFeed(String url, String titlePolicy, String descriptionPolicy, int maxStories) throws NewsException
url - String of the feed to be retrievedtitlePolicy - String the cleaning policy for the titledescriptionPolicy - String the cleaning policy for the descriptionmaxStories - limit number of news itemsNewsExceptionpublic void setCache(net.sf.ehcache.Cache cache)
Copyright © 2009-2016 Apereo. All Rights Reserved.