| java.lang.Object snmp.SNMPv1CommunicationInterface
SNMPv1CommunicationInterface | public class SNMPv1CommunicationInterface (Code) | | The class SNMPv1CommunicationInterface defines methods for communicating with SNMP entities.
The approach is that from version 1 of SNMP, using no encryption of data. Communication occurs
via UDP, using port 161, the standard SNMP port, unless an alternate (non-standard) port is
supplied in the constructor.
|
Constructor Summary | |
public | SNMPv1CommunicationInterface(int version, InetAddress hostAddress, String community) Construct a new communication object to communicate with the specified host using the
given community name. | public | SNMPv1CommunicationInterface(int version, InetAddress hostAddress, String community, int remotePort) Construct a new communication object to communicate with the specified host using the
given community name, and sending requests to the specified port. |
SNMP_PORT | final public static int SNMP_PORT(Code) | | |
requestID | public int requestID(Code) | | |
SNMPv1CommunicationInterface | public SNMPv1CommunicationInterface(int version, InetAddress hostAddress, String community) throws SocketException(Code) | | Construct a new communication object to communicate with the specified host using the
given community name. The version setting should be either 0 (version 1) or 1 (version 2,
a la RFC 1157).
|
SNMPv1CommunicationInterface | public SNMPv1CommunicationInterface(int version, InetAddress hostAddress, String community, int remotePort) throws SocketException(Code) | | Construct a new communication object to communicate with the specified host using the
given community name, and sending requests to the specified port. The version setting
should be either 0 (version 1) or 1 (version 2, a la RFC 1157).
|
closeConnection | public void closeConnection() throws SocketException(Code) | | Close the "connection" with the device.
|
getMIBEntry | public SNMPVarBindList getMIBEntry(String itemID) throws IOException, SNMPBadValueException, SNMPGetException(Code) | | Retrieve the MIB variable value corresponding to the object identifier
given in itemID (in dotted-integer notation). Return as SNMPVarBindList object; if no
such variable (either due to device not supporting it, or community name having incorrect
access privilege), SNMPGetException thrown
throws: IOException - Thrown when timeout experienced while waiting for response to request. throws: SNMPBadValueException - throws: SNMPGetException - Thrown if supplied OID has value that can't be retrieved |
getMIBEntry | public SNMPVarBindList getMIBEntry(String[] itemID) throws IOException, SNMPBadValueException, SNMPGetException(Code) | | Retrieve the MIB variable values corresponding to the object identifiers
given in the array itemID (in dotted-integer notation). Return as SNMPVarBindList object;
if no such variable (either due to device not supporting it, or community name having incorrect
access privilege), SNMPGetException thrown
throws: IOException - Thrown when timeout experienced while waiting for response to request. throws: SNMPBadValueException - throws: SNMPGetException - Thrown if one of supplied OIDs has value that can't be retrieved |
getNextMIBEntry | public SNMPVarBindList getNextMIBEntry(String itemID) throws IOException, SNMPBadValueException, SNMPGetException(Code) | | Retrieve the MIB variable value corresponding to the object identifier following that
given in itemID (in dotted-integer notation). Return as SNMPVarBindList object; if no
such variable (either due to device not supporting it, or community name having incorrect
access privilege), variable value will be SNMPNull object
throws: IOException - Thrown when timeout experienced while waiting for response to request. throws: SNMPBadValueException - throws: SNMPGetException - Thrown if one the OID following the supplied OID has value that can't be retrieved |
getNextMIBEntry | public SNMPVarBindList getNextMIBEntry(String[] itemID) throws IOException, SNMPBadValueException, SNMPGetException(Code) | | Retrieve the MIB variable value corresponding to the object identifiers following those
given in the itemID array (in dotted-integer notation). Return as SNMPVarBindList object;
if no such variable (either due to device not supporting it, or community name having
incorrect access privilege), SNMPGetException thrown
throws: IOException - Thrown when timeout experienced while waiting for response to request. throws: SNMPBadValueException - throws: SNMPGetException - Thrown if OID following one of supplied OIDs has value that can't be retrieved |
getReceiveBufferSize | public int getReceiveBufferSize()(Code) | | Returns the current size of the buffer used to receive response packets.
|
retrieveAllMIBInfo | public SNMPVarBindList retrieveAllMIBInfo(String startID) throws IOException, SNMPBadValueException(Code) | | Retrieve all MIB variable values subsequent to the starting object identifier
given in startID (in dotted-integer notation). Return as SNMPVarBindList object.
Uses SNMPGetNextRequests to retrieve variable values in sequence.
throws: IOException - Thrown when timeout experienced while waiting for response to request. throws: SNMPBadValueException - |
retrieveMIBTable | public SNMPVarBindList retrieveMIBTable(String baseID) throws IOException, SNMPBadValueException, SNMPGetException(Code) | | Retrieve all MIB variable values whose OIDs start with the supplied baseID. Since the entries of
an SNMP table have the form .., this will retrieve all of the table
data as an SNMPVarBindList object consisting of sequence of SNMPVariablePairs.
Uses SNMPGetNextRequests to retrieve variable values in sequence.
throws: IOException - Thrown when timeout experienced while waiting for response to request. throws: SNMPBadValueException - |
retrieveMIBTable | public SNMPVarBindList retrieveMIBTable(String[] baseID) throws IOException, SNMPBadValueException, SNMPGetException(Code) | | Retrieve all MIB variable values whose OIDs start with the supplied baseIDs. The normal way for
this to be used is for the base OID array to consist of the base OIDs of the columns of a table.
This method will then retrieve all of the entries of the table corresponding to these columns, one
row at a time (i.e., the entries for each row will be retrieved in a single SNMP request). This
will retrieve the table data as an SNMPVarBindList object consisting of sequence of SNMPVariablePairs,
with the entries for each row grouped together. This may provide a more convenient arrangement of
the table data than the simpler retrieveMIBTable method taking a single OID as argument; in addition,
it's more efficient, requiring one SNMP request per row rather than one request per entry.
Uses SNMPGetNextRequests to retrieve variable values for each row in sequence.
throws: IOException - Thrown when timeout experienced while waiting for response to request. throws: SNMPBadValueException - throws: SNMPGetException - Thrown if incomplete row retrieved |
setReceiveBufferSize | public void setReceiveBufferSize(int receiveBufferSize)(Code) | | Set the size of the buffer used to receive response packets. RFC 1157 stipulates that an SNMP
implementation must be able to receive packets of at least 484 bytes, so if you try to set the
size to a value less than this, the receive buffer size will be set to 484 bytes. In addition,
the maximum size of a UDP packet payload is 65535 bytes, so setting the buffer to a larger size
will just waste memory. The default value is 512 bytes. The value may need to be increased if
get-requests are issued for multiple OIDs.
|
setSocketTimeout | public void setSocketTimeout(int socketTimeout) throws SocketException(Code) | | Permits setting timeout value for underlying datagram socket (in milliseconds).
|
|
|