Java Doc for SNMPv1CommunicationInterface.java in  » Net » Java-SNMP » snmp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » Java SNMP » snmp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.


Field Summary
final public static  intSNMP_PORT
    
 DatagramSocketdSocket
    
public  intrequestID
    

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.

Method Summary
public  voidcloseConnection()
     Close the "connection" with the device.
public  SNMPVarBindListgetMIBEntry(String itemID)
     Retrieve the MIB variable value corresponding to the object identifier given in itemID (in dotted-integer notation).
public  SNMPVarBindListgetMIBEntry(String[] itemID)
     Retrieve the MIB variable values corresponding to the object identifiers given in the array itemID (in dotted-integer notation).
public  SNMPVarBindListgetNextMIBEntry(String itemID)
     Retrieve the MIB variable value corresponding to the object identifier following that given in itemID (in dotted-integer notation).
public  SNMPVarBindListgetNextMIBEntry(String[] itemID)
     Retrieve the MIB variable value corresponding to the object identifiers following those given in the itemID array (in dotted-integer notation).
public  intgetReceiveBufferSize()
     Returns the current size of the buffer used to receive response packets.
public  SNMPVarBindListretrieveAllMIBInfo(String startID)
     Retrieve all MIB variable values subsequent to the starting object identifier given in startID (in dotted-integer notation).
public  SNMPVarBindListretrieveMIBTable(String baseID)
     Retrieve all MIB variable values whose OIDs start with the supplied baseID.
public  SNMPVarBindListretrieveMIBTable(String[] baseID)
     Retrieve all MIB variable values whose OIDs start with the supplied baseIDs.
public  SNMPVarBindListsetMIBEntry(String itemID, SNMPObject newValue)
     Set the MIB variable value of the object identifier given in startID (in dotted-integer notation).
public  SNMPVarBindListsetMIBEntry(String[] itemID, SNMPObject[] newValue)
     Set the MIB variable values of the supplied object identifiers given in the itemID array (in dotted-integer notation).
public  voidsetReceiveBufferSize(int receiveBufferSize)
     Set the size of the buffer used to receive response packets.
public  voidsetSocketTimeout(int socketTimeout)
     Permits setting timeout value for underlying datagram socket (in milliseconds).

Field Detail
SNMP_PORT
final public static int SNMP_PORT(Code)



dSocket
DatagramSocket dSocket(Code)



requestID
public int requestID(Code)




Constructor Detail
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).




Method Detail
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



setMIBEntry
public SNMPVarBindList setMIBEntry(String itemID, SNMPObject newValue) throws IOException, SNMPBadValueException, SNMPSetException(Code)
Set the MIB variable value of the object identifier given in startID (in dotted-integer notation). Return SNMPVarBindList object returned by device in its response; can be used to check that setting was successful. Uses SNMPGetNextRequests to retrieve variable values in sequence.
throws:
  IOException - Thrown when timeout experienced while waiting for response to request.
throws:
  SNMPBadValueException -



setMIBEntry
public SNMPVarBindList setMIBEntry(String[] itemID, SNMPObject[] newValue) throws IOException, SNMPBadValueException, SNMPSetException(Code)
Set the MIB variable values of the supplied object identifiers given in the itemID array (in dotted-integer notation). Return SNMPVarBindList returned by device in its response; can be used to check that setting was successful. Uses SNMPGetNextRequests to retrieve variable values in sequence.
throws:
  IOException - Thrown when timeout experienced while waiting for response to request.
throws:
  SNMPBadValueException -



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).



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.