Source Code Cross Referenced for AbstractPersistentDataClient.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: AbstractPersistentDataClient.java 6956 2007-08-11 15:20:31Z bmc $
003:        \*---------------------------------------------------------------------------*/
004:
005:        package org.clapper.curn;
006:
007:        import java.util.Collections;
008:        import java.util.HashMap;
009:        import java.util.Map;
010:
011:        /**
012:         * Abstract class that implements the {@link PersistentDataClient}
013:         * interface, providing stubs or simple versions of the methods. This class
014:         * makes it easier for a class to declare itself as a
015:         * <tt>PersistentDataClient</tt>, even if it doesn't need to implement all
016:         * the <tt>PersistentDataClient</tt> methods.
017:         *
018:         * @version <tt>$Revision: 6956 $</tt>
019:         */
020:        public class AbstractPersistentDataClient implements 
021:                PersistentDataClient {
022:            /*----------------------------------------------------------------------*\
023:                                       Private Constants
024:            \*----------------------------------------------------------------------*/
025:
026:            private static Map<String, String> NO_METADATA = Collections
027:                    .unmodifiableMap(new HashMap<String, String>());
028:
029:            /*----------------------------------------------------------------------*\
030:                                     Private Instance Data
031:            \*----------------------------------------------------------------------*/
032:
033:            /*----------------------------------------------------------------------*\
034:                                           Constructor
035:            \*----------------------------------------------------------------------*/
036:
037:            /**
038:             * Creates a new instance of AbstractPersistentDataClient
039:             */
040:            protected AbstractPersistentDataClient() {
041:            }
042:
043:            /*----------------------------------------------------------------------*\
044:                                        Public Methods
045:            \*----------------------------------------------------------------------*/
046:
047:            /**
048:             * <p>Process a data item that has been read from the metadata store
049:             * and is associated with a feed (or channel). This method is
050:             * called when the metadata store is being loaded into memory
051:             * at the beginning of a <i>curn</i> run. This method is only called
052:             * for data items within this object's name space.</p>
053:             *
054:             * <p>This stub implementation does nothing.</p>
055:             *
056:             *
057:             * @param name     the name associated with the data item
058:             * @param value    the (string) value of the data
059:             * @param feedData the {@link FeedCacheEntry} record for the feed
060:             * @see #getMetatdataNamespace
061:             * @throws CurnException on error
062:             */
063:            public void parseFeedMetadata(String name, String value,
064:                    FeedCacheEntry feedData) throws CurnException {
065:            }
066:
067:            /**
068:             * <p>Process a data item that has been read from the metadata store
069:             * and is associated with a cached item. This method is called when
070:             * the metadata store is being loaded into memory at the beginning
071:             * of a <i>curn</i> run. This method is only called for data items
072:             * within this object's name space.</p>
073:             *
074:             * <p>This stub implementation does nothing.</p>
075:             *
076:             * @param name     the name associated with the data item
077:             * @param value    the (string) value of the data
078:             * @param itemData The {@link FeedCacheEntry} data for the item
079:             *
080:             * @throws CurnException on error
081:             *
082:             * @see #getMetatdataNamespace
083:             */
084:            public void parseItemMetadata(String name, String value,
085:                    FeedCacheEntry itemData) throws CurnException {
086:            }
087:
088:            /**
089:             * <p>Process an "extra" data item that is not associated with a feed
090:             * or an item. This method is called when the metadata store is
091:             * being loaded into memory at the beginning of a <i>curn</i> run.
092:             * This method is only called for data items within this object's name
093:             * space.</p>
094:             *
095:             *
096:             * @param name  the name of the data item
097:             * @param value its value
098:             *
099:             * @throws CurnException on error
100:             *
101:             * @see #getMetatdataNamespace
102:             */
103:            public void parseExtraMetadata(String name, String value)
104:                    throws CurnException {
105:            }
106:
107:            /**
108:             * <p>Get the metadata that is to be saved with a particular feed or
109:             * channel.</p>
110:             *
111:             * <p>This stub implementation does nothing and returns an empty map.</p>
112:             *
113:             * @param feedData the {@link FeedCacheEntry} record for the feed
114:             *
115:             * @return a <tt>Map</tt> of all the name/value pairs to be associated
116:             *         with the feed. The names should not be qualified by the
117:             *         namespace; the caller will handle that. An empty or null
118:             *         map signifies that this object has no metadata for the feed.
119:             *
120:             * @throws CurnException on error
121:             */
122:            public Map<String, String> getMetadataForFeed(
123:                    FeedCacheEntry feedData) throws CurnException {
124:                return NO_METADATA;
125:            }
126:
127:            /**
128:             * <p>Get the metadata that is to be saved with a particular item within a
129:             * feed.</p>
130:             *
131:             * <p>This stub implementation does nothing and returns an empty map.</p>
132:             *
133:             * @param itemData the {@link FeedCacheEntry} record for the item
134:             * @param feedData the {@link FeedCacheEntry} record for the parent feed
135:             *
136:             * @return a <tt>Map</tt> of all the name/value pairs to be associated
137:             *         with the  item. The names should not be qualified by the
138:             *         namespace; the caller will handle that. An empty or null
139:             *         map signifies that this object has no metadata for the item.
140:             *
141:             * @throws CurnException on error
142:             */
143:            public Map<String, String> getMetadataForItem(
144:                    FeedCacheEntry itemData, FeedCacheEntry feedData)
145:                    throws CurnException {
146:                return NO_METADATA;
147:            }
148:
149:            /**
150:             * <p>Get any extra metadata (i.e., data that is not associated with a feed
151:             * or an item) that is to be saved.</p>
152:             *
153:             * <p>This stub implementation does nothing and returns an empty map.</p>
154:             *
155:             * @return a <tt>Map</tt> of all the name/value pairs to be associated
156:             *         with the feed. The names should not be qualified by the
157:             *         namespace; the caller will handle that. An empty or null
158:             *         map signifies that this object has no extract metadata.
159:             *
160:             * @throws CurnException on error
161:             */
162:            public Map<String, String> getExtraFeedMetadata()
163:                    throws CurnException {
164:                return NO_METADATA;
165:            }
166:
167:            /**
168:             * <p>Get the namespace for this object's metadata. The namespace must
169:             * be unique. Think of it as a package name for the data. Recommendation:
170:             * Use the fully-qualified class name.</p>
171:             *
172:             * <p>This implementation returns the fully-qualified class name of the
173:             * subclass.</p>
174:             *
175:             * @return the namespace
176:             */
177:            public String getMetatdataNamespace() {
178:                return this .getClass().getName();
179:            }
180:
181:            /*----------------------------------------------------------------------*\
182:                                       Protected Methods
183:            \*----------------------------------------------------------------------*/
184:
185:            /*----------------------------------------------------------------------*\
186:                                        Private Methods
187:            \*----------------------------------------------------------------------*/
188:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.