01: /*---------------------------------------------------------------------------*\
02: $Id: PostFeedParsePlugIn.java 7041 2007-09-09 01:04:47Z bmc $
03: ---------------------------------------------------------------------------
04: This software is released under a BSD-style license:
05:
06: Copyright (c) 2004-2007 Brian M. Clapper. All rights reserved.
07:
08: Redistribution and use in source and binary forms, with or without
09: modification, are permitted provided that the following conditions are
10: met:
11:
12: 1. Redistributions of source code must retain the above copyright notice,
13: this list of conditions and the following disclaimer.
14:
15: 2. The end-user documentation included with the redistribution, if any,
16: must include the following acknowlegement:
17:
18: "This product includes software developed by Brian M. Clapper
19: (bmc@clapper.org, http://www.clapper.org/bmc/). That software is
20: copyright (c) 2004-2007 Brian M. Clapper."
21:
22: Alternately, this acknowlegement may appear in the software itself,
23: if wherever such third-party acknowlegements normally appear.
24:
25: 3. Neither the names "clapper.org", "curn", nor any of the names of the
26: project contributors may be used to endorse or promote products
27: derived from this software without prior written permission. For
28: written permission, please contact bmc@clapper.org.
29:
30: 4. Products derived from this software may not be called "curn", nor may
31: "clapper.org" appear in their names without prior written permission
32: of Brian M. Clapper.
33:
34: THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
35: WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
36: MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
37: NO EVENT SHALL BRIAN M. CLAPPER BE LIABLE FOR ANY DIRECT, INDIRECT,
38: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
39: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
40: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
41: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
42: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
43: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44: \*---------------------------------------------------------------------------*/
45:
46: package org.clapper.curn;
47:
48: import org.clapper.curn.parser.RSSChannel;
49:
50: /**
51: * This interface defines the methods that must be supported by plug-ins
52: * that wish to be notified just after <i>curn</i> downloads a feed.
53: *
54: * @see PlugIn
55: * @see MetaPlugIn
56: * @see PreFeedDownloadPlugIn
57: * @see PostFeedDownloadPlugIn
58: * @see Curn
59: *
60: * @version <tt>$Revision: 7041 $</tt>
61: */
62: public interface PostFeedParsePlugIn extends PlugIn {
63: /*----------------------------------------------------------------------*\
64: Public Methods
65: \*----------------------------------------------------------------------*/
66:
67: /**
68: * Called immediately after a feed is parsed, but before it is
69: * otherwise processed. A post-feed parse plug-in has access to the
70: * <i>parsed</i> RSS feed data, via an {@link RSSChannel} object. This
71: * method can return <tt>false</tt> to signal <i>curn</i> that the feed
72: * should be skipped. For instance, a plug-in that filters on the
73: * parsed feed data could use this method to weed out non-matching
74: * feeds before they are downloaded. Similarly, a plug-in that edits
75: * the parsed data (removing or editing individual items, for instance)
76: * could use method to do so.
77: *
78: * @param feedInfo the {@link FeedInfo} object for the feed that
79: * has been downloaded and parsed.
80: * @param feedCache the loaded feed cache, or null if there's no cache
81: * @param channel the parsed channel data
82: *
83: * @return <tt>true</tt> if <i>curn</i> should continue to process the
84: * feed, <tt>false</tt> to skip the feed. A return value of
85: * <tt>false</tt> aborts all further processing on the feed.
86: * In particular, <i>curn</i> will not pass the feed along to
87: * other plug-ins that have yet to be notified of this event.
88: *
89: * @throws CurnException on error
90: *
91: * @see RSSChannel
92: * @see FeedInfo
93: */
94: public boolean runPostFeedParsePlugIn(FeedInfo feedInfo,
95: FeedCache feedCache, RSSChannel channel)
96: throws CurnException;
97: }
|