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 used TransportMapping.
All Implemented Interfaces:
Serializable

public class AgentXPeer<A extends org.snmp4j.smi.Address> extends Object implements Serializable
An AgentXPeer represents an AgentX communication peer with its network address.
See Also:
  • Constructor Details

    • AgentXPeer

      public AgentXPeer(org.snmp4j.transport.ConnectionOrientedTransportMapping<A> transport, A address)
      Creates an AgentXPeer 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 (see Date.getTime().
      Returns:
      the time when the connection has been established.
    • getId

      public Object 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

      public org.snmp4j.transport.ConnectionOrientedTransportMapping<A> getTransport()
      Get the ConnectionOrientedTransportMapping associated with this peer.
      Returns:
      the transport mapping.
    • getAddress

      public A 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 (see Date.getTime().
      Parameters:
      connectionTime - the connection time
    • setId

      public void setId(Object id)
      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

      public String toString()
      Overrides:
      toString in class Object