📄 nioconnection.html
字号:
<DT><B>Returns:</B><DD><tt>null</tt> if no <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> is present for the connection.</DL></DD></DL><HR><A NAME="setUsingSelfSignedCertificate(boolean)"><!-- --></A><H3>setUsingSelfSignedCertificate</H3><PRE>public void <B>setUsingSelfSignedCertificate</B>(boolean isSelfSigned)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#setUsingSelfSignedCertificate(boolean)">Connection</A></CODE></B></DD><DD>Keeps track if the other peer of this session presented a self-signed certificate. When using self-signed certificate for server-2-server sessions then SASL EXTERNAL will not be used and instead server-dialback will be preferred for vcerifying the identify of the remote server.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#setUsingSelfSignedCertificate(boolean)">setUsingSelfSignedCertificate</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>isSelfSigned</CODE> - true if the other peer presented a self-signed certificate.</DL></DD></DL><HR><A NAME="isUsingSelfSignedCertificate()"><!-- --></A><H3>isUsingSelfSignedCertificate</H3><PRE>public boolean <B>isUsingSelfSignedCertificate</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isUsingSelfSignedCertificate()">Connection</A></CODE></B></DD><DD>Returns true if the other peer of this session presented a self-signed certificate. When using self-signed certificate for server-2-server sessions then SASL EXTERNAL will not be used and instead server-dialback will be preferred for vcerifying the identify of the remote server.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isUsingSelfSignedCertificate()">isUsingSelfSignedCertificate</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 other peer of this session presented a self-signed certificate.</DL></DD></DL><HR><A NAME="getPacketDeliverer()"><!-- --></A><H3>getPacketDeliverer</H3><PRE>public <A HREF="../../../../org/jivesoftware/openfire/PacketDeliverer.html" title="interface in org.jivesoftware.openfire">PacketDeliverer</A> <B>getPacketDeliverer</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getPacketDeliverer()">Connection</A></CODE></B></DD><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>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getPacketDeliverer()">getPacketDeliverer</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>the packet deliverer to use when delivering a packet over the socket fails.</DL></DD></DL><HR><A NAME="close()"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#close()">Connection</A></CODE></B></DD><DD>Close this session including associated socket connection. The order of events for closing the session is: <ul> <li>Set closing flag to prevent redundant shutdowns. <li>Call notifyEvent all listeners that the channel is shutting down. <li>Close the socket. </ul><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#close()">close</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="systemShutdown()"><!-- --></A><H3>systemShutdown</H3><PRE>public void <B>systemShutdown</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#systemShutdown()">Connection</A></CODE></B></DD><DD>Notification message indicating that the server is being shutdown. Implementors should send a stream error whose condition is system-shutdown before closing the connection.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#systemShutdown()">systemShutdown</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="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> 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></DL><HR><A NAME="isClosed()"><!-- --></A><H3>isClosed</H3><PRE>public boolean <B>isClosed</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isClosed()">Connection</A></CODE></B></DD><DD>Returns true if the connection/session is closed.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isClosed()">isClosed</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 connection is closed.</DL></DD></DL><HR><A NAME="isSecure()"><!-- --></A><H3>isSecure</H3><PRE>public boolean <B>isSecure</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isSecure()">Connection</A></CODE></B></DD><DD>Returns true if this connection is secure.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#isSecure()">isSecure</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 connection is secure (e.g. SSL/TLS)</DL></DD></DL><HR><A NAME="deliver(org.xmpp.packet.Packet)"><!-- --></A><H3>deliver</H3><PRE>public void <B>deliver</B>(<A HREF="../../../../org/xmpp/packet/Packet.html" title="class in org.xmpp.packet">Packet</A> packet) throws <A HREF="../../../../org/jivesoftware/openfire/auth/UnauthorizedException.html" title="class in org.jivesoftware.openfire.auth">UnauthorizedException</A></PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#deliver(org.xmpp.packet.Packet)">Connection</A></CODE></B></DD><DD>Delivers the packet to this connection without checking the recipient. The method essentially calls <code>socket.send(packet.getWriteBuffer())</code>.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#deliver(org.xmpp.packet.Packet)">deliver</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>packet</CODE> - the packet to deliver.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/auth/UnauthorizedException.html" title="class in org.jivesoftware.openfire.auth">UnauthorizedException</A></CODE> - if a permission error was detected.</DL></DD></DL><HR><A NAME="deliverRawText(java.lang.String)"><!-- --></A><H3>deliverRawText</H3><PRE>public void <B>deliverRawText</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> text)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#deliverRawText(java.lang.String)">Connection</A></CODE></B></DD><DD>Delivers raw text to this connection. This is a very low level way for sending XML stanzas to the client. This method should not be used unless you have very good reasons for not using <A HREF="../../../../org/jivesoftware/openfire/Connection.html#deliver(org.xmpp.packet.Packet)"><CODE>Connection.deliver(org.xmpp.packet.Packet)</CODE></A>.<p> This method avoids having to get the writer of this connection and mess directly with the writer. Therefore, this method ensures a correct delivery of the stanza even if other threads were sending data concurrently.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#deliverRawText(java.lang.String)">deliverRawText</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>text</CODE> - the XML stanzas represented kept in a String.</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 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><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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -