Package uk.co.westhawk.snmp.stack
Class ResponsePdu
java.lang.Object
java.util.Observable
uk.co.westhawk.snmp.stack.Pdu
uk.co.westhawk.snmp.stack.ResponsePdu
This class represents the ASN SNMP Response PDU object.
This class should be used when responding to an incoming request
via a ListeningContext. Note that you should use the port of the
RequestPduEvent (getHostPort()) when creating a SnmpContext.
This class is not used when request are sent out by the stack and a response is received. In that case the OIDs of the response are integrated into the original request PDU.
For SNMPv3: The sender of a response PDU acts as the authoritative engine.
- Since:
- 4_14
- Version:
- $Revision: 3.6 $ $Date: 2006/11/30 14:45:50 $
- Author:
- Birgit Arkesteijn
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetErrorIndex(int errorIndex) Sets the error index of this PDU.voidsetErrorStatus(int errorStatus) Sets the error status of this PDU.toString()Returns the string representation of this object.Methods inherited from class uk.co.westhawk.snmp.stack.Pdu
addOid, addOid, addOid, addOid, addOid, getContext, getErrorIndex, getErrorStatus, getErrorStatusString, getMsgType, getReqId, getRequestVarbinds, getResponseVarbinds, getRetryIntervals, isTimedOut, notifyObservers, send, send, setRetryIntervals, waitForSelfMethods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers
-
Constructor Details
-
ResponsePdu
Constructor. The requestPdu is used to copy the necessary IDs to this PDU.- Parameters:
con- The context of the PDUrequestPdu- The original Request PDU
-
-
Method Details
-
setErrorStatus
public void setErrorStatus(int errorStatus) Sets the error status of this PDU. This indicates that an exception has occurred while processing the original request.- Since:
- 5_2
- See Also:
-
SnmpConstants.SNMP_ERR_NOERRORSnmpConstants.SNMP_ERR_TOOBIGSnmpConstants.SNMP_ERR_NOSUCHNAMESnmpConstants.SNMP_ERR_BADVALUESnmpConstants.SNMP_ERR_READONLYSnmpConstants.SNMP_ERR_GENERRSnmpConstants.SNMP_ERR_NOACCESSSnmpConstants.SNMP_ERR_WRONGTYPESnmpConstants.SNMP_ERR_WRONGLENGTHSnmpConstants.SNMP_ERR_WRONGENCODINGSnmpConstants.SNMP_ERR_WRONGVALUESnmpConstants.SNMP_ERR_NOCREATIONSnmpConstants.SNMP_ERR_INCONSISTENTVALUESnmpConstants.SNMP_ERR_RESOURCEUNAVAILABLESnmpConstants.SNMP_ERR_COMMITFAILEDSnmpConstants.SNMP_ERR_UNDOFAILEDSnmpConstants.SNMP_ERR_AUTHORIZATIONERRSnmpConstants.SNMP_ERR_NOTWRITABLESnmpConstants.SNMP_ERR_INCONSISTENTNAME
-
setErrorIndex
public void setErrorIndex(int errorIndex) Sets the error index of this PDU. When the error status is not SNMP_ERR_NOERROR, it indicates the index of the variable in the varbind list that caused the exception.- Since:
- 5_2
-
toString
Returns the string representation of this object.
-