⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 connection.html

📁 开源软件openfire的API文件。进行openfire的二次开发所必需的工具。
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the underlying <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/javax/security/cert/X509Certificate.html" title="class or interface in javax.security.cert"><CODE>X509Certificate</CODE></A> for the connection of the peer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../../org/jivesoftware/openfire/Connection.TLSPolicy.html" title="enum in org.jivesoftware.openfire">Connection.TLSPolicy</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#getTlsPolicy()">getTlsPolicy</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns whether TLS is mandatory, optional or is disabled.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#init(org.jivesoftware.openfire.session.LocalSession)">init</A></B>(<A HREF="../../../org/jivesoftware/openfire/session/LocalSession.html" title="class in org.jivesoftware.openfire.session">LocalSession</A>&nbsp;session)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes the connection with it's owning session.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#isClosed()">isClosed</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if the connection/session is closed.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#isCompressed()">isCompressed</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if the connection is using compression.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#isFlashClient()">isFlashClient</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if the connected client is a flash client.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#isSecure()">isSecure</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if this connection is secure.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#isUsingSelfSignedCertificate()">isUsingSelfSignedCertificate</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if the other peer of this session presented a self-signed certificate.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#registerCloseListener(org.jivesoftware.openfire.ConnectionCloseListener, java.lang.Object)">registerCloseListener</A></B>(<A HREF="../../../org/jivesoftware/openfire/ConnectionCloseListener.html" title="interface in org.jivesoftware.openfire">ConnectionCloseListener</A>&nbsp;listener,                      <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A>&nbsp;handbackMessage)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Registers a listener for close event notification.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#removeCloseListener(org.jivesoftware.openfire.ConnectionCloseListener)">removeCloseListener</A></B>(<A HREF="../../../org/jivesoftware/openfire/ConnectionCloseListener.html" title="interface in org.jivesoftware.openfire">ConnectionCloseListener</A>&nbsp;listener)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes a registered close event listener.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#setCompressionPolicy(org.jivesoftware.openfire.Connection.CompressionPolicy)">setCompressionPolicy</A></B>(<A HREF="../../../org/jivesoftware/openfire/Connection.CompressionPolicy.html" title="enum in org.jivesoftware.openfire">Connection.CompressionPolicy</A>&nbsp;compressionPolicy)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets whether compression is enabled or is disabled.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#setFlashClient(boolean)">setFlashClient</A></B>(boolean&nbsp;flashClient)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets whether the connected client is a flash client.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#setLanaguage(java.lang.String)">setLanaguage</A></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>&nbsp;language)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the language code that should be used for this connection (e.g.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#setTlsPolicy(org.jivesoftware.openfire.Connection.TLSPolicy)">setTlsPolicy</A></B>(<A HREF="../../../org/jivesoftware/openfire/Connection.TLSPolicy.html" title="enum in org.jivesoftware.openfire">Connection.TLSPolicy</A>&nbsp;tlsPolicy)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets whether TLS is mandatory, optional or is disabled.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#setUsingSelfSignedCertificate(boolean)">setUsingSelfSignedCertificate</A></B>(boolean&nbsp;isSelfSigned)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Keeps track if the other peer of this session presented a self-signed certificate.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#setXMPPVersion(int, int)">setXMPPVersion</A></B>(int&nbsp;majorVersion,               int&nbsp;minorVersion)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the XMPP version information.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#startCompression()">startCompression</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Start compressing outgoing traffic for this connection.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#startTLS(boolean, java.lang.String, org.jivesoftware.openfire.Connection.ClientAuth)">startTLS</A></B>(boolean&nbsp;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>&nbsp;remoteServer,         <A HREF="../../../org/jivesoftware/openfire/Connection.ClientAuth.html" title="enum in org.jivesoftware.openfire">Connection.ClientAuth</A>&nbsp;authentication)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Secures the plain connection by negotiating TLS with the other peer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#systemShutdown()">systemShutdown</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Notification message indicating that the server is being shutdown.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/jivesoftware/openfire/Connection.html#validate()">validate</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Verifies that the connection is still live.</TD></TR></TABLE>&nbsp;<P><!-- ============ 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="validate()"><!-- --></A><H3>validate</H3><PRE>boolean <B>validate</B>()</PRE><DL><DD>Verifies that the connection is still live. Typically this is done by sending a whitespace character between packets.<P><DD><DL><DT><B>Returns:</B><DD>true if the socket remains valid, false otherwise.</DL></DD></DL><HR><A NAME="init(org.jivesoftware.openfire.session.LocalSession)"><!-- --></A><H3>init</H3><PRE>void <B>init</B>(<A HREF="../../../org/jivesoftware/openfire/session/LocalSession.html" title="class in org.jivesoftware.openfire.session">LocalSession</A>&nbsp;session)</PRE><DL><DD>Initializes the connection with it's owning session. Allows the connection class to configure itself with session related information (e.g. stream ID).<P><DD><DL><DT><B>Parameters:</B><DD><CODE>session</CODE> - the session that owns this connection</DL></DD></DL><HR><A NAME="getAddress()"><!-- --></A><H3>getAddress</H3><PRE>byte[] <B>getAddress</B>()                  throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></PRE><DL><DD>Returns the raw IP address of this <code>InetAddress</code> object. The result is in network byte order: the highest order byte of the address is in <code>getAddress()[0]</code>.<P><DD><DL><DT><B>Returns:</B><DD>the raw IP address of this object.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></CODE> - if IP address of host could not be determined.</DL></DD></DL><HR><A NAME="getHostAddress()"><!-- --></A><H3>getHostAddress</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>getHostAddress</B>()                      throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></PRE><DL><DD>Returns the IP address string in textual presentation.<P><DD><DL><DT><B>Returns:</B><DD>the raw IP address in a string format.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></CODE> - if IP address of host could not be determined.</DL></DD></DL><HR><A NAME="getHostName()"><!-- --></A><H3>getHostName</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>getHostName</B>()                   throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/UnknownHostException.html" title="class or interface in java.net">UnknownHostException</A></PRE><DL><DD>Gets the host name for this IP address. <p>If this InetAddress was created with a host name, this host name will be remembered and returned; otherwise, a reverse name lookup will be performed and the result will be returned based on the system configured name lookup service. If a lookup of the name service is required, call <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/InetAddress.html#getCanonicalHostName()" title="class or interface in java.net"><CODE>getCanonicalHostName</CODE></A>. <p>If there is a security manager, its <code>checkConnect</code> method is first called with the hostname and <code>-1</code> as its arguments to see if the operation is allowed. If the operation is not allowed, it will return the textual representation of the IP address.<P><DD><DL><DT><B>Returns:</B><DD>the host name for this IP address, or if the operation

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -