1 25 package org.jrobin.mrtg.client; 26 27 import java.util.Date ; 28 29 class ServerInfo implements TreeElementInfo { 30 private String serverHost; 31 private int sampleCount, savesCount, goodSavesCount, badSavesCount; 32 private double poolEfficency; 33 private Date startDate; 34 35 public String getServerHost() { 36 return serverHost; 37 } 38 39 public void setServerHost(String serverHost) { 40 this.serverHost = serverHost; 41 } 42 43 int getSampleCount() { 44 return sampleCount; 45 } 46 47 void setSampleCount(int sampleCount) { 48 this.sampleCount = sampleCount; 49 } 50 51 int getSavesCount() { 52 return savesCount; 53 } 54 55 void setSavesCount(int savesCount) { 56 this.savesCount = savesCount; 57 } 58 59 int getGoodSavesCount() { 60 return goodSavesCount; 61 } 62 63 void setGoodSavesCount(int goodSavesCount) { 64 this.goodSavesCount = goodSavesCount; 65 } 66 67 int getBadSavesCount() { 68 return badSavesCount; 69 } 70 71 void setBadSavesCount(int badSavesCount) { 72 this.badSavesCount = badSavesCount; 73 } 74 75 Date getStartDate() { 76 return startDate; 77 } 78 79 void setStartDate(Date startDate) { 80 this.startDate = startDate; 81 } 82 83 public String toString() { 84 return getServerHost() + " [right click to reload]"; 85 } 86 87 public String getInfo() { 88 StringBuffer buffer = new StringBuffer (); 89 buffer.append("Server host: " + getServerHost() + "\n"); 90 buffer.append("Server started on: " + getStartDate() + "\n"); 91 buffer.append("Samples created: " + getSampleCount() + "\n"); 92 buffer.append("Total samples processed: " + getSavesCount() + "\n"); 93 buffer.append("Samples stored OK: " + getGoodSavesCount() + "\n"); 94 buffer.append("Samples not stored: " + getBadSavesCount() + "\n"); 95 buffer.append("Pool efficency: " + getPoolEfficency() + "\n"); 96 return buffer.toString(); 97 } 98 99 public boolean equals(Object obj) { 100 return obj instanceof ServerInfo; 101 } 102 103 double getPoolEfficency() { 104 return poolEfficency; 105 } 106 107 void setPoolEfficency(double poolEfficency) { 108 this.poolEfficency = poolEfficency; 109 } 110 111 } 112 | Popular Tags |