| java.lang.Object snmp.SNMPObject snmp.SNMPSequence snmp.SNMPMessage
SNMPMessage | public class SNMPMessage extends SNMPSequence (Code) | | 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
|
Constructor Summary | |
public | SNMPMessage(int version, String community, SNMPPDU pdu) Create an SNMP message with specified version, community, and pdu. | public | SNMPMessage(int version, String community, SNMPv1TrapPDU pdu) Create an SNMP message with specified version, community, and trap pdu. | public | SNMPMessage(int version, String community, SNMPv2TrapPDU pdu) Create an SNMP message with specified version, community, and v2 trap pdu. | protected | SNMPMessage(byte[] enc) Construct an SNMPMessage from a received ASN.1 byte representation. |
Method Summary | |
public String | getCommunityName() Utility method which returns the community name contained in the SNMP message. | public SNMPPDU | getPDU() Utility method which returns the PDU contained in the SNMP message. | public Object | getPDUAsObject() Utility method which returns the PDU contained in the SNMP message as a plain Java Object. | public SNMPv1TrapPDU | getv1TrapPDU() Utility method which returns the PDU contained in the SNMP message as an SNMPv1TrapPDU. | public SNMPv2TrapPDU | getv2TrapPDU() Utility method which returns the PDU contained in the SNMP message as an SNMPv2TrapPDU. |
SNMPMessage | public SNMPMessage(int version, String community, SNMPPDU pdu)(Code) | | Create an SNMP message with specified version, community, and pdu.
Use version = 0 for SNMP version 1, or version = 1 for enhanced capapbilities
provided through RFC 1157.
|
SNMPMessage | public SNMPMessage(int version, String community, SNMPv1TrapPDU pdu)(Code) | | Create an SNMP message with specified version, community, and trap pdu.
Use version = 0 for SNMP version 1, or version = 1 for enhanced capapbilities
provided through RFC 1157.
|
SNMPMessage | public SNMPMessage(int version, String community, SNMPv2TrapPDU pdu)(Code) | | Create an SNMP message with specified version, community, and v2 trap pdu.
Use version = 1.
|
getCommunityName | public String getCommunityName() throws SNMPBadValueException(Code) | | Utility method which returns the community name contained in the SNMP message. The community name is the
second component of the sequence, after the version.
|
getPDU | public SNMPPDU getPDU() throws SNMPBadValueException(Code) | | Utility method which returns the PDU contained in the SNMP message. The pdu is the third component
of the sequence, after the version and community name.
|
getPDUAsObject | public Object getPDUAsObject() throws SNMPBadValueException(Code) | | Utility method which returns the PDU contained in the SNMP message as a plain Java Object.
The pdu is the third component of the sequence, after the version and community name.
|
getv1TrapPDU | public SNMPv1TrapPDU getv1TrapPDU() throws SNMPBadValueException(Code) | | Utility method which returns the PDU contained in the SNMP message as an SNMPv1TrapPDU. The pdu is the
third component of the sequence, after the version and community name.
|
getv2TrapPDU | public SNMPv2TrapPDU getv2TrapPDU() throws SNMPBadValueException(Code) | | Utility method which returns the PDU contained in the SNMP message as an SNMPv2TrapPDU. The pdu is the
third component of the sequence, after the version and community name.
|
|
|