KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jrobin > mrtg > server > RawSample


1 /* ============================================================
2  * JRobin : Pure java implementation of RRDTool's functionality
3  * ============================================================
4  *
5  * Project Info: http://www.jrobin.org
6  * Project Lead: Sasa Markovic (saxon@jrobin.org);
7  *
8  * (C) Copyright 2003, by Sasa Markovic.
9  *
10  * Developers: Sasa Markovic (saxon@jrobin.org)
11  * Arne Vandamme (cobralord@jrobin.org)
12  *
13  * This library is free software; you can redistribute it and/or modify it under the terms
14  * of the GNU Lesser General Public License as published by the Free Software Foundation;
15  * either version 2.1 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
18  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19  * See the GNU Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public License along with this
22  * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
23  * Boston, MA 02111-1307, USA.
24  */

25 package org.jrobin.mrtg.server;
26
27 import org.jrobin.core.Util;
28
29 class RawSample {
30     private String JavaDoc host;
31     private String JavaDoc ifDescr = "";
32     private boolean valid = true;
33     private long timestamp = Util.getTime();
34     private long ifInOctets;
35     private long ifOutOctets;
36     private long sysUpTime;
37     private int ifOperStatus;
38
39     String JavaDoc getHost() {
40         return host;
41     }
42
43     void setHost(String JavaDoc host) {
44         this.host = host;
45     }
46
47     String JavaDoc getIfDescr() {
48         return ifDescr;
49     }
50
51     void setIfDescr(String JavaDoc ifDescr) {
52         this.ifDescr = ifDescr;
53     }
54
55     boolean isValid() {
56         return valid;
57     }
58
59     void setValid(boolean valid) {
60         this.valid = valid;
61     }
62
63     long getTimestamp() {
64         return timestamp;
65     }
66
67     void setTimestamp(long timestamp) {
68         this.timestamp = timestamp;
69     }
70
71     long getIfInOctets() {
72         return ifInOctets;
73     }
74
75     void setIfInOctets(long ifInOctets) {
76         this.ifInOctets = ifInOctets;
77     }
78
79     long getIfOutOctets() {
80         return ifOutOctets;
81     }
82
83     void setIfOutOctets(long ifOutOctets) {
84         this.ifOutOctets = ifOutOctets;
85     }
86
87     long getSysUpTime() {
88         return sysUpTime;
89     }
90
91     void setSysUpTime(long sysUpTime) {
92         this.sysUpTime = sysUpTime;
93     }
94
95     int getIfOperStatus() {
96         return ifOperStatus;
97     }
98
99     void setIfOperStatus(int ifOperStatus) {
100         this.ifOperStatus = ifOperStatus;
101     }
102
103     public String JavaDoc toString() {
104         return ifDescr + "@" + host + ": timestamp=" + timestamp + " valid=" + valid +
105             " ifInOctets=" + ifInOctets + " ifOutOctets=" + ifOutOctets +
106             " sysUpTime=" + sysUpTime;
107     }
108 }
109
Popular Tags