public abstract class RetrievalEvent extends EventObject
RetrievalEvent
is an abstract class representing the result
of one or more GET/GETNEXT/GETBULK requests.Modifier and Type | Field and Description |
---|---|
protected Exception |
exception |
protected PDU |
reportPDU |
protected int |
status |
static int |
STATUS_EXCEPTION
An exception occurred during retrieval operation.
|
static int |
STATUS_OK
Retrieval operation was successful.
|
static int |
STATUS_REPORT
A report has been received from the agent.
|
static int |
STATUS_TIMEOUT
A request to the agent timed out.
|
static int |
STATUS_WRONG_ORDER
The agent failed to return the objects in lexicographic order.
|
protected Object |
userObject |
protected VariableBinding[] |
vbs |
source
Modifier | Constructor and Description |
---|---|
protected |
RetrievalEvent(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,
Exception exception)
Creates a retrieval event with an exception.
|
|
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,
PDU report)
Creates a retrieval event with a report PDU.
|
Modifier and Type | Method and Description |
---|---|
String |
getErrorMessage()
Returns a textual error message for the error.
|
Exception |
getException()
Gets the exception associated with this event.
|
PDU |
getReportPDU()
Gets the report PDU associated with this event.
|
int |
getStatus()
Gets the status of the table operation.
|
Object |
getUserObject()
Gets the user object that has been specified by the user when the retrieval
operation that fired this event has been requested.
|
boolean |
isError()
Indicates whether the event reports an error or not.
|
String |
toString() |
getSource
public static final int STATUS_OK
public static final int STATUS_TIMEOUT
public static final int STATUS_WRONG_ORDER
public static final int STATUS_REPORT
getReportPDU()
,
Constant Field Valuespublic static final int STATUS_EXCEPTION
getException()
,
Constant Field Valuesprotected VariableBinding[] vbs
protected int status
protected Object userObject
protected Exception exception
protected PDU reportPDU
protected RetrievalEvent(EventListener source, Object userObject)
public RetrievalEvent(org.snmp4j.util.TreeUtils.TreeRequest source, Object userObject, int status)
source
- the source of the event.userObject
- the user object or null
.status
- one of the status constants defined for this object.public RetrievalEvent(org.snmp4j.util.TreeUtils.TreeRequest source, Object userObject, Exception exception)
source
- the source of the event.userObject
- the user object or null
.exception
- an exception instance.public RetrievalEvent(org.snmp4j.util.TreeUtils.TreeRequest source, Object userObject, PDU report)
source
- the source of the event.userObject
- the user object or null
.report
- a PDU of type PDU.REPORT
.public RetrievalEvent(ResponseListener source, Object userObject, VariableBinding[] variableBindings)
source
- the source of the event.userObject
- the user object or null
.variableBindings
- an array of VariableBinding
instances.public int getStatus()
STATUS_OK
indicates success, all other values indicate
failure of the operation which corresponds to a SNMP error status
as defined by PDU.getErrorStatus()
.public boolean isError()
true
if the operation failed with an error.public Object getUserObject()
null
otherwise.public Exception getException()
getStatus()
returns
STATUS_EXCEPTION
), or null
otherwise.public PDU getReportPDU()
ScopedPDU
instance if there has been a report PDU
instance associated with this event (getStatus()
returns
STATUS_REPORT
), or null
otherwise.public String getErrorMessage()
public String toString()
toString
in class EventObject
Copyright © 2024 SNMP4J.org. All rights reserved.