|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object snmp.SNMPObject snmp.SNMPSequence snmp.SNMPMessage
Defines the SNMPMessage class as a special case of SNMPSequence. Defines a top-level SNMP message, as per the following definitions from RFC 1157 and RFC 1901. RFC1157-SNMP DEFINITIONS IMPORTS FROM RFC1155-SMI; -- top-level message Message ::= SEQUENCE { version -- version-1 for this RFC INTEGER { version-1(0) }, community -- community name OCTET STRING, data -- e.g., PDUs if trivial ANY -- authentication is being used } -- From RFC 1901: COMMUNITY-BASED-SNMPv2 DEFINITIONS ::= BEGIN -- top-level message Message ::= SEQUENCE { version INTEGER { version(1) -- modified from RFC 1157 }, community -- community name OCTET STRING, data -- PDUs as defined in [4] ANY } } END
Field Summary |
Fields inherited from class snmp.SNMPSequence |
sequence, tag |
Constructor Summary | |
protected |
SNMPMessage(byte[] enc)
Construct an SNMPMessage from a received ASN.1 byte representation. |
|
SNMPMessage(int version,
java.lang.String community,
SNMPPDU pdu)
Create an SNMP message with specified version, community, and pdu. |
|
SNMPMessage(int version,
java.lang.String community,
SNMPv1TrapPDU pdu)
Create an SNMP message with specified version, community, and trap pdu. |
|
SNMPMessage(int version,
java.lang.String community,
SNMPv2TrapPDU pdu)
Create an SNMP message with specified version, community, and v2 trap pdu. |
Method Summary | |
java.lang.String |
getCommunityName()
Utility method which returns the community name contained in the SNMP message. |
SNMPPDU |
getPDU()
Utility method which returns the PDU contained in the SNMP message. |
java.lang.Object |
getPDUAsObject()
Utility method which returns the PDU contained in the SNMP message as a plain Java Object. |
SNMPv1TrapPDU |
getv1TrapPDU()
Utility method which returns the PDU contained in the SNMP message as an SNMPv1TrapPDU. |
SNMPv2TrapPDU |
getv2TrapPDU()
Utility method which returns the PDU contained in the SNMP message as an SNMPv2TrapPDU. |
Methods inherited from class snmp.SNMPSequence |
addSNMPObject, extractFromBEREncoding, getBEREncoding, getSNMPObjectAt, getValue, insertSNMPObjectAt, setValue, size, toString |
Methods inherited from class snmp.SNMPObject |
equals, hashCode |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SNMPMessage(int version, java.lang.String community, SNMPPDU pdu)
public SNMPMessage(int version, java.lang.String community, SNMPv1TrapPDU pdu)
public SNMPMessage(int version, java.lang.String community, SNMPv2TrapPDU pdu)
protected SNMPMessage(byte[] enc) throws SNMPBadValueException
SNMPBadValueException
- Indicates invalid SNMP message encoding supplied.Method Detail |
public java.lang.Object getPDUAsObject() throws SNMPBadValueException
SNMPBadValueException
public SNMPPDU getPDU() throws SNMPBadValueException
SNMPBadValueException
public SNMPv1TrapPDU getv1TrapPDU() throws SNMPBadValueException
SNMPBadValueException
public SNMPv2TrapPDU getv2TrapPDU() throws SNMPBadValueException
SNMPBadValueException
public java.lang.String getCommunityName() throws SNMPBadValueException
SNMPBadValueException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |