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 java.lang.String |
DEFAULT_ANTISAMY_POLICY |
protected org.slf4j.Logger |
log |
static java.lang.String |
PREFERENCE_DESCRIPTION_POLICY |
static java.lang.String |
PREFERENCE_TITLE_POLICY |
| Constructor and Description |
|---|
RomeAdapter() |
| Modifier and Type | Method and Description |
|---|---|
long |
getConnectionManagerTimeout() |
int |
getConnectionTimeout() |
org.apache.http.impl.client.CloseableHttpClient |
getHttpClient() |
protected java.lang.String[] |
getPolicyPref(java.lang.String... policyKey) |
int |
getReadTimeout() |
PaginatingNewsFeed |
getSyndFeed(NewsConfiguration config,
int page,
int maxStories) |
protected PaginatingNewsFeed |
getSyndFeed(java.lang.String url,
java.lang.String titlePolicy,
java.lang.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(java.lang.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.CloseableHttpClient httpClient) |
void |
setProcessor(RomeNewsProcessorImpl processor) |
void |
setProxyHost(java.lang.String proxyHost) |
void |
setProxyPort(java.lang.String proxyPort) |
void |
setReadTimeout(int readTimeout) |
void |
setTimesToRetry(int timesToRetry) |
getClassName, getDescriptionKey, getNameKeyprotected final org.slf4j.Logger log
public static final java.lang.String PREFERENCE_TITLE_POLICY
public static final java.lang.String PREFERENCE_DESCRIPTION_POLICY
public static final java.lang.String DEFAULT_ANTISAMY_POLICY
public org.apache.http.impl.client.CloseableHttpClient getHttpClient()
public void setHttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient)
public void setProxyHost(java.lang.String proxyHost)
public void setProxyPort(java.lang.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(java.lang.String prefix)
prefix - Unique prefix for cache entries for this particular instancepublic void init()
throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String[] getPolicyPref(java.lang.String... policyKey)
public PaginatingNewsFeed getSyndFeed(NewsConfiguration config, int page, int maxStories) throws NewsException
NewsExceptionprotected PaginatingNewsFeed getSyndFeed(java.lang.String url, java.lang.String titlePolicy, java.lang.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-2023 Apereo. All Rights Reserved.