|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.curn.plugins.UserAgentPlugIn
public class UserAgentPlugIn
The UserAgentPlugIn handles setting the global and per-feed HTTP user agent settings, overriding the default curn user agent setting. It intercepts the following configuration parameters:
| Section | Parameter | Meaning |
|---|---|---|
| [curn] | UserAgent | The default user agent, if none is supplied in individual feed sections. |
| [Feedxxx] | UserAgent | User agent to use for a given feed. |
| Constructor Summary | |
|---|---|
UserAgentPlugIn()
Default constructor (required). |
|
| Method Summary | |
|---|---|
java.lang.String |
getPlugInName()
Get a displayable name for the plug-in. |
java.lang.String |
getPlugInSortKey()
Get the sort key for this plug-in. |
void |
initPlugIn()
Initialize the plug-in. |
boolean |
runFeedConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config,
FeedInfo feedInfo)
Called immediately after curn has read and processed a configuration item in a "feed" configuration section. |
void |
runMainConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config)
Called immediately after curn has read and processed a configuration item in the main [curn] configuration section. |
void |
runPostConfigPlugIn(CurnConfig config)
Called after the entire configuration has been read and parsed, but before any feeds are processed. |
boolean |
runPreFeedDownloadPlugIn(FeedInfo feedInfo,
java.net.URLConnection urlConn)
Called just before a feed is downloaded. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UserAgentPlugIn()
| Method Detail |
|---|
public java.lang.String getPlugInName()
getPlugInName in interface PlugInpublic java.lang.String getPlugInSortKey()
getPlugInSortKey in interface PlugIn
public void initPlugIn()
throws CurnException
initPlugIn in interface PlugInCurnException - on error
public void runMainConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config)
throws CurnException
runMainConfigItemPlugIn in interface MainConfigItemPlugInsectionName - the name of the configuration section where
the item was foundparamName - the name of the parameterconfig - the CurnConfig object
CurnException - on errorCurnConfig
public boolean runFeedConfigItemPlugIn(java.lang.String sectionName,
java.lang.String paramName,
CurnConfig config,
FeedInfo feedInfo)
throws CurnException
runFeedConfigItemPlugIn in interface FeedConfigItemPlugInsectionName - the name of the configuration section where
the item was foundparamName - the name of the parameterconfig - the active configurationfeedInfo - partially complete FeedInfo object
for the feed. The URL is guaranteed to be
present, but no other fields are.
CurnException - on errorCurnConfig,
FeedInfo,
FeedInfo.getURL()
public void runPostConfigPlugIn(CurnConfig config)
throws CurnException
runPostConfigPlugIn in interface PostConfigPlugInconfig - the parsed CurnConfig object
CurnException - on errorCurnConfig
public boolean runPreFeedDownloadPlugIn(FeedInfo feedInfo,
java.net.URLConnection urlConn)
throws CurnException
Called just before a feed is downloaded. This method can return false to signal curn that the feed should be skipped. The plug-in method can also set values on the URLConnection used to download the plug-in, via URL.setRequestProperty(). (Note that all URLs, even file: URLs, are passed into this method. Setting a request property on the URLConnection object for a file: URL will have no effect--though it isn't specifically harmful.)
Possible uses for a pre-feed download plug-in include:
runPreFeedDownloadPlugIn in interface PreFeedDownloadPlugInfeedInfo - the FeedInfo object for the feed to be
downloadedurlConn - the java.net.URLConnection object that will
be used to download the feed's XML.
CurnException - on errorFeedInfo
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||