001: //
002: // Informa -- RSS Library for Java
003: // Copyright (c) 2002 by Niko Schmuck
004: //
005: // Niko Schmuck
006: // http://sourceforge.net/projects/informa
007: // mailto:niko_schmuck@users.sourceforge.net
008: //
009: // This library is free software.
010: //
011: // You may redistribute it and/or modify it under the terms of the GNU
012: // Lesser General Public License as published by the Free Software Foundation.
013: //
014: // Version 2.1 of the license should be included with this distribution in
015: // the file LICENSE. If the license is not included with this distribution,
016: // you may find a copy at the FSF web site at 'www.gnu.org' or 'www.fsf.org',
017: // or you may write to the Free Software Foundation, 675 Mass Ave, Cambridge,
018: // MA 02139 USA.
019: //
020: // This library is distributed in the hope that it will be useful,
021: // but WITHOUT ANY WARRANTY; without even the implied waranty of
022: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
023: // Lesser General Public License for more details.
024: //
025:
026: // $Id: ChannelIF.java,v 1.35 2007/01/06 21:33:44 niko_schmuck Exp $
027:
028: package de.nava.informa.core;
029:
030: import java.util.Date;
031: import java.util.Set;
032:
033: /**
034: * This interface is implemented by objects representing channels in the
035: * news channel object model.</p>
036: *
037: * @author Niko Schmuck (niko@nava.de)
038: */
039: public interface ChannelIF extends WithIdMIF, WithTitleMIF,
040: WithElementsAndAttributesMIF, WithLocationMIF, WithCreatorMIF,
041: WithCategoriesMIF, WithDescriptionMIF, WithSiteMIF,
042: ChannelObservableIF {
043:
044: // ----- accessors and mutators
045:
046: /* Dublin Core Metadata, like Creator and Subject */
047:
048: String getLanguage();
049:
050: void setLanguage(String language);
051:
052: String getPublisher();
053:
054: void setPublisher(String publisher);
055:
056: String getRating();
057:
058: void setRating(String rating);
059:
060: String getGenerator();
061:
062: void setGenerator(String generator);
063:
064: String getDocs();
065:
066: void setDocs(String docs);
067:
068: int getTtl();
069:
070: void setTtl(int ttl);
071:
072: /**
073: * Gets the syntax format used by the channel.
074: *
075: * @return The format of the channel as specified by
076: * the constants in {@link ChannelFormat}.
077: */
078: ChannelFormat getFormat();
079:
080: void setFormat(ChannelFormat format);
081:
082: /**
083: * @return An set of {@link ItemIF} objects.
084: */
085: Set<ItemIF> getItems();
086:
087: void addItem(ItemIF item);
088:
089: void removeItem(ItemIF item);
090:
091: /**
092: * Returns the news item as specified by the item identifier
093: * ({@link ItemIF#getId()}).
094: * @param id the Item's id.
095: * @return the Item
096: */
097: ItemIF getItem(long id);
098:
099: /**
100: * Retrieves the Image associated with this feed. Optional
101: * @return An ImageIF representing the image associated with this feed
102: */
103: ImageIF getImage();
104:
105: /**
106: * Sets the image for this feed
107: * @param image The image
108: */
109: void setImage(ImageIF image);
110:
111: TextInputIF getTextInput();
112:
113: void setTextInput(TextInputIF textInput);
114:
115: /**
116: * Returns that date and time at which the feed was parsed and the
117: * channel object was updated (or created) from feed XML content
118: */
119: Date getLastUpdated();
120:
121: /**
122: * see {@link #getLastUpdated()}
123: */
124: void setLastUpdated(Date lastUpdated);
125:
126: Date getLastBuildDate();
127:
128: void setLastBuildDate(Date lastBuild);
129:
130: Date getPubDate();
131:
132: void setPubDate(Date pubDate);
133:
134: CloudIF getCloud();
135:
136: void setCloud(CloudIF cloud);
137:
138: // RSS 1.0 Syndication Module methods
139:
140: /**
141: * Accesses data provided by the Syndication module (will apply only
142: * to RSS 1.0+). The return type will be one of:
143: * <ul>
144: * <li>ChannelUpdatePeriod.UPDATE_HOURLY</li>
145: * <li>ChannelUpdatePeriod.UPDATE_DAILY</li>
146: * <li>ChannelUpdatePeriod.UPDATE_WEEKLY</li>
147: * <li>ChannelUpdatePeriod.UPDATE_MONTHLY</li>
148: * <li>ChannelUpdatePeriod.UPDATE_YEARLY</li>
149: * <li>ChannelUpdatePeriod.UNDEFINED - if tag not present in the RSS file</li>
150: * </ul>
151: * @return see above
152: */
153: ChannelUpdatePeriod getUpdatePeriod();
154:
155: /**
156: * Sets the update frequency for the feed. This information will be stored
157: * according to the Syndication Module tags. <code>updateFrequency</code>
158: * should be one of:
159: * <ul>
160: * <li>UPDATE_HOURLY</li>
161: * <li>UPDATE_DAILY</li>
162: * <li>UPDATE_WEEKLY</li>
163: * <li>UPDATE_MONTHLY</li>
164: * <li>UPDATE_YEARLY</li>
165: * <li>Null if tag not present in the RSS file</li>
166: * </ul>
167: * @param updatePeriod See above
168: */
169: void setUpdatePeriod(ChannelUpdatePeriod updatePeriod);
170:
171: /**
172: * Accesses data provided by the Syndication module (will apply only
173: * to RSS 1.0+). Returns the number of times during the
174: * <code>updatePeriod</code> that a feed should be updated
175: * @return The number of times during <code>updatePeriod</code> to update the
176: * feed
177: * @see #setUpdatePeriod
178: * @see #getUpdatePeriod
179: */
180: int getUpdateFrequency();
181:
182: /**
183: * Sets the number of times during <code>updatePeriod</code> that the feed
184: * should be updated
185: * @param updateFrequency number of times during <code>updatePeriod</code> to
186: * update the feed
187: */
188: void setUpdateFrequency(int updateFrequency);
189:
190: /**
191: * Accesses data provided by the Syndication module (will apply only
192: * to RSS 1.0+). Provides the base date against which to determine the next
193: * time to update the feed.
194: * @return The date from which the next update times should be calculated
195: */
196: Date getUpdateBase();
197:
198: /**
199: * Sets the base time against which update times should be calculated
200: * @param updateBase The base date for updates
201: */
202: void setUpdateBase(Date updateBase);
203: }
|