1 18 19 package org.apache.roller.pojos; 20 21 import java.io.Serializable ; 22 import java.sql.Timestamp ; 23 24 34 public class PingQueueEntryData extends PersistentObject implements Serializable { 35 private String id = null; 36 private Timestamp entryTime = null; 37 private PingTargetData pingTarget = null; 38 private WebsiteData website = null; 39 private int attempts = 0; 40 41 public static final long serialVersionUID = -1468021030819538243L; 42 43 46 public PingQueueEntryData() { 47 } 48 49 58 public PingQueueEntryData(String id, Timestamp entryTime, PingTargetData pingTarget, WebsiteData website, int attempts) { 59 this.id = id; 60 this.entryTime = entryTime; 61 this.pingTarget = pingTarget; 62 this.website = website; 63 this.attempts = attempts; 64 } 65 66 69 public void setData(PersistentObject vo) { 70 PingQueueEntryData other = (PingQueueEntryData) vo; 71 72 id = other.getId(); 73 entryTime = other.getEntryTime(); 74 pingTarget = other.getPingTarget(); 75 website = other.getWebsite(); 76 attempts = other.getAttempts(); 77 } 78 79 86 public String getId() { 87 return id; 88 } 89 90 96 public void setId(String id) { 97 this.id = id; 98 } 99 100 107 public Timestamp getEntryTime() { 108 return entryTime; 109 } 110 111 117 public void setEntryTime(Timestamp entryTime) { 118 this.entryTime = entryTime; 119 } 120 121 128 public PingTargetData getPingTarget() { 129 return pingTarget; 130 } 131 132 138 public void setPingTarget(PingTargetData pingTarget) { 139 this.pingTarget = pingTarget; 140 } 141 142 149 public WebsiteData getWebsite() { 150 return website; 151 } 152 153 159 public void setWebsite(WebsiteData website) { 160 this.website = website; 161 } 162 163 170 public int getAttempts() { 171 return attempts; 172 } 173 174 180 public void setAttempts(int attempts) { 181 this.attempts = attempts; 182 } 183 184 189 public int incrementAttempts() { 190 return ++attempts; 191 } 192 193 196 public boolean equals(Object o) { 197 if (this == o) return true; 198 if (!(o instanceof PingQueueEntryData)) return false; 199 200 final PingQueueEntryData pingQueueEntryData = (PingQueueEntryData) o; 201 202 if (attempts != pingQueueEntryData.getAttempts()) return false; 203 if (entryTime != null ? !entryTime.equals(pingQueueEntryData.getEntryTime()) : pingQueueEntryData.getEntryTime() != null) 204 { 205 return false; 206 } 207 if (id != null ? !id.equals(pingQueueEntryData.getId()) : pingQueueEntryData.getId() != null) return false; 208 if (pingTarget != null ? !pingTarget.equals(pingQueueEntryData.getPingTarget()) : pingQueueEntryData.getPingTarget() != null) 209 { 210 return false; 211 } 212 if (website != null ? !website.equals(pingQueueEntryData.getWebsite()) : pingQueueEntryData.getWebsite() != null) 213 { 214 return false; 215 } 216 217 return true; 218 } 219 220 223 public int hashCode() { 224 return (id != null ? id.hashCode() : 0); 225 } 226 227 233 public String toString() { 234 return "PingQueueEntryData{" + "id='" + id + "'" + ", entryTime=" + entryTime + ", pingTarget=" + pingTarget + ", website= " + (website == null ? "null" : "{id='" + website.getId() + "'} ") + ", attempts=" + attempts + "}"; 235 } 236 } 237 | Popular Tags |