Package org.snmp4j.agent.agentx
Class AgentXPeer<A extends org.snmp4j.smi.Address>
java.lang.Object
org.snmp4j.agent.agentx.AgentXPeer<A>
- Type Parameters:
A
- the address type (depends on the usedTransportMapping
.
- All Implemented Interfaces:
Serializable
An
AgentXPeer
represents an AgentX communication peer with its network address.- See Also:
-
Constructor Summary
ConstructorDescriptionAgentXPeer
(org.snmp4j.transport.ConnectionOrientedTransportMapping<A> transport, A address) Creates anAgentXPeer
for a transport and peer address. -
Method Summary
Modifier and TypeMethodDescriptionGets the peer's address.long
Gets the connection time (seeDate.getTime()
.getId()
Gets a unique ID associated with this peer definition.int
Gets total number of parse errors on this peer.int
Gets the message timeout in seconds.long
Gets the message timeout in milliseconds.org.snmp4j.transport.ConnectionOrientedTransportMapping
<A> Get theConnectionOrientedTransportMapping
associated with this peer.void
Increases the parse errors counter.boolean
Checks if the peer is actually closing (i.e.void
setClosing
(boolean closing) Sets the closing status.void
setConnectionTime
(long connectionTime) Sets the connection time as long value (seeDate.getTime()
.void
Sets the unique ID for this peer.void
setTimeout
(int timeout) Sets the message timeout in seconds.toString()
-
Constructor Details
-
AgentXPeer
Creates anAgentXPeer
for a transport and peer address.- Parameters:
transport
- the transport.address
- the address of the peer's end-point.
-
-
Method Details
-
isClosing
public boolean isClosing()Checks if the peer is actually closing (i.e. does not accept new connections).- Returns:
true
if the peer is closing its transport.
-
getConnectionTime
public long getConnectionTime()Gets the connection time (seeDate.getTime()
.- Returns:
- the time when the connection has been established.
-
getId
Gets a unique ID associated with this peer definition.- Returns:
- its ID.
-
getTimeout
public int getTimeout()Gets the message timeout in seconds.- Returns:
- message timeout in seconds.
-
getTimeoutMillis
public long getTimeoutMillis()Gets the message timeout in milliseconds.- Returns:
- message timeout in milliseconds.
- Since:
- 4.0.0
-
getTransport
Get theConnectionOrientedTransportMapping
associated with this peer.- Returns:
- the transport mapping.
-
getAddress
Gets the peer's address.- Returns:
- the transport address.
-
getParseErrors
public int getParseErrors()Gets total number of parse errors on this peer.- Returns:
- the parse errors count.
-
incParseErrors
public void incParseErrors()Increases the parse errors counter. -
setClosing
public void setClosing(boolean closing) Sets the closing status.- Parameters:
closing
-true
if the peer transport is closing.
-
setConnectionTime
public void setConnectionTime(long connectionTime) Sets the connection time as long value (seeDate.getTime()
.- Parameters:
connectionTime
- the connection time
-
setId
Sets the unique ID for this peer.- Parameters:
id
- an unique ID.
-
setTimeout
public void setTimeout(int timeout) Sets the message timeout in seconds.- Parameters:
timeout
- message timeout in seconds.
-
toString
-