|
MySnmpCrawler API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--org.opennms.protocols.snmp.SnmpPduPacket
|
+--org.opennms.protocols.snmp.SnmpPduRequest
|
+--snmp.message.pdu.SnmpPdu
The SnmpPdu class contains ASN.1 common constructs such as: RequestID, ErrorStatus, ErrorIndex, and VariableBindList. The class extends from "org.opennms.protocols.snmp.SnmpPduRequest" to obtain the list of bind variables. Each bind variable is presented by the SnmpVariable class.
| Field Summary |
| Fields inherited from class org.opennms.protocols.snmp.SnmpPduPacket |
ErrAuthorizationError, ErrBadValue, ErrCommitFailed, ErrGenError, ErrInconsistentName, ErrInconsistentValue, ErrNoAccess, ErrNoCreation, ErrNoError, ErrNoSuchName, ErrNotWritable, ErrReadOnly, ErrResourceUnavailable, ErrTooBig, ErrUndoFailed, ErrWrongEncoding, ErrWrongLength, ErrWrongType, ErrWrongValue, GET, GETBULK, GETNEXT, INFORM, m_errIndex, m_errStatus, REPORT, RESPONSE, SET, V2TRAP |
| Constructor Summary | |
SnmpPdu()
The default Constructor. |
|
SnmpPdu(int command)
Constructs the SnmpPdu object with the PDU command. |
|
SnmpPdu(int command,
SnmpVariable[] vars)
Constructs the SnmpPdu object with the PDU command and the variable bind list. |
|
SnmpPdu(SnmpPdu second)
The copy Constructor constructs the SnmpPdu object that is identical to the passed object. |
|
| Method Summary | |
void |
addSnmpVariable(SnmpVariable var)
Adds the SnmpVariable object to the end of the bind list. |
int |
decode(byte[] buf,
int offset,
org.opennms.protocols.snmp.asn1.BerEncoder encoder)
Decodes the protocol data unit from the passed buffer. |
int |
encode(byte[] buf,
int offset,
org.opennms.protocols.snmp.asn1.BerEncoder encoder)
Encodes the protocol data unit using the passed encoder and stores the results in the passed buffer. |
int |
getErrorIndex()
Gets the ErrorIndex in the PDU. |
int |
getErrorStatus()
Gets the ErrorStatus in the PDU. |
int |
getRequestID()
Gets the RequestID in the PUD. |
SnmpVariable |
getSnmpVariableAt(int index)
Gets the SnmpVariable object at the specific index. |
void |
setErrorIndex(int errorIndex)
Sets the ErrorIndex in the PDU. |
void |
setErrorStatus(int errorStatus)
Sets the ErrorStatus in the PDU. |
void |
setGetNextRequestPdu()
Sets the PDU command as "GETNEXT". |
void |
setGetRequestPdu()
Sets the PDU command as "GET". |
void |
setGetResponsePdu()
Sets the PDU command as "RESPONSE". |
void |
setRequestID(int requestID)
Sets the RequestID in the PUD. |
void |
setSetRequestPdu()
Sets the PDU command as "SET". |
void |
setSnmpVariableAt(int index,
SnmpVariable var)
Sets the SnmpVariable object at the specific index. |
java.lang.String |
toString()
Gets the string representation of the SnmpPdu object. |
| Methods inherited from class org.opennms.protocols.snmp.SnmpPduRequest |
clone, duplicate, fix |
| Methods inherited from class org.opennms.protocols.snmp.SnmpPduPacket |
addVarBind, addVarBindAt, decodeASN, encodeASN, getCommand, getLength, getRequestId, getVarBindAt, nextSequence, removeVarBindAt, setCommand, setRequestId, setVarBindAt, toVarBindArray, typeId |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public SnmpPdu()
public SnmpPdu(SnmpPdu second)
second - The object to be copied from.public SnmpPdu(int command)
command - The PDU command.
public SnmpPdu(int command,
SnmpVariable[] vars)
command - The PDU command.vars - The variable bind list.| Method Detail |
public int getRequestID()
public void setRequestID(int requestID)
requestID - The RequestID in the PUD.public int getErrorStatus()
getErrorStatus in class org.opennms.protocols.snmp.SnmpPduRequestpublic void setErrorStatus(int errorStatus)
setErrorStatus in class org.opennms.protocols.snmp.SnmpPduRequesterrorStatus - The error status.public int getErrorIndex()
getErrorIndex in class org.opennms.protocols.snmp.SnmpPduRequestpublic void setErrorIndex(int errorIndex)
setErrorIndex in class org.opennms.protocols.snmp.SnmpPduRequesterrorIndex - The error index number.public SnmpVariable getSnmpVariableAt(int index)
index - The index number.
public void setSnmpVariableAt(int index,
SnmpVariable var)
index - The index number.var - The SnmpVariable object.public void addSnmpVariable(SnmpVariable var)
var - The SnmpVariable object.public void setGetRequestPdu()
public void setGetNextRequestPdu()
public void setSetRequestPdu()
public void setGetResponsePdu()
public int decode(byte[] buf,
int offset,
org.opennms.protocols.snmp.asn1.BerEncoder encoder)
throws org.opennms.protocols.snmp.SnmpPduEncodingException,
org.opennms.protocols.snmp.asn1.AsnDecodingException
buf - The encode bufferoffset - The offset byte to begin decodingencoder - The decoder object.
org.opennms.protocols.snmp.asn1.AsnDecodingException - Thrown by the encoder if an error
occurs trying to decode the data buffer.
org.opennms.protocols.snmp.SnmpPduEncodingException
public int encode(byte[] buf,
int offset,
org.opennms.protocols.snmp.asn1.BerEncoder encoder)
throws org.opennms.protocols.snmp.SnmpPduEncodingException,
org.opennms.protocols.snmp.asn1.AsnEncodingException
buf - The buffer to write the encoded information.offset - The offset to start writing informationencoder - The encoder object.
org.opennms.protocols.snmp.asn1.AsnEncodingException - Thrown if the encoder finds an error in the
buffer.
org.opennms.protocols.snmp.SnmpPduEncodingExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
MySnmpCrawler API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||