org.snmp4j.agent.agentx
Class AgentXResponseEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.snmp4j.agent.agentx.AgentXResponseEvent
All Implemented Interfaces:
java.io.Serializable

public class AgentXResponseEvent
extends java.util.EventObject

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
AgentXResponseEvent(java.lang.Object source, AgentXTarget target, org.snmp4j.smi.Address peerAddress, AgentXPDU request, AgentXResponsePDU response, java.lang.Object userObject)
          Creates an AgentXResponseEvent instance.
AgentXResponseEvent(java.lang.Object source, AgentXTarget target, org.snmp4j.smi.Address peerAddress, AgentXPDU request, AgentXResponsePDU response, java.lang.Object userObject, java.lang.Exception error)
          Creates an ResponseEvent instance with an exception object indicating a message processing error.
 
Method Summary
 java.lang.Exception getError()
          Gets the exception object from the exception that has been generated when the request processing has failed due to an error.
 org.snmp4j.smi.Address getPeerAddress()
          Gets the transport address of the response sender.
 AgentXPDU getRequest()
          Gets the request PDU.
 AgentXResponsePDU getResponse()
          Gets the response PDU.
 AgentXTarget getTarget()
           
 java.lang.Object getUserObject()
          Gets the user object that has been supplied to the asynchronous request AgentX.send(AgentXPDU pdu, AgentXTarget target, TransportMapping transport).
protected  void setPeerAddress(org.snmp4j.smi.Address peerAddress)
           
protected  void setRequest(AgentXPDU request)
           
protected  void setResponse(AgentXResponsePDU response)
           
protected  void setUserObject(java.lang.Object userObject)
           
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentXResponseEvent

public AgentXResponseEvent(java.lang.Object source,
                           AgentXTarget target,
                           org.snmp4j.smi.Address peerAddress,
                           AgentXPDU request,
                           AgentXResponsePDU response,
                           java.lang.Object userObject)
Creates an AgentXResponseEvent instance.

Parameters:
source - the event source.
target - the target where the request has been sent to.
peerAddress - the transport address of the entity that send the response.
request - the request AgentXPDU (must not be null).
response - the AgentXResponsePDU or null if the request timed out.
userObject - an optional user object.

AgentXResponseEvent

public AgentXResponseEvent(java.lang.Object source,
                           AgentXTarget target,
                           org.snmp4j.smi.Address peerAddress,
                           AgentXPDU request,
                           AgentXResponsePDU response,
                           java.lang.Object userObject,
                           java.lang.Exception error)
Creates an ResponseEvent instance with an exception object indicating a message processing error.

Parameters:
source - the event source.
target - the target where the request has been sent to.
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.
Method Detail

getRequest

public AgentXPDU getRequest()
Gets the request PDU.

Returns:
a PDU.

setPeerAddress

protected final void setPeerAddress(org.snmp4j.smi.Address peerAddress)

setRequest

protected final void setRequest(AgentXPDU request)

setResponse

protected final void setResponse(AgentXResponsePDU response)

getResponse

public AgentXResponsePDU getResponse()
Gets the response PDU.

Returns:
a PDU instance if a response has been received. If the request timed out then null will be returned.

setUserObject

protected final void setUserObject(java.lang.Object userObject)

getUserObject

public java.lang.Object getUserObject()
Gets the user object that has been supplied to the asynchronous request AgentX.send(AgentXPDU pdu, AgentXTarget target, TransportMapping transport).

Returns:
an Object.

getError

public java.lang.Exception getError()
Gets the exception object from the exception that has been generated when the request processing has failed due to an error.

Returns:
an Exception instance.

getPeerAddress

public org.snmp4j.smi.Address getPeerAddress()
Gets the transport address of the response sender.

Returns:
the transport Address of the command responder that send this response, or null if no response has been received within the time-out interval or if an error occured (see getError()).

getTarget

public AgentXTarget getTarget()

Copyright 2005-2011 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.