- java.lang.Object
-
- java.util.EventObject
-
- org.snmp4j.util.RetrievalEvent
-
- org.snmp4j.util.TableEvent
-
- All Implemented Interfaces:
Serializable
public class TableEvent extends RetrievalEvent
TheTableEvent
class reports events in a table retrieval operation.- Since:
- 1.0.2
- Version:
- 1.8
- Author:
- Frank Fock
- See Also:
TableUtils
, Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
Fields inherited from class org.snmp4j.util.RetrievalEvent
exception, reportPDU, status, STATUS_EXCEPTION, STATUS_OK, STATUS_REPORT, STATUS_TIMEOUT, STATUS_WRONG_ORDER, userObject, vbs
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TableEvent(TableUtils.TableRequest source, Object userObject)
TableEvent(TableUtils.TableRequest source, Object userObject, int status)
Creates a table event with a status.TableEvent(TableUtils.TableRequest source, Object userObject, Exception exception)
Creates a table event with an exception.TableEvent(TableUtils.TableRequest source, Object userObject, PDU report)
Creates a table event with a report PDU.TableEvent(TableUtils.TableRequest source, Object userObject, OID index, VariableBinding[] cols)
Creates a table event with row data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VariableBinding[]
getColumns()
Gets the columnar objects of the row.OID
getIndex()
Gets the row index OID.String
toString()
-
Methods inherited from class java.util.EventObject
getSource
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from class org.snmp4j.util.RetrievalEvent
getErrorMessage, getException, getReportPDU, getStatus, getUserObject, isError
-
-
-
-
Constructor Detail
-
TableEvent
protected TableEvent(TableUtils.TableRequest source, Object userObject)
-
TableEvent
public TableEvent(TableUtils.TableRequest source, Object userObject, int status)
Creates a table 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.
-
TableEvent
public TableEvent(TableUtils.TableRequest source, Object userObject, Exception exception)
Creates a table event with an exception.- Parameters:
source
- the source of the event.userObject
- the user object ornull
.exception
- an exception instance.
-
TableEvent
public TableEvent(TableUtils.TableRequest source, Object userObject, PDU report)
Creates a table event with a report PDU.- Parameters:
source
- the source of the event.userObject
- the user object ornull
.report
- a PDU of typePDU.REPORT
.
-
TableEvent
public TableEvent(TableUtils.TableRequest source, Object userObject, OID index, VariableBinding[] cols)
Creates a table event with row data.- Parameters:
source
- the source of the event.userObject
- the user object ornull
.index
- the index OID of the row.cols
- an array ofVariableBinding
instances containing the elements of the row. The array may containnull
elements which indicates that the agent does not return an instance for that column and row index. If an element is notnull
, then theOID
of the variable binding contains the full instanceOID
(i.e., table OID + column ID + row index) of the variable.
-
-
Method Detail
-
getIndex
public OID getIndex()
Gets the row index OID.- Returns:
- the row's index OID or
null
ifRetrievalEvent.isError()
returnstrue
.
-
getColumns
public VariableBinding[] getColumns()
Gets the columnar objects of the row.- Returns:
- an array of
VariableBinding
instances containing the elements of the row. The array may containnull
elements which indicates that the agent does not return an instance for that column and row index. If an element is notnull
, then theOID
of the variable binding contains the full instanceOID
of the variable.If
RetrievalEvent.isError()
returnstrue
,null
will be returned.
-
toString
public String toString()
- Overrides:
toString
in classRetrievalEvent
-
-