1 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 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 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 id) { 86 this.id = id; 87 } 88 89 public void setTimeout(int timeout) { 90 this.timeout = timeout; 91 } 92 93 public String 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 |