This interface defines the methods that must be supported by a class
that is to be plugged into curn as a generalized plug-in.
curn plug-ins are invoked at various phases of curn
execution.
Each plug-in phase is represented by its own Java interface, and
each interface has exactly one method. A plug-in that intercepts
multiple curn processing phases must implement the interfaces for
each of the phases. Here are the plug-in phases, in execution order.
Plug-in interface |
Plug-in method |
Description |
StartupPlugIn |
StartupPlugIn.runStartupPlugIn runStartupPlugIn() |
Called immediately after curn has started, but before it has
loaded its configuration file or its cache. Intercepting this phase
is useful if a plug-in needs to perform initialization. |
MainConfigItemPlugIn |
MainConfigItemPlugIn.runMainConfigItemPlugIn runMainConfigItemPlugIn() |
Called immediately after curn has read and processed a
configuration item in the main [curn] configuration
section. All configuration items are passed, one by one, to each
loaded plug-in. If a plug-in class is not interested in a
particular configuration item, its
runMainConfigItemPlugIn() method should simply return
without doing anything. Note that some configuration items may
simply be variable assignment; there's no real way to distinguish a
variable assignment from a blessed configuration item. |
FeedConfigItemPlugIn |
FeedConfigItemPlugIn.runFeedConfigItemPlugIn runFeedConfigItemPlugIn() |
Called immediately after curn has read and processed a
configuration item in a "Feed" configuration section. All
configuration items are passed, one by one, to each loaded plug-in.
If a plug-in class is not interested in a particular configuration
item, its runFeedConfigItemPlugIn() method should simply
return without doing anything. Note that some configuration items
may simply be variable assignment; there's no real way to
distinguish a variable assignment from a blessed configuration
item. |
OutputHandlerConfigItemPlugIn |
OutputHandlerConfigItemPlugIn.runOutputHandlerConfigItemPlugIn runOutputHandlerConfigItemPlugIn() |
Called immediately after curn has read and processed a
configuration item in an "OutputHandler" configuration section. All
configuration items are passed, one by one, to each loaded plug-in.
If a plug-in class is not interested in a particular configuration
item, its runOutputHandlerConfigItemPlugIn() method should
simply return without doing anything. Note that some configuration
items may simply be variable assignment; there's no real way to
distinguish a variable assignment from a blessed configuration
item. |
UnknownSectionConfigItemPlugIn |
UnknownSectionConfigItemPlugIn.runUnknownSectionConfigItemPlugIn runUnknownSectionConfigItemPlugIn() |
Called immediately after curn has read and processed a
configuration item in an unknown configuration section. All
configuration items are passed, one by one, to each loaded plug-in.
If a plug-in class is not interested in a particular configuration
item, its runUnknownSectionConfigItemPlugIn() method should
simply return without doing anything. Note that some configuration
items may simply be variable assignment; there's no real way to
distinguish a variable assignment from a blessed configuration
item. |
PostConfigPlugIn |
PostConfigPlugIn.runPostConfigPlugIn runPostConfigPlugIn() |
Called after the entire configuration has been read and parsed, but
before any feeds are processed. Intercepting this event is useful
for plug-ins that want to adjust the configuration. For instance,
the curn command-line wrapper intercepts this plug-in event
so it can adjust the configuration to account for command line
options. |
CacheLoadedPlugIn |
CacheLoadedPlugIn.runCacheLoadedPlugIn runCacheLoadedPlugIn() |
Called after the curn cache has been read (and after any
expired entries have been purged), but before any feeds are processed.
|
PreFeedDownloadPlugIn |
PreFeedDownloadPlugIn.runPreFeedDownloadPlugIn runPreFeedDownloadPlugIn() |
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:
- filtering on feed URL to prevent downloading non-matching feeds
- changing the default User-Agent value
- setting a non-standard HTTP header field
|
PostFeedDownloadPlugIn |
PostFeedDownloadPlugIn.runPostFeedDownloadPlugIn runPostFeedDownloadPlugIn() |
Called immediately after a feed is downloaded. This method can
return false to signal curn that the feed should be
skipped. For instance, a plug-in that filters on the unparsed XML
feed content could use this method to weed out non-matching feeds
before they are downloaded.
|
PostFeedParsePlugIn |
PostFeedParsePlugIn.runPostFeedParsePlugIn runPostFeedParsePlugIn() |
Called immediately after a feed is parsed, but before it is
otherwise processed. A post-feed parse plug-in has access to the
parsed RSS feed data, via an
RSSChannel object. This
method can return false to signal curn that the
feed should be skipped. For instance, a plug-in that filters on the
parsed feed data could use this method to weed out non-matching
feeds before they are downloaded. Similarly, a plug-in that edits
the parsed data (removing or editing individual items, for
instance) could use method to do so. |
PreFeedOutputPlugIn |
PreFeedOutputPlugIn.runPreFeedOutputPlugIn runPreFeedOutputPlugIn() |
Called immediately before a parsed feed is passed to an output
handler. A pre-feed output plug-in cannot affect the feed's
processing. (The time to stop the processing of a feed is in one of
the other, preceding phases.) This method will be called multiple
times for each feed if there are multiple output handlers. |
PostFeedOutputPlugIn |
PostFeedOutputPlugIn.runPostFeedOutputPlugIn runPostFeedOutputPlugIn() |
Called immediately after a parsed feed is passed to an output
handler. A post-feed output plug-in cannot affect the feed's
processing. (The time to stop the processing of a feed is in one of
the other, preceding phases.) This method will be called multiple
times for each feed if there are multiple output handlers. |
PostOutputHandlerFlushPlugIn |
PostOutputHandlerFlushPlugIn.runPostOutputHandlerFlushPlugIn runPostOutputHandlerFlushPlugIn() |
Called immediately after an output handler is flushed (i.e., after
it has been called to process all feeds and its output has been
written to a temporary file), but before that output is
displayed, emailed, etc.
|
PostOutputPlugIn |
PostOutputPlugIn.runPostOutputPlugIn runPostOutputPlugIn() |
Called after curn has flush all output handlers. A
post-output plug-in is a useful place to consolidate the output from
all output handlers. For instance, such a plug-in might pack all the
output into a zip file, or email it. |
PreCacheSavePlugIn |
PreCacheSavePlugIn.runPreCacheSavePlugIn runPreCacheSavePlugIn() |
Called right before the curn cache is to be saved. A plug-in
might choose to edit the cache at this point. |
ShutdownPlugIn |
ShutdownPlugIn.runShutdownPlugIn runShutdownPlugIn() |
Called just before curn gets ready to exit. This method
allows plug-ins to perform any clean-up they require. |