01: /*_############################################################################
02: _##
03: _## SNMP4J-AgentX - AgentXPeer.java
04: _##
05: _## Copyright (C) 2005-2007 Frank Fock (SNMP4J.org)
06: _##
07: _## This program is free software; you can redistribute it and/or modify
08: _## it under the terms of the GNU General Public License version 2 as
09: _## 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;
26:
27: import org.snmp4j.TransportMapping;
28: import org.snmp4j.smi.Address;
29:
30: public class AgentXPeer implements Serializable {
31:
32: private TransportMapping transport;
33: private Address address;
34: private long connectionTime;
35: private int timeout;
36: private Object id;
37: private volatile boolean closing;
38:
39: public AgentXPeer(TransportMapping transport, Address address) {
40: this .transport = transport;
41: this .address = address;
42: }
43:
44: public boolean isClosing() {
45: return closing;
46: }
47:
48: public long getConnectionTime() {
49: return connectionTime;
50: }
51:
52: public Object getId() {
53: return id;
54: }
55:
56: public int getTimeout() {
57: return timeout;
58: }
59:
60: public TransportMapping getTransport() {
61: return transport;
62: }
63:
64: public Address getAddress() {
65: return address;
66: }
67:
68: public void setClosing(boolean closing) {
69: this .closing = closing;
70: }
71:
72: public void setConnectionTime(long connectionTime) {
73: this .connectionTime = connectionTime;
74: }
75:
76: public void setId(Object id) {
77: this .id = id;
78: }
79:
80: public void setTimeout(int timeout) {
81: this .timeout = timeout;
82: }
83:
84: public String toString() {
85: return getClass().getName() + "[transport=" + transport
86: + ",address=" + address + ",connectionTime="
87: + connectionTime + ",timeout=" + timeout + ",id=" + id
88: + ",closing=" + closing + "]";
89: }
90:
91: }
|