Module org.snmp4j

Interface ResponseEventFactory

Type Parameters:
A -

public interface ResponseEventFactory
The ResponseFactory can be implemented to create ResponseEvents on behalf of an Snmp instance. Although there is a default implementation, a custom one could add some special logging or response time monitoring.
Since:
3.7.5
  • Method Summary

    Modifier and Type
    Method
    Description
    default <A extends Address>
    ResponseEvent<A>
    createResponseEvent(Object source, A peerAddress, PDU request, PDU response, Object userObject, long durationNanos, Exception error)
    Creates an ResponseEvent instance with an exception object indicating a message processing error.
  • Method Details

    • createResponseEvent

      default <A extends Address> ResponseEvent<A> createResponseEvent(Object source, A peerAddress, PDU request, PDU response, Object userObject, long durationNanos, Exception error)
      Creates an ResponseEvent instance with an exception object indicating a message processing error. The default implementation calls
      invalid reference
      ResponseEvent#ResponseEvent(Object, Address, PDU, PDU, Object, Exception)
      to create a ResponseEvent new instance with the provided parameters.
      Parameters:
      source - the event source.
      peerAddress - the transport address of the entity that send the response.
      request - the request PDU (must not be null).
      response - the response PDU or null if the request timed out.
      userObject - an optional user object.
      error - an Exception or null if no error occurred.