KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > blojsom > plugin > syndication > module > SimplePingback


1 /**
2  * Copyright (c) 2003-2006, David A. Czarnecki
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * Redistributions of source code must retain the above copyright notice, this list of conditions and the
9  * following disclaimer.
10  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
11  * following disclaimer in the documentation and/or other materials provided with the distribution.
12  * Neither the name of "David A. Czarnecki" and "blojsom" nor the names of its contributors may be used to
13  * endorse or promote products derived from this software without specific prior written permission.
14  * Products derived from this software may not be called "blojsom", nor may "blojsom" appear in their name,
15  * without prior written permission of David A. Czarnecki.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
18  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
19  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
21  * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  */

31 package org.blojsom.plugin.syndication.module;
32
33 import java.util.Date JavaDoc;
34 import java.util.List JavaDoc;
35 import java.util.ArrayList JavaDoc;
36
37 /**
38  * Simple pingback
39  *
40  * @author David Czarnecki
41  * @since blojsom 3.0
42  * @version $Id: SimplePingback.java,v 1.2 2006/08/18 17:24:12 czarneckid Exp $
43  */

44 public class SimplePingback implements Cloneable JavaDoc {
45
46     private String JavaDoc title;
47     private String JavaDoc excerpt;
48     private String JavaDoc url;
49     private String JavaDoc blogName;
50     private Date JavaDoc pingbackDate;
51     private String JavaDoc ip;
52     private String JavaDoc status;
53     private String JavaDoc sourceURI;
54     private String JavaDoc targetURI;
55     private List JavaDoc metadata;
56
57     public SimplePingback() {
58     }
59
60     public String JavaDoc getTitle() {
61         return title;
62     }
63
64     public void setTitle(String JavaDoc title) {
65         this.title = title;
66     }
67
68     public String JavaDoc getExcerpt() {
69         return excerpt;
70     }
71
72     public void setExcerpt(String JavaDoc excerpt) {
73         this.excerpt = excerpt;
74     }
75
76     public String JavaDoc getUrl() {
77         return url;
78     }
79
80     public void setUrl(String JavaDoc url) {
81         this.url = url;
82     }
83
84     public String JavaDoc getBlogName() {
85         return blogName;
86     }
87
88     public void setBlogName(String JavaDoc blogName) {
89         this.blogName = blogName;
90     }
91
92     public Date JavaDoc getPingbackDate() {
93         return pingbackDate;
94     }
95
96     public void setPingbackDate(Date JavaDoc pingbackDate) {
97         this.pingbackDate = pingbackDate;
98     }
99
100     public String JavaDoc getIp() {
101         return ip;
102     }
103
104     public void setIp(String JavaDoc ip) {
105         this.ip = ip;
106     }
107
108     public String JavaDoc getStatus() {
109         return status;
110     }
111
112     public void setStatus(String JavaDoc status) {
113         this.status = status;
114     }
115
116     public String JavaDoc getSourceURI() {
117         return sourceURI;
118     }
119
120     public void setSourceURI(String JavaDoc sourceURI) {
121         this.sourceURI = sourceURI;
122     }
123
124     public String JavaDoc getTargetURI() {
125         return targetURI;
126     }
127
128     public void setTargetURI(String JavaDoc targetURI) {
129         this.targetURI = targetURI;
130     }
131
132     public List JavaDoc getMetadata() {
133         return metadata;
134     }
135
136     public void setMetadata(List JavaDoc metadata) {
137         this.metadata = metadata;
138     }
139
140     public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
141         SimplePingback cloned = new SimplePingback();
142
143         cloned.setBlogName(blogName);
144         cloned.setExcerpt(excerpt);
145         cloned.setIp(ip);
146         cloned.setStatus(status);
147         cloned.setTitle(title);
148         cloned.setPingbackDate(pingbackDate);
149         cloned.setUrl(url);
150         cloned.setSourceURI(sourceURI);
151         cloned.setTargetURI(targetURI);
152
153         // Process metadata
154
List JavaDoc copiedMetadata = new ArrayList JavaDoc();
155         if (metadata != null) {
156             for (int i = 0; i < metadata.size(); i++) {
157                 Metadata metadataItem = (Metadata) metadata.get(i);
158                 Metadata copiedMetadataItem = new Metadata();
159                 copiedMetadataItem.setKey(metadataItem.getKey());
160                 copiedMetadataItem.setValue(metadataItem.getValue());
161
162                 copiedMetadata.add(copiedMetadataItem);
163             }
164         }
165         cloned.setMetadata(copiedMetadata);
166
167         return cloned;
168     }
169 }
170
Popular Tags