KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > snmp4j > agent > agentx > AgentXPeer


1 /*_############################################################################
2   _##
3   _## SNMP4J-AgentX - AgentXPeer.java
4   _##
5   _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
6   _##
7   _## This program is free software; you can redistribute it and/or modify
8   _## it under the terms of the GNU General Public License version 2 as
9   _## published by the Free Software Foundation.
10   _##
11   _## This program is distributed in the hope that it will be useful,
12   _## but WITHOUT ANY WARRANTY; without even the implied warranty of
13   _## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14   _## GNU General Public License for more details.
15   _##
16   _## You should have received a copy of the GNU General Public License
17   _## along with this program; if not, write to the Free Software
18   _## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19   _## MA 02110-1301 USA
20   _##
21   _##########################################################################*/

22
23 package org.snmp4j.agent.agentx;
24
25 import java.io.Serializable JavaDoc;
26
27 import org.snmp4j.TransportMapping;
28 import org.snmp4j.smi.Address;
29
30 public class AgentXPeer implements Serializable JavaDoc {
31
32   private TransportMapping transport;
33   private Address address;
34   private long connectionTime;
35   private int timeout;
36   private Object JavaDoc id;
37   private volatile boolean closing;
38   private volatile int parseErrors;
39
40   public AgentXPeer(TransportMapping transport, Address address) {
41     this.transport = transport;
42     this.address = address;
43   }
44
45   public boolean isClosing() {
46     return closing;
47   }
48
49   public long getConnectionTime() {
50     return connectionTime;
51   }
52
53   public Object JavaDoc getId() {
54     return id;
55   }
56
57   public int getTimeout() {
58     return timeout;
59   }
60
61   public TransportMapping getTransport() {
62     return transport;
63   }
64
65   public Address getAddress() {
66     return address;
67   }
68
69   public int getParseErrors() {
70     return parseErrors;
71   }
72
73   public void incParseErrors() {
74     this.parseErrors++;
75   }
76
77   public void setClosing(boolean closing) {
78     this.closing = closing;
79   }
80
81   public void setConnectionTime(long connectionTime) {
82     this.connectionTime = connectionTime;
83   }
84
85   public void setId(Object JavaDoc id) {
86     this.id = id;
87   }
88
89   public void setTimeout(int timeout) {
90     this.timeout = timeout;
91   }
92
93   public String JavaDoc toString() {
94     return getClass().getName()+"[transport="+transport+",address="+address+
95         ",connectionTime="+connectionTime+",timeout="+timeout+
96         ",id="+id+",closing="+closing+",parseErrors="+parseErrors+"]";
97   }
98
99 }
100
Popular Tags