Package org.snmp4j.util
Class RetrievalEvent
java.lang.Object
java.util.EventObject
org.snmp4j.util.RetrievalEvent
- All Implemented Interfaces:
 Serializable
- Direct Known Subclasses:
 TableEvent,TreeEvent
The 
RetrievalEvent is an abstract class representing the result
 of one or more GET/GETNEXT/GETBULK requests.- Since:
 - 1.8
 - Version:
 - 1.8
 - Author:
 - Frank Fock
 - See Also:
 
- 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Exceptionprotected PDUprotected intstatic final intAn exception occurred during retrieval operation.static final intRetrieval operation was successful.static final intA report has been received from the agent.static final intA request to the agent timed out.static final intThe agent failed to return the objects in lexicographic order.protected Objectprotected VariableBinding[]Fields inherited from class java.util.EventObject
source - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRetrievalEvent(EventListener source, Object userObject) RetrievalEvent(ResponseListener source, Object userObject, VariableBinding[] variableBindings) Creates a retrieval event with row data.RetrievalEvent(org.snmp4j.util.TreeUtils.TreeRequest source, Object userObject, int status) Creates a retrieval event with a status.RetrievalEvent(org.snmp4j.util.TreeUtils.TreeRequest source, Object userObject, Exception exception) Creates a retrieval event with an exception.RetrievalEvent(org.snmp4j.util.TreeUtils.TreeRequest source, Object userObject, PDU report) Creates a retrieval event with a report PDU. - 
Method Summary
Modifier and TypeMethodDescriptionReturns a textual error message for the error.Gets the exception associated with this event.Gets the report PDU associated with this event.intGets the status of the table operation.Gets the user object that has been specified by the user when the retrieval operation that fired this event has been requested.booleanisError()Indicates whether the event reports an error or not.toString()Methods inherited from class java.util.EventObject
getSource 
- 
Field Details
- 
STATUS_OK
public static final int STATUS_OKRetrieval operation was successful.- See Also:
 
 - 
STATUS_TIMEOUT
public static final int STATUS_TIMEOUTA request to the agent timed out.- See Also:
 
 - 
STATUS_WRONG_ORDER
public static final int STATUS_WRONG_ORDERThe agent failed to return the objects in lexicographic order.- See Also:
 
 - 
STATUS_REPORT
public static final int STATUS_REPORTA report has been received from the agent.- See Also:
 
 - 
STATUS_EXCEPTION
public static final int STATUS_EXCEPTIONAn exception occurred during retrieval operation.- See Also:
 
 - 
vbs
 - 
status
protected int status - 
userObject
 - 
exception
 - 
reportPDU
 
 - 
 - 
Constructor Details
- 
RetrievalEvent
 - 
RetrievalEvent
Creates a retrieval event with a status.- Parameters:
 source- the source of the event.userObject- the user object ornull.status- one of the status constants defined for this object.
 - 
RetrievalEvent
public RetrievalEvent(org.snmp4j.util.TreeUtils.TreeRequest source, Object userObject, Exception exception) Creates a retrieval event with an exception.- Parameters:
 source- the source of the event.userObject- the user object ornull.exception- an exception instance.
 - 
RetrievalEvent
Creates a retrieval event with a report PDU.- Parameters:
 source- the source of the event.userObject- the user object ornull.report- a PDU of typePDU.REPORT.
 - 
RetrievalEvent
public RetrievalEvent(ResponseListener source, Object userObject, VariableBinding[] variableBindings) Creates a retrieval event with row data.- Parameters:
 source- the source of the event.userObject- the user object ornull.variableBindings- an array ofVariableBindinginstances.
 
 - 
 - 
Method Details
- 
getStatus
public int getStatus()Gets the status of the table operation.- Returns:
 - one of the status constants defined for this object.
    
STATUS_OKindicates success, all other values indicate failure of the operation which corresponds to a SNMP error status as defined byPDU.getErrorStatus(). 
 - 
isError
public boolean isError()Indicates whether the event reports an error or not.- Returns:
 trueif the operation failed with an error.
 - 
getUserObject
Gets the user object that has been specified by the user when the retrieval operation that fired this event has been requested.- Returns:
 - an object instance if an user object has been specified or
    
nullotherwise. 
 - 
getException
Gets the exception associated with this event.- Returns:
 - an Exception instance if there has been an exception instance
    associated with this event (
getStatus()returnsSTATUS_EXCEPTION), ornullotherwise. 
 - 
getReportPDU
Gets the report PDU associated with this event.- Returns:
 - a 
ScopedPDUinstance if there has been a report PDU instance associated with this event (getStatus()returnsSTATUS_REPORT), ornullotherwise. 
 - 
getErrorMessage
Returns a textual error message for the error.- Returns:
 - an error message or an empty string if no error occurred.
 
 - 
toString
- Overrides:
 toStringin classEventObject
 
 -