KickJava   Java API By Example, From Geeks To Geeks.

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


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: ChannelIF.java,v 1.31 2004/03/09 20:17:27 niko_schmuck Exp $
28

29 package de.nava.informa.core;
30
31 import java.util.Collection JavaDoc;
32 import java.util.Date JavaDoc;
33
34 /**
35  * This interface is implemented by objects representing channels in the
36  * news channel object model.</p>
37  *
38  * @author Niko Schmuck (niko@nava.de)
39  */

40 public interface ChannelIF extends WithIdMIF, WithTitleMIF, WithElementsAndAttributesMIF,
41                                    WithLocationMIF, WithCreatorMIF, WithCategoriesMIF,
42                                    WithDescriptionMIF, WithSiteMIF, ChannelObservableIF {
43
44   // ----- Valid update period values
45

46   /** Update of channel expected to be specified in number of hours */
47   public static final String JavaDoc UPDATE_HOURLY = "hourly";
48
49   /** Update of channel expected to be specified in number of days */
50   public static final String JavaDoc UPDATE_DAILY = "daily";
51
52   /** Update of channel expected to be specified in number of weeks */
53   public static final String JavaDoc UPDATE_WEEKLY = "weekly";
54
55   /** Update of channel expected to be specified in number of months */
56   public static final String JavaDoc UPDATE_MONTHLY = "monthly";
57
58   /** Update of channel expected to be specified in number of years */
59   public static final String JavaDoc UPDATE_YEARLY = "yearly";
60
61   // ----- accessors and mutators
62

63   /* Dublin Core Metadata, like Creator and Subject */
64
65   String JavaDoc getLanguage();
66
67   void setLanguage(String JavaDoc language);
68
69   String JavaDoc getPublisher();
70
71   void setPublisher(String JavaDoc publisher);
72
73   String JavaDoc getRating();
74
75   void setRating(String JavaDoc rating);
76
77   String JavaDoc getGenerator();
78
79   void setGenerator(String JavaDoc generator);
80
81   String JavaDoc getDocs();
82
83   void setDocs(String JavaDoc docs);
84
85   int getTtl();
86
87   void setTtl(int ttl);
88
89   /**
90    * Gets the syntax format used by the channel.
91    *
92    * @return The format of the channel as specified by
93    * the constants in {@link ChannelFormat}.
94    */

95   ChannelFormat getFormat();
96
97   void setFormat(ChannelFormat format);
98
99   /**
100    * @return A collection of {@link ItemIF} objects.
101    */

102   Collection JavaDoc getItems();
103
104   void addItem(ItemIF item);
105
106   void removeItem(ItemIF item);
107
108   /**
109    * Returns the news item as specified by the item identifier
110    * ({@link ItemIF#getId()}).
111    * @param id the Item's id.
112    * @return the Item
113    */

114   ItemIF getItem(long id);
115
116   /**
117    * Retrieves the Image associated with this feed. Optional
118    * @return An ImageIF representing the image associated with this feed
119    */

120   ImageIF getImage();
121
122   /**
123    * Sets the image for this feed
124    * @param image The image
125    */

126   void setImage(ImageIF image);
127
128   TextInputIF getTextInput();
129
130   void setTextInput(TextInputIF textInput);
131
132   Date JavaDoc getLastUpdated();
133
134   void setLastUpdated(Date JavaDoc lastUpdated);
135
136   Date JavaDoc getLastBuildDate();
137
138   void setLastBuildDate(Date JavaDoc lastBuild);
139
140   Date JavaDoc getPubDate();
141
142   void setPubDate(Date JavaDoc pubDate);
143
144   CloudIF getCloud();
145
146   void setCloud(CloudIF cloud);
147
148   // RSS 1.0 Syndication Module methods
149

150   /**
151    * Accesses data provided by the Syndication module (will apply only
152    * to RSS 1.0+). The return type will be one of:
153    * <ul>
154    * <li>UPDATE_HOURLY</li>
155    * <li>UPDATE_DAILY</li>
156    * <li>UPDATE_WEEKLY</li>
157    * <li>UPDATE_MONTHLY</li>
158    * <li>UPDATE_YEARLY</li>
159    * <li>Null if tag not present in the RSS file</li>
160    * </ul>
161    * @return see above
162    */

163   String JavaDoc getUpdatePeriod();
164
165   /**
166    * Sets the update frequency for the feed. This information will be stored
167    * according to the Syndication Module tags. <code>updateFrequency</code>
168    * should be one of:
169    * <ul>
170    * <li>UPDATE_HOURLY</li>
171    * <li>UPDATE_DAILY</li>
172    * <li>UPDATE_WEEKLY</li>
173    * <li>UPDATE_MONTHLY</li>
174    * <li>UPDATE_YEARLY</li>
175    * <li>Null if tag not present in the RSS file</li>
176    * </ul>
177    * @param updatePeriod See above
178    */

179   void setUpdatePeriod(String JavaDoc updatePeriod);
180
181   /**
182    * Accesses data provided by the Syndication module (will apply only
183    * to RSS 1.0+). Returns the number of times during the
184    * <code>updatePeriod</code> that a feed should be updated
185    * @return The number of times during <code>updatePeriod</code> to update the
186    * feed
187    * @see #setUpdatePeriod
188    * @see #getUpdatePeriod
189    */

190   int getUpdateFrequency();
191
192   /**
193    * Sets the number of times during <code>updatePeriod</code> that the feed
194    * should be updated
195    * @param updateFrequency number of times during <code>updatePeriod</code> to
196    * update the feed
197    */

198   void setUpdateFrequency(int updateFrequency);
199
200   /**
201    * Accesses data provided by the Syndication module (will apply only
202    * to RSS 1.0+). Provides the base date against which to determine the next
203    * time to update the feed.
204    * @return The date from which the next update times should be calculated
205    */

206   Date JavaDoc getUpdateBase();
207
208   /**
209    * Sets the base time against which update times should be calculated
210    * @param updateBase The base date for updates
211    */

212   void setUpdateBase(Date JavaDoc updateBase);
213 }
214
Popular Tags