📄 connection.html
字号:
<DT><B>Returns:</B><DD>the minor XMPP version being used by this connection.</DL></DD></DL><HR><A NAME="setXMPPVersion(int, int)"><!-- --></A><H3>setXMPPVersion</H3><PRE>void <B>setXMPPVersion</B>(int majorVersion, int minorVersion)</PRE><DL><DD>Sets the XMPP version information. In most cases, the version should be "1.0". However, older clients using the "Jabber" protocol do not set a version. In that case, the version is "0.0".<P><DD><DL><DT><B>Parameters:</B><DD><CODE>majorVersion</CODE> - the major version.<DD><CODE>minorVersion</CODE> - the minor version.</DL></DD></DL><HR><A NAME="getLanguage()"><!-- --></A><H3>getLanguage</H3><PRE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getLanguage</B>()</PRE><DL><DD>Returns the language code that should be used for this connection (e.g. "en").<P><DD><DL><DT><B>Returns:</B><DD>the language code for the connection.</DL></DD></DL><HR><A NAME="setLanaguage(java.lang.String)"><!-- --></A><H3>setLanaguage</H3><PRE>void <B>setLanaguage</B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> language)</PRE><DL><DD>Sets the language code that should be used for this connection (e.g. "en").<P><DD><DL><DT><B>Parameters:</B><DD><CODE>language</CODE> - the language code.</DL></DD></DL><HR><A NAME="isCompressed()"><!-- --></A><H3>isCompressed</H3><PRE>boolean <B>isCompressed</B>()</PRE><DL><DD>Returns true if the connection is using compression.<P><DD><DL><DT><B>Returns:</B><DD>true if the connection is using compression.</DL></DD></DL><HR><A NAME="getCompressionPolicy()"><!-- --></A><H3>getCompressionPolicy</H3><PRE><A HREF="../../../org/jivesoftware/openfire/Connection.CompressionPolicy.html" title="enum in org.jivesoftware.openfire">Connection.CompressionPolicy</A> <B>getCompressionPolicy</B>()</PRE><DL><DD>Returns whether compression is optional or is disabled.<P><DD><DL><DT><B>Returns:</B><DD>whether compression is optional or is disabled.</DL></DD></DL><HR><A NAME="setCompressionPolicy(org.jivesoftware.openfire.Connection.CompressionPolicy)"><!-- --></A><H3>setCompressionPolicy</H3><PRE>void <B>setCompressionPolicy</B>(<A HREF="../../../org/jivesoftware/openfire/Connection.CompressionPolicy.html" title="enum in org.jivesoftware.openfire">Connection.CompressionPolicy</A> compressionPolicy)</PRE><DL><DD>Sets whether compression is enabled or is disabled.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>compressionPolicy</CODE> - whether Compression is enabled or is disabled.</DL></DD></DL><HR><A NAME="getTlsPolicy()"><!-- --></A><H3>getTlsPolicy</H3><PRE><A HREF="../../../org/jivesoftware/openfire/Connection.TLSPolicy.html" title="enum in org.jivesoftware.openfire">Connection.TLSPolicy</A> <B>getTlsPolicy</B>()</PRE><DL><DD>Returns whether TLS is mandatory, optional or is disabled. When TLS is mandatory clients are required to secure their connections or otherwise their connections will be closed. On the other hand, when TLS is disabled clients are not allowed to secure their connections using TLS. Their connections will be closed if they try to secure the connection. in this last case.<P><DD><DL><DT><B>Returns:</B><DD>whether TLS is mandatory, optional or is disabled.</DL></DD></DL><HR><A NAME="setTlsPolicy(org.jivesoftware.openfire.Connection.TLSPolicy)"><!-- --></A><H3>setTlsPolicy</H3><PRE>void <B>setTlsPolicy</B>(<A HREF="../../../org/jivesoftware/openfire/Connection.TLSPolicy.html" title="enum in org.jivesoftware.openfire">Connection.TLSPolicy</A> tlsPolicy)</PRE><DL><DD>Sets whether TLS is mandatory, optional or is disabled. When TLS is mandatory clients are required to secure their connections or otherwise their connections will be closed. On the other hand, when TLS is disabled clients are not allowed to secure their connections using TLS. Their connections will be closed if they try to secure the connection. in this last case.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>tlsPolicy</CODE> - whether TLS is mandatory, optional or is disabled.</DL></DD></DL><HR><A NAME="getPacketDeliverer()"><!-- --></A><H3>getPacketDeliverer</H3><PRE><A HREF="../../../org/jivesoftware/openfire/PacketDeliverer.html" title="interface in org.jivesoftware.openfire">PacketDeliverer</A> <B>getPacketDeliverer</B>()</PRE><DL><DD>Returns the packet deliverer to use when delivering a packet over the socket fails. The packet deliverer will retry to send the packet using some other connection, will store the packet offline for later retrieval or will just drop it.<P><DD><DL><DT><B>Returns:</B><DD>the packet deliverer to use when delivering a packet over the socket fails.</DL></DD></DL><HR><A NAME="startTLS(boolean, java.lang.String, org.jivesoftware.openfire.Connection.ClientAuth)"><!-- --></A><H3>startTLS</H3><PRE>void <B>startTLS</B>(boolean clientMode, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> remoteServer, <A HREF="../../../org/jivesoftware/openfire/Connection.ClientAuth.html" title="enum in org.jivesoftware.openfire">Connection.ClientAuth</A> authentication) throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></PRE><DL><DD>Secures the plain connection by negotiating TLS with the other peer. In a server-2-server connection the server requesting the TLS negotiation will be the client and the other server will be the server during the TLS negotiation. Therefore, the server requesting the TLS negotiation must pass <code>true</code> in the <tt>clientMode</tt> parameter and the server receiving the TLS request must pass <code>false</code> in the <tt>clientMode</tt> parameter. Both servers should specify the xmpp domain of the other server in the <tt>remoteServer</tt> parameter.<p> In the case of client-2-server the XMPP server must pass <code>false</code> in the <tt>clientMode</tt> parameter since it will behave as the server in the TLS negotiation. The <tt>remoteServer</tt> parameter will always be <tt>null</tt>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>clientMode</CODE> - boolean indicating if this entity is a client or a server in the TLS negotiation.<DD><CODE>remoteServer</CODE> - xmpp domain of the remote server or <tt>null</tt>. When null a <A HREF="../../../org/jivesoftware/openfire/net/ClientTrustManager.html" title="class in org.jivesoftware.openfire.net"><CODE>ClientTrustManager</CODE></A> will be used for verifying certificates otherwise a <A HREF="../../../org/jivesoftware/openfire/net/ServerTrustManager.html" title="class in org.jivesoftware.openfire.net"><CODE>ServerTrustManager</CODE></A> will be used.<DD><CODE>authentication</CODE> - policy to use for authenticating the remote peer.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A></CODE> - if an error occured while securing the connection.</DL></DD></DL><HR><A NAME="addCompression()"><!-- --></A><H3>addCompression</H3><PRE>void <B>addCompression</B>()</PRE><DL><DD>Adds the compression filter to the connection but only filter incoming traffic. Do not filter outgoing traffic since we still need to send an uncompressed stanza to the client indicating that he can start compressing the traffic. After we sent the uncompresses stanza we can start compression outgoing traffic as well.<P><DD><DL></DL></DD></DL><HR><A NAME="startCompression()"><!-- --></A><H3>startCompression</H3><PRE>void <B>startCompression</B>()</PRE><DL><DD>Start compressing outgoing traffic for this connection. Compression will only be available after TLS has been negotiated. This means that a connection can never be using compression before TLS. However, it is possible to use compression without TLS.<P><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="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>Openfire 3.6.0a Javadoc</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/jivesoftware/openfire/ChannelNotFoundException.html" title="class in org.jivesoftware.openfire"><B>PREV CLASS</B></A> <A HREF="../../../org/jivesoftware/openfire/Connection.ClientAuth.html" title="enum in org.jivesoftware.openfire"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/jivesoftware/openfire/Connection.html" target="_top"><B>FRAMES</B></A> <A HREF="Connection.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: <A HREF="#nested_class_summary">NESTED</A> | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright © 2003-2008 Jive Software.</i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -