1 18 19 package org.apache.roller.pojos; 20 21 import java.io.Serializable ; 22 import java.sql.Timestamp ; 23 24 25 36 public class PingTargetData extends PersistentObject implements Serializable { 37 38 public static final long serialVersionUID = -6354583200913127874L; 39 40 public static final int CONDITION_OK = 0; public static final int CONDITION_FAILING = 1; public static final int CONDITION_DISABLED = 2; 44 private String id = null; 45 private String name = null; 46 private String pingUrl = null; 47 private WebsiteData website = null; 48 private int conditionCode = -1; 49 private Timestamp lastSuccess = null; 50 private boolean autoEnabled = false; 51 52 53 56 public PingTargetData() { 57 } 58 59 60 68 public PingTargetData(String id, String name, String pingUrl, WebsiteData website, boolean autoEnable) { 69 this.id = id; 70 this.name = name; 71 this.pingUrl = pingUrl; 72 this.website = website; 73 this.conditionCode = CONDITION_OK; 74 this.lastSuccess = null; 75 this.autoEnabled = autoEnable; 76 } 77 78 79 82 public void setData(PersistentObject vo) { 83 PingTargetData other = (PingTargetData) vo; 84 85 id = other.getId(); 86 name = other.getName(); 87 pingUrl = other.getPingUrl(); 88 website = other.getWebsite(); 89 conditionCode = other.getConditionCode(); 90 lastSuccess = other.getLastSuccess(); 91 autoEnabled = other.isAutoEnabled(); 92 } 93 94 95 103 public java.lang.String getId() { 104 return this.id; 105 } 106 107 108 114 public void setId(java.lang.String id) { 115 this.id = id; 116 } 117 118 119 127 public java.lang.String getName() { 128 return this.name; 129 } 130 131 132 138 public void setName(java.lang.String name) { 139 this.name = name; 140 } 141 142 143 150 public String getPingUrl() { 151 return pingUrl; 152 } 153 154 155 161 public void setPingUrl(String pingUrl) { 162 this.pingUrl = pingUrl; 163 } 164 165 166 175 public WebsiteData getWebsite() { 176 return website; 177 } 178 179 180 187 public void setWebsite(WebsiteData website) { 188 this.website = website; 189 } 190 191 192 202 public int getConditionCode() { 203 return conditionCode; 204 } 205 206 207 213 public void setConditionCode(int conditionCode) { 214 this.conditionCode = conditionCode; 215 } 216 217 218 225 public Timestamp getLastSuccess() { 226 return lastSuccess; 227 } 228 229 230 236 public void setLastSuccess(Timestamp lastSuccess) { 237 this.lastSuccess = lastSuccess; 238 } 239 240 241 248 public boolean isAutoEnabled() { 249 return autoEnabled; 250 } 251 252 253 260 public void setAutoEnabled(boolean autoEnabled) { 261 this.autoEnabled = autoEnabled; 262 } 263 264 265 268 public int hashCode() { 269 return id.hashCode(); 270 } 271 272 273 276 public boolean equals(Object o) { 277 if (this == o) return true; 278 if (!(o instanceof PingTargetData)) return false; 279 280 final PingTargetData pingTargetData = (PingTargetData) o; 281 282 if (conditionCode != pingTargetData.getConditionCode()) return false; 283 if (id != null ? !id.equals(pingTargetData.getId()) : pingTargetData.getId() != null) return false; 284 if (lastSuccess != null ? !lastSuccess.equals(pingTargetData.getLastSuccess()) : pingTargetData.getLastSuccess() != null) 285 { 286 return false; 287 } 288 if (name != null ? !name.equals(pingTargetData.getName()) : pingTargetData.getName() != null) return false; 289 if (pingUrl != null ? !pingUrl.equals(pingTargetData.getPingUrl()) : pingTargetData.getPingUrl() != null) { 290 return false; 291 } 292 if (website != null ? !website.equals(pingTargetData.getWebsite()) : pingTargetData.getWebsite() != null) { 293 return false; 294 } 295 296 return true; 297 } 298 299 300 306 public String toString() { 307 return "PingTargetData{" + "id='" + id + "'" + ", name='" + name + "'" + ", pingUrl='" + pingUrl + "'" + ", website= " + (website == null ? "null" : "{id='" + website.getId() + "'} ") + ", conditionCode=" + conditionCode + ", lastSuccess=" + lastSuccess + "}"; 308 } 309 310 } 311 | Popular Tags |