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
ConstructorsConstructorDescriptionAgentXPeer(org.snmp4j.transport.ConnectionOrientedTransportMapping<A> transport, A address) Creates anAgentXPeerfor a transport and peer address. -
Method Summary
Modifier and TypeMethodDescriptionGets the peer's address.longGets the connection time (seeDate.getTime().getId()Gets a unique ID associated with this peer definition.intGets total number of parse errors on this peer.intGets the message timeout in seconds.longGets the message timeout in milliseconds.org.snmp4j.transport.ConnectionOrientedTransportMapping<A> Get theConnectionOrientedTransportMappingassociated with this peer.voidIncreases the parse errors counter.booleanChecks if the peer is actually closing (i.e.voidsetClosing(boolean closing) Sets the closing status.voidsetConnectionTime(long connectionTime) Sets the connection time as long value (seeDate.getTime().voidSets the unique ID for this peer.voidsetTimeout(int timeout) Sets the message timeout in seconds.toString()
-
Constructor Details
-
AgentXPeer
Creates anAgentXPeerfor 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:
trueif 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 theConnectionOrientedTransportMappingassociated 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-trueif 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
-