xmppconnection.html
来自「开源项目smack的API文件」· HTML 代码 · 共 1,263 行 · 第 1/5 页
HTML
1,263 行
<A NAME="addPacketWriterInterceptor(org.jivesoftware.smack.PacketInterceptor, org.jivesoftware.smack.filter.PacketFilter)"><!-- --></A><H3>addPacketWriterInterceptor</H3><PRE>public void <B>addPacketWriterInterceptor</B>(<A HREF="../../../org/jivesoftware/smack/PacketInterceptor.html" title="interface in org.jivesoftware.smack">PacketInterceptor</A> packetInterceptor, <A HREF="../../../org/jivesoftware/smack/filter/PacketFilter.html" title="interface in org.jivesoftware.smack.filter">PacketFilter</A> packetFilter)</PRE><DL><DD>Registers a packet interceptor with this connection. The interceptor will be invoked every time a packet is about to be sent by this connection. Interceptors may modify the packet to be sent. A packet filter determines which packets will be delivered to the interceptor.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>packetInterceptor</CODE> - the packet interceptor to notify of packets about to be sent.<DD><CODE>packetFilter</CODE> - the packet filter to use.</DL></DD></DL><HR><A NAME="removePacketWriterInterceptor(org.jivesoftware.smack.PacketInterceptor)"><!-- --></A><H3>removePacketWriterInterceptor</H3><PRE>public void <B>removePacketWriterInterceptor</B>(<A HREF="../../../org/jivesoftware/smack/PacketInterceptor.html" title="interface in org.jivesoftware.smack">PacketInterceptor</A> packetInterceptor)</PRE><DL><DD>Removes a packet interceptor.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>packetInterceptor</CODE> - the packet interceptor to remove.</DL></DD></DL><HR><A NAME="createPacketCollector(org.jivesoftware.smack.filter.PacketFilter)"><!-- --></A><H3>createPacketCollector</H3><PRE>public <A HREF="../../../org/jivesoftware/smack/PacketCollector.html" title="class in org.jivesoftware.smack">PacketCollector</A> <B>createPacketCollector</B>(<A HREF="../../../org/jivesoftware/smack/filter/PacketFilter.html" title="interface in org.jivesoftware.smack.filter">PacketFilter</A> packetFilter)</PRE><DL><DD>Creates a new packet collector for this connection. A packet filter determines which packets will be accumulated by the collector.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>packetFilter</CODE> - the packet filter to use.<DT><B>Returns:</B><DD>a new packet collector.</DL></DD></DL><HR><A NAME="addConnectionListener(org.jivesoftware.smack.ConnectionListener)"><!-- --></A><H3>addConnectionListener</H3><PRE>public void <B>addConnectionListener</B>(<A HREF="../../../org/jivesoftware/smack/ConnectionListener.html" title="interface in org.jivesoftware.smack">ConnectionListener</A> connectionListener)</PRE><DL><DD>Adds a connection listener to this connection that will be notified when the connection closes or fails. The connection needs to already be connected or otherwise an IllegalStateException will be thrown.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>connectionListener</CODE> - a connection listener.</DL></DD></DL><HR><A NAME="removeConnectionListener(org.jivesoftware.smack.ConnectionListener)"><!-- --></A><H3>removeConnectionListener</H3><PRE>public void <B>removeConnectionListener</B>(<A HREF="../../../org/jivesoftware/smack/ConnectionListener.html" title="interface in org.jivesoftware.smack">ConnectionListener</A> connectionListener)</PRE><DL><DD>Removes a connection listener from this connection.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>connectionListener</CODE> - a connection listener.</DL></DD></DL><HR><A NAME="addConnectionCreationListener(org.jivesoftware.smack.ConnectionCreationListener)"><!-- --></A><H3>addConnectionCreationListener</H3><PRE>public static void <B>addConnectionCreationListener</B>(<A HREF="../../../org/jivesoftware/smack/ConnectionCreationListener.html" title="interface in org.jivesoftware.smack">ConnectionCreationListener</A> connectionCreationListener)</PRE><DL><DD>Adds a new listener that will be notified when new XMPPConnections are created. Note that newly created connections will not be actually connected to the server.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>connectionCreationListener</CODE> - a listener interested on new connections.</DL></DD></DL><HR><A NAME="removeConnectionCreationListener(org.jivesoftware.smack.ConnectionCreationListener)"><!-- --></A><H3>removeConnectionCreationListener</H3><PRE>public static void <B>removeConnectionCreationListener</B>(<A HREF="../../../org/jivesoftware/smack/ConnectionCreationListener.html" title="interface in org.jivesoftware.smack">ConnectionCreationListener</A> connectionCreationListener)</PRE><DL><DD>Removes a listener that was interested in connection creation events.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>connectionCreationListener</CODE> - a listener interested on new connections.</DL></DD></DL><HR><A NAME="isUsingTLS()"><!-- --></A><H3>isUsingTLS</H3><PRE>public boolean <B>isUsingTLS</B>()</PRE><DL><DD>Returns true if the connection to the server has successfully negotiated TLS. Once TLS has been negotiatied the connection has been secured.<P><DD><DL><DT><B>Returns:</B><DD>true if the connection to the server has successfully negotiated TLS.</DL></DD></DL><HR><A NAME="getSASLAuthentication()"><!-- --></A><H3>getSASLAuthentication</H3><PRE>public <A HREF="../../../org/jivesoftware/smack/SASLAuthentication.html" title="class in org.jivesoftware.smack">SASLAuthentication</A> <B>getSASLAuthentication</B>()</PRE><DL><DD>Returns the SASLAuthentication manager that is responsible for authenticating with the server.<P><DD><DL><DT><B>Returns:</B><DD>the SASLAuthentication manager that is responsible for authenticating with the server.</DL></DD></DL><HR><A NAME="getConfiguration()"><!-- --></A><H3>getConfiguration</H3><PRE>protected <A HREF="../../../org/jivesoftware/smack/ConnectionConfiguration.html" title="class in org.jivesoftware.smack">ConnectionConfiguration</A> <B>getConfiguration</B>()</PRE><DL><DD>Returns the configuration used to connect to the server.<P><DD><DL><DT><B>Returns:</B><DD>the configuration used to connect to the server.</DL></DD></DL><HR><A NAME="isUsingCompression()"><!-- --></A><H3>isUsingCompression</H3><PRE>public boolean <B>isUsingCompression</B>()</PRE><DL><DD>Returns true if network traffic is being compressed. When using stream compression network traffic can be reduced up to 90%. Therefore, stream compression is ideal when using a slow speed network connection. However, the server will need to use more CPU time in order to un/compress network data so under high load the server performance might be affected.<p> <p/> Note: to use stream compression the smackx.jar file has to be present in the classpath.<P><DD><DL><DT><B>Returns:</B><DD>true if network traffic is being compressed.</DL></DD></DL><HR><A NAME="connect()"><!-- --></A><H3>connect</H3><PRE>public void <B>connect</B>() throws <A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></PRE><DL><DD>Establishes a connection to the XMPP server and performs an automatic login only if the previous connection state was logged (authenticated). It basically creates and maintains a socket connection to the server.<p> <p/> Listeners will be preserved from a previous connection if the reconnection occurs after an abrupt termination.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></CODE> - if an error occurs while trying to establish the connection. Two possible errors can occur which will be wrapped by an XMPPException -- UnknownHostException (XMPP error code 504), and IOException (XMPP error code 502). The error codes and wrapped exceptions can be used to present more appropiate error messages to end-users.</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="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-all.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><b>Smack</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/jivesoftware/smack/SmackConfiguration.html" title="class in org.jivesoftware.smack"><B>PREV CLASS</B></A> <A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/jivesoftware/smack/XMPPConnection.html" target="_top"><B>FRAMES</B></A> <A HREF="XMPPConnection.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><i>Copyright © 2003-2007 Jive Software. </i></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?