📄 snmpv1agentinterface.html
字号:
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="SNMPv1AgentInterface(int)"><!-- --></A><H3>
SNMPv1AgentInterface</H3>
<PRE>
public <B>SNMPv1AgentInterface</B>(int version)
throws java.net.SocketException</PRE>
<DL>
<DD>Construct a new agent object to listen for requests from remote SNMP managers. The agent listens on the standard SNMP UDP port 161.
<P>
<DL>
<DT><B>Throws:</B>
<DD><CODE>java.net.SocketException</CODE></DL>
</DL>
<HR>
<A NAME="SNMPv1AgentInterface(int, int)"><!-- --></A><H3>
SNMPv1AgentInterface</H3>
<PRE>
public <B>SNMPv1AgentInterface</B>(int version,
int localPort)
throws java.net.SocketException</PRE>
<DL>
<DD>Construct a new agent object to listen for requests from remote SNMP managers. The agent listens on the supplied local port.
<P>
<DL>
<DT><B>Throws:</B>
<DD><CODE>java.net.SocketException</CODE></DL>
</DL>
<HR>
<A NAME="SNMPv1AgentInterface(int, java.io.PrintWriter)"><!-- --></A><H3>
SNMPv1AgentInterface</H3>
<PRE>
public <B>SNMPv1AgentInterface</B>(int version,
java.io.PrintWriter errorReceiver)
throws java.net.SocketException</PRE>
<DL>
<DD>Construct a new agent object to listen for requests from remote SNMP managers. The agent listens on the supplied port, and sends error messages to the specified PrintWriter.
<P>
<DL>
<DT><B>Throws:</B>
<DD><CODE>java.net.SocketException</CODE></DL>
</DL>
<HR>
<A NAME="SNMPv1AgentInterface(int, int, java.io.PrintWriter)"><!-- --></A><H3>
SNMPv1AgentInterface</H3>
<PRE>
public <B>SNMPv1AgentInterface</B>(int version,
int localPort,
java.io.PrintWriter errorReceiver)
throws java.net.SocketException</PRE>
<DL>
<DD>Construct a new agent object to listen for requests from remote SNMP managers. The agent listens on the supplied port, and sends error messages to the specified PrintWriter.
<P>
<DL>
<DT><B>Throws:</B>
<DD><CODE>java.net.SocketException</CODE></DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="setErrorReceiver(java.io.PrintWriter)"><!-- --></A><H3>
setErrorReceiver</H3>
<PRE>
public void <B>setErrorReceiver</B>(java.io.PrintWriter errorReceiver)</PRE>
<DL>
<DD>Set the specified PrintWriter to receive error messages.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="addRequestListener(snmp.SNMPRequestListener)"><!-- --></A><H3>
addRequestListener</H3>
<PRE>
public void <B>addRequestListener</B>(<A HREF="../snmp/SNMPRequestListener.html" title="interface in snmp">SNMPRequestListener</A> listener)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="removeRequestListener(snmp.SNMPRequestListener)"><!-- --></A><H3>
removeRequestListener</H3>
<PRE>
public void <B>removeRequestListener</B>(<A HREF="../snmp/SNMPRequestListener.html" title="interface in snmp">SNMPRequestListener</A> listener)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="startReceiving()"><!-- --></A><H3>
startReceiving</H3>
<PRE>
public void <B>startReceiving</B>()</PRE>
<DL>
<DD>Start listening for requests from remote managers.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="stopReceiving()"><!-- --></A><H3>
stopReceiving</H3>
<PRE>
public void <B>stopReceiving</B>()
throws java.net.SocketException</PRE>
<DL>
<DD>Stop listening for requests from remote managers.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.net.SocketException</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="run()"><!-- --></A><H3>
run</H3>
<PRE>
public void <B>run</B>()</PRE>
<DL>
<DD>The run() method for the agent interface's listener. Just waits for SNMP request messages to come in on port 161 (or the port supplied in the constructor), then dispatches the retrieved SNMPPDU and community name to each of the registered SNMPRequestListeners by calling their processRequest() methods.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>run</CODE> in interface <CODE>java.lang.Runnable</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setReceiveBufferSize(int)"><!-- --></A><H3>
setReceiveBufferSize</H3>
<PRE>
public void <B>setReceiveBufferSize</B>(int receiveBufferSize)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getReceiveBufferSize()"><!-- --></A><H3>
getReceiveBufferSize</H3>
<PRE>
public int <B>getReceiveBufferSize</B>()</PRE>
<DL>
<DD>Returns the current size of the buffer used to receive response packets.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SNMPv1AgentInterface.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../snmp/SNMPUnknownObject.html" title="class in snmp"><B>PREV CLASS</B></A>
<A HREF="../snmp/SNMPv1CommunicationInterface.html" title="class in snmp"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../index.html?snmp/SNMPv1AgentInterface.html" target="_top"><B>FRAMES</B></A>
<A HREF="SNMPv1AgentInterface.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -