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

📄 socketconnection.html

📁 开源软件openfire的API文件。进行openfire的二次开发所必需的工具。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<TD><CODE><B><A HREF="../../../../org/jivesoftware/openfire/net/SocketConnection.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/net/SocketConnection.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;<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></CODE></FONT></TD><TD><CODE><B><A HREF="../../../../org/jivesoftware/openfire/net/SocketConnection.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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/net/SocketConnection.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;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<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></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_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>Field Detail</B></FONT></TH></TR></TABLE><A NAME="CHARSET"><!-- --></A><H3>CHARSET</H3><PRE>public static final <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>CHARSET</B></PRE><DL><DD>The utf-8 charset for decoding and encoding XMPP packet streams.<P><DL><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.jivesoftware.openfire.net.SocketConnection.CHARSET">Constant Field Values</A></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="SocketConnection(org.jivesoftware.openfire.PacketDeliverer, java.net.Socket, boolean)"><!-- --></A><H3>SocketConnection</H3><PRE>public <B>SocketConnection</B>(<A HREF="../../../../org/jivesoftware/openfire/PacketDeliverer.html" title="interface in org.jivesoftware.openfire">PacketDeliverer</A>&nbsp;backupDeliverer,                        <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/net/Socket.html" title="class or interface in java.net">Socket</A>&nbsp;socket,                        boolean&nbsp;isSecure)                 throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Create a new session using the supplied socket.<P><DL><DT><B>Parameters:</B><DD><CODE>backupDeliverer</CODE> - the packet deliverer this connection will use when socket is closed.<DD><CODE>socket</CODE> - the socket to represent.<DD><CODE>isSecure</CODE> - true if this is a secure connection.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if there was a socket error while sending the packet.</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="getInstances()"><!-- --></A><H3>getInstances</H3><PRE>public static <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A>&lt;<A HREF="../../../../org/jivesoftware/openfire/net/SocketConnection.html" title="class in org.jivesoftware.openfire.net">SocketConnection</A>&gt; <B>getInstances</B>()</PRE><DL><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getTLSStreamHandler()"><!-- --></A><H3>getTLSStreamHandler</H3><PRE>public <A HREF="../../../../org/jivesoftware/openfire/net/TLSStreamHandler.html" title="class in org.jivesoftware.openfire.net">TLSStreamHandler</A> <B>getTLSStreamHandler</B>()</PRE><DL><DD>Returns the stream handler responsible for securing the plain connection and providing the corresponding input and output streams.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the stream handler responsible for securing the plain connection and providing         the corresponding input and output streams.</DL></DD></DL><HR><A NAME="startTLS(boolean, java.lang.String, org.jivesoftware.openfire.Connection.ClientAuth)"><!-- --></A><H3>startTLS</H3><PRE>public void <B>startTLS</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)              throws <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#startTLS(boolean, java.lang.String, org.jivesoftware.openfire.Connection.ClientAuth)">Connection</A></CODE></B></DD><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>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#startTLS(boolean, java.lang.String, org.jivesoftware.openfire.Connection.ClientAuth)">startTLS</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><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/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL></DD></DL><HR><A NAME="addCompression()"><!-- --></A><H3>addCompression</H3><PRE>public void <B>addCompression</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#addCompression()">Connection</A></CODE></B></DD><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><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#addCompression()">addCompression</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="startCompression()"><!-- --></A><H3>startCompression</H3><PRE>public void <B>startCompression</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#startCompression()">Connection</A></CODE></B></DD><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><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#startCompression()">startCompression</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="validate()"><!-- --></A><H3>validate</H3><PRE>public boolean <B>validate</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#validate()">Connection</A></CODE></B></DD><DD>Verifies that the connection is still live. Typically this is done by sending a whitespace character between packets.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#validate()">validate</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><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>public void <B>init</B>(<A HREF="../../../../org/jivesoftware/openfire/session/LocalSession.html" title="class in org.jivesoftware.openfire.session">LocalSession</A>&nbsp;owner)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#init(org.jivesoftware.openfire.session.LocalSession)">Connection</A></CODE></B></DD><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>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#init(org.jivesoftware.openfire.session.LocalSession)">init</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html" title="interface in org.jivesoftware.openfire">Connection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>owner</CODE> - the session that owns this connection</DL></DD>

⌨️ 快捷键说明

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