KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > nava > informa > core > ChannelBuilderIF


1 //
2
// Informa -- RSS Library for Java
3
// Copyright (c) 2002 by Niko Schmuck
4
//
5
// Niko Schmuck
6
// http://sourceforge.net/projects/informa
7
// mailto:niko_schmuck@users.sourceforge.net
8
//
9
// This library is free software.
10
//
11
// You may redistribute it and/or modify it under the terms of the GNU
12
// Lesser General Public License as published by the Free Software Foundation.
13
//
14
// Version 2.1 of the license should be included with this distribution in
15
// the file LICENSE. If the license is not included with this distribution,
16
// you may find a copy at the FSF web site at 'www.gnu.org' or 'www.fsf.org',
17
// or you may write to the Free Software Foundation, 675 Mass Ave, Cambridge,
18
// MA 02139 USA.
19
//
20
// This library is distributed in the hope that it will be useful,
21
// but WITHOUT ANY WARRANTY; without even the implied waranty of
22
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
// Lesser General Public License for more details.
24
//
25

26
27 // $Id: ChannelBuilderIF.java,v 1.13 2004/01/30 20:36:05 niko_schmuck Exp $
28

29 package de.nava.informa.core;
30
31 import java.net.URL JavaDoc;
32 import java.util.Date JavaDoc;
33 import java.util.Properties JavaDoc;
34
35 import org.jdom.Element;
36
37 /**
38  * This interface allows the channel generators (like a parser) to
39  * create the channel object model independent from which
40  * implementation is used (in-memory or persistent store).
41  *
42  * @author Niko Schmuck (niko@nava.de)
43  */

44 public interface ChannelBuilderIF {
45
46   /**
47    * Sets the runtime properties defined for this channel builder.
48    * This method will be invoked by the ChannelBuilderFactory when the
49    * ChannelBuilder is first created.
50    *
51    * @param props The parsed set of properties which may be applied to
52    * this object.
53    * @throws ChannelBuilderException If the initialisation fails for
54    * some reason.
55    */

56   void init(Properties JavaDoc props) throws ChannelBuilderException;
57
58   ChannelGroupIF createChannelGroup(String JavaDoc title);
59
60   ChannelIF createChannel(String JavaDoc title);
61
62   ChannelIF createChannel(Element channelElement, String JavaDoc title);
63
64   /**
65    * Creates a news item and assign it to the given channel.
66    */

67   ItemIF createItem(ChannelIF channel, String JavaDoc title, String JavaDoc description, URL JavaDoc link);
68   ItemIF createItem(Element itemElement, ChannelIF channel, String JavaDoc title, String JavaDoc description, URL JavaDoc link);
69   ItemIF createItem(ChannelIF channel, ItemIF item);
70
71   ImageIF createImage(String JavaDoc title, URL JavaDoc location, URL JavaDoc link);
72
73   TextInputIF createTextInput(String JavaDoc title, String JavaDoc description, String JavaDoc name, URL JavaDoc link);
74
75   ItemSourceIF createItemSource(ItemIF item, String JavaDoc name, String JavaDoc location, Date JavaDoc timestamp);
76   ItemEnclosureIF createItemEnclosure(ItemIF item, URL JavaDoc location, String JavaDoc type, int length);
77   ItemGuidIF createItemGuid(ItemIF item, String JavaDoc location, boolean permaLink);
78   CloudIF createCloud(String JavaDoc domain, int port, String JavaDoc path, String JavaDoc registerProcedure, String JavaDoc protocol);
79
80   CategoryIF createCategory(CategoryIF parent, String JavaDoc title);
81
82   /**
83    * Closes the builder. After this call, all references to any channel objects
84    * provided by this ChannelBuilder are invalidated.
85
86    * If the ChannelBuilder has a connection to a persistant store such as a
87    * database, connections may be closed.
88    */

89   void close() throws ChannelBuilderException;
90
91   public void beginTransaction() throws ChannelBuilderException;
92   public void endTransaction() throws ChannelBuilderException;
93   public void update(Object JavaDoc o) throws ChannelBuilderException;
94
95 }
96
Popular Tags