1 8 9 package org.roller.pojos; 10 11 import java.sql.Timestamp ; 12 import java.io.Serializable ; 13 14 23 public class PingQueueEntryData extends PersistentObject implements Serializable 24 { 25 String id; 26 Timestamp entryTime; 27 PingTargetData pingTarget; 28 WebsiteData website; 29 int attempts; 30 31 static final long serialVersionUID = -1468021030819538243L; 32 33 36 public PingQueueEntryData() 37 { 38 } 39 40 49 public PingQueueEntryData(String id, Timestamp entryTime, PingTargetData pingTarget, WebsiteData website, int attempts) 50 { 51 this.id = id; 52 this.entryTime = entryTime; 53 this.pingTarget = pingTarget; 54 this.website = website; 55 this.attempts = attempts; 56 } 57 58 61 public void setData(PersistentObject vo) 62 { 63 PingQueueEntryData other = (PingQueueEntryData) vo; 64 id = other.id; 65 entryTime = other.entryTime; 66 pingTarget = other.pingTarget; 67 website = other.website; 68 attempts = other.attempts; 69 } 70 71 78 public String getId() 79 { 80 return id; 81 } 82 83 89 public void setId(String id) 90 { 91 this.id = id; 92 } 93 94 101 public Timestamp getEntryTime() 102 { 103 return entryTime; 104 } 105 106 112 public void setEntryTime(Timestamp entryTime) 113 { 114 this.entryTime = entryTime; 115 } 116 117 124 public PingTargetData getPingTarget() 125 { 126 return pingTarget; 127 } 128 129 135 public void setPingTarget(PingTargetData pingTarget) 136 { 137 this.pingTarget = pingTarget; 138 } 139 140 147 public WebsiteData getWebsite() 148 { 149 return website; 150 } 151 152 158 public void setWebsite(WebsiteData website) 159 { 160 this.website = website; 161 } 162 163 170 public int getAttempts() 171 { 172 return attempts; 173 } 174 175 181 public void setAttempts(int attempts) 182 { 183 this.attempts = attempts; 184 } 185 186 191 public int incrementAttempts() 192 { 193 return ++attempts; 194 } 195 196 199 public boolean equals(Object o) 200 { 201 if (this == o) return true; 202 if (!(o instanceof PingQueueEntryData)) return false; 203 204 final PingQueueEntryData pingQueueEntryData = (PingQueueEntryData) o; 205 206 if (attempts != pingQueueEntryData.attempts) return false; 207 if (entryTime != null ? !entryTime.equals(pingQueueEntryData.entryTime) : pingQueueEntryData.entryTime != null) return false; 208 if (id != null ? !id.equals(pingQueueEntryData.id) : pingQueueEntryData.id != null) return false; 209 if (pingTarget != null ? !pingTarget.equals(pingQueueEntryData.pingTarget) : pingQueueEntryData.pingTarget != null) return false; 210 if (website != null ? !website.equals(pingQueueEntryData.website) : pingQueueEntryData.website != null) return false; 211 212 return true; 213 } 214 215 218 public int hashCode() 219 { 220 return (id != null ? id.hashCode() : 0); 221 } 222 223 228 public String toString() 229 { 230 return "PingQueueEntryData{" + 231 "id='" + id + "'" + 232 ", entryTime=" + entryTime + 233 ", pingTarget=" + pingTarget + 234 ", website= " + (website == null ? "null" : "{id='" + website.getId() + "', user='" + website.getUser().getUserName() + "'} ") + 235 ", attempts=" + attempts + 236 "}"; 237 } 238 } 239 | Popular Tags |