001: /**
002: * Copyright (c) 2003-2007, David A. Czarnecki
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions are met:
007: *
008: * Redistributions of source code must retain the above copyright notice, this list of conditions and the
009: * following disclaimer.
010: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
011: * following disclaimer in the documentation and/or other materials provided with the distribution.
012: * Neither the name of "David A. Czarnecki" and "blojsom" nor the names of its contributors may be used to
013: * endorse or promote products derived from this software without specific prior written permission.
014: * Products derived from this software may not be called "blojsom", nor may "blojsom" appear in their name,
015: * without prior written permission of David A. Czarnecki.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
018: * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
019: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
020: * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
021: * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
022: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
025: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
026: * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
027: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
028: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
029: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030: */package org.blojsom.plugin.syndication.module;
031:
032: import java.util.Date;
033: import java.util.List;
034: import java.util.ArrayList;
035:
036: /**
037: * Simple pingback
038: *
039: * @author David Czarnecki
040: * @since blojsom 3.0
041: * @version $Id: SimplePingback.java,v 1.3 2007/01/17 02:35:06 czarneckid Exp $
042: */
043: public class SimplePingback implements Cloneable {
044:
045: private String title;
046: private String excerpt;
047: private String url;
048: private String blogName;
049: private Date pingbackDate;
050: private String ip;
051: private String status;
052: private String sourceURI;
053: private String targetURI;
054: private List metadata;
055:
056: public SimplePingback() {
057: }
058:
059: public String getTitle() {
060: return title;
061: }
062:
063: public void setTitle(String title) {
064: this .title = title;
065: }
066:
067: public String getExcerpt() {
068: return excerpt;
069: }
070:
071: public void setExcerpt(String excerpt) {
072: this .excerpt = excerpt;
073: }
074:
075: public String getUrl() {
076: return url;
077: }
078:
079: public void setUrl(String url) {
080: this .url = url;
081: }
082:
083: public String getBlogName() {
084: return blogName;
085: }
086:
087: public void setBlogName(String blogName) {
088: this .blogName = blogName;
089: }
090:
091: public Date getPingbackDate() {
092: return pingbackDate;
093: }
094:
095: public void setPingbackDate(Date pingbackDate) {
096: this .pingbackDate = pingbackDate;
097: }
098:
099: public String getIp() {
100: return ip;
101: }
102:
103: public void setIp(String ip) {
104: this .ip = ip;
105: }
106:
107: public String getStatus() {
108: return status;
109: }
110:
111: public void setStatus(String status) {
112: this .status = status;
113: }
114:
115: public String getSourceURI() {
116: return sourceURI;
117: }
118:
119: public void setSourceURI(String sourceURI) {
120: this .sourceURI = sourceURI;
121: }
122:
123: public String getTargetURI() {
124: return targetURI;
125: }
126:
127: public void setTargetURI(String targetURI) {
128: this .targetURI = targetURI;
129: }
130:
131: public List getMetadata() {
132: return metadata;
133: }
134:
135: public void setMetadata(List metadata) {
136: this .metadata = metadata;
137: }
138:
139: public Object clone() throws CloneNotSupportedException {
140: SimplePingback cloned = new SimplePingback();
141:
142: cloned.setBlogName(blogName);
143: cloned.setExcerpt(excerpt);
144: cloned.setIp(ip);
145: cloned.setStatus(status);
146: cloned.setTitle(title);
147: cloned.setPingbackDate(pingbackDate);
148: cloned.setUrl(url);
149: cloned.setSourceURI(sourceURI);
150: cloned.setTargetURI(targetURI);
151:
152: // Process metadata
153: List copiedMetadata = new ArrayList();
154: if (metadata != null) {
155: for (int i = 0; i < metadata.size(); i++) {
156: Metadata metadataItem = (Metadata) metadata.get(i);
157: Metadata copiedMetadataItem = new Metadata();
158: copiedMetadataItem.setKey(metadataItem.getKey());
159: copiedMetadataItem.setValue(metadataItem.getValue());
160:
161: copiedMetadata.add(copiedMetadataItem);
162: }
163: }
164: cloned.setMetadata(copiedMetadata);
165:
166: return cloned;
167: }
168: }
|