Source Code Cross Referenced for PersistentFeedData.java in  » RSS-RDF » curn » org » clapper » curn » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » curn » org.clapper.curn 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*---------------------------------------------------------------------------*\
002:         $Id: PersistentFeedData.java 6547 2006-11-03 03:38:55Z bmc $
003:        \*---------------------------------------------------------------------------*/
004:
005:        package org.clapper.curn;
006:
007:        import java.util.Collection;
008:        import java.util.Collections;
009:        import java.util.HashSet;
010:        import java.util.Set;
011:
012:        /**
013:         * <p>A <tt>PersistentFeedData</tt> object contains feed cache data and related
014:         * metadata for a single feed (or channel), in a form suitable for saving to
015:         * and restoring from an external store. The data are organized to make
016:         * persistence operations easier. At runtime, the data are reorganized: The
017:         * cache-specific data is stored in the feed cache (see {@link FeedCache}) and
018:         * other metadata items are parceled out to various plug-ins.</p>
019:         *
020:         * <p>There are three categories of persistent feed data:</p>
021:         *
022:         * <ul>
023:         *   <li> The feed cache data for the feed itself, stored in a
024:         *        {@link FeedCacheEntry} object
025:         *   <li> The feed cache data for the items within the feed, stored in
026:         *        individual {@link FeedCacheEntry} objects.
027:         *   <li> Any additional metadata (typically generated by plug-ins)
028:         *        associated with the feed, stored in name/value pairs within
029:         *        individual namespaces. (e.g., Each plug-in typically stores its
030:         *        data in a separate namespace.)
031:         * </ul>
032:         *
033:         * <p><b>WARNING:</b> This class is <b>not</b> thread-safe.</p>
034:         *
035:         * @see FeedCache
036:         * @see DataPersister
037:         * @see PersistentFeedItemData
038:         *
039:         * @version <tt>$Revision: 6547 $</tt>
040:         */
041:        public class PersistentFeedData {
042:            /*----------------------------------------------------------------------*\
043:                                       Private Constants
044:            \*----------------------------------------------------------------------*/
045:
046:            /*----------------------------------------------------------------------*\
047:                                     Private Instance Data
048:            \*----------------------------------------------------------------------*/
049:
050:            /**
051:             * The FeedCacheEntry for this feed
052:             */
053:            private FeedCacheEntry feedCacheEntry = null;
054:
055:            /**
056:             * The PersistentFeedItemData contained within this feed.
057:             */
058:            private Set<PersistentFeedItemData> feedItemData = new HashSet<PersistentFeedItemData>();
059:
060:            /**
061:             * Extra metadata associated with the feed.
062:             */
063:            private Set<PersistentMetadataGroup> feedMetadata = new HashSet<PersistentMetadataGroup>();
064:
065:            /*----------------------------------------------------------------------*\
066:                                           Constructor
067:            \*----------------------------------------------------------------------*/
068:
069:            /**
070:             * Creates a new instance of <tt>PersistentFeedData</tt>.
071:             *
072:             * @param feedCacheEntry the {@link FeedCacheEntry} for the channel/feed
073:             */
074:            public PersistentFeedData(FeedCacheEntry feedCacheEntry) {
075:                setFeedCacheEntry(feedCacheEntry);
076:            }
077:
078:            /**
079:             * Allocate a new empty <tt>PersistentFeedData</tt> object.
080:             */
081:            public PersistentFeedData() {
082:            }
083:
084:            /*----------------------------------------------------------------------*\
085:                                        Public Methods
086:            \*----------------------------------------------------------------------*/
087:
088:            /**
089:             * Get the {@link FeedCacheEntry} for the feed
090:             *
091:             * @return the {@link FeedCacheEntry}
092:             */
093:            public FeedCacheEntry getFeedCacheEntry() {
094:                return feedCacheEntry;
095:            }
096:
097:            /**
098:             * Set the {@link FeedCacheEntry} field.
099:             *
100:             * @param feedCacheEntry the {@link FeedCacheEntry} object for the
101:             *                       channel/feed
102:             */
103:            public final void setFeedCacheEntry(
104:                    final FeedCacheEntry feedCacheEntry) {
105:                this .feedCacheEntry = feedCacheEntry;
106:
107:                // An entry for a channel will have the same entry URL as channel URL.
108:
109:                assert (feedCacheEntry.isChannelEntry());
110:            }
111:
112:            /**
113:             * Add persistent data for a feed item to this object.
114:             *
115:             * @param itemData  the {@link PersistentFeedItemData} object to add
116:             */
117:            public void addPersistentFeedItem(PersistentFeedItemData itemData) {
118:                feedItemData.add(itemData);
119:            }
120:
121:            /**
122:             * Get the list of {@link PersistentFeedItemData} entries associated with
123:             * this feed.
124:             *
125:             * @return a read-only collection of {@link PersistentFeedItemData}
126:             *         objects and empty collection if there are none.
127:             *
128:             * @see #addPersistentFeedItem
129:             */
130:            public Collection<PersistentFeedItemData> getPersistentFeedItems() {
131:                return Collections.unmodifiableSet(feedItemData);
132:            }
133:
134:            /**
135:             * Add a metadata group (i.e., all the metadata within a given
136:             * namespace) to this object.
137:             *
138:             * @param metadataGroup  the group of metadata
139:             */
140:            public void addFeedMetadataGroup(
141:                    PersistentMetadataGroup metadataGroup) {
142:                feedMetadata.add(metadataGroup);
143:            }
144:
145:            /**
146:             * Add a metadata group (i.e., all the metadata within a given
147:             * namespace) to this object.
148:             *
149:             * @param metadata  the metadata
150:             */
151:            public void addFeedMetadata(
152:                    Collection<PersistentMetadataGroup> metadata) {
153:                for (PersistentMetadataGroup metadataGroup : metadata)
154:                    addFeedMetadataGroup(metadataGroup);
155:            }
156:
157:            /**
158:             * Get the extra metadata associated with the feed. The returned data
159:             * is aggregated into individual namespaces.
160:             *
161:             * @return a <tt>Collection</tt> of {@link PersistentMetadataGroup}
162:             *         objects, each one containing the data for one namespace.
163:             *         The collection will be empty if there is no feed metadata.
164:             */
165:            public Collection<PersistentMetadataGroup> getFeedMetadata() {
166:                return Collections.unmodifiableCollection(feedMetadata);
167:            }
168:
169:            /*----------------------------------------------------------------------*\
170:                                       Protected Methods
171:            \*----------------------------------------------------------------------*/
172:
173:            /*----------------------------------------------------------------------*\
174:                                        Private Methods
175:            \*----------------------------------------------------------------------*/
176:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.