📄 nioconnection.html
字号:
<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> <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.nio.NIOConnection.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="NIOConnection(org.apache.mina.common.IoSession, org.jivesoftware.openfire.PacketDeliverer)"><!-- --></A><H3>NIOConnection</H3><PRE>public <B>NIOConnection</B>(org.apache.mina.common.IoSession session, <A HREF="../../../../org/jivesoftware/openfire/PacketDeliverer.html" title="interface in org.jivesoftware.openfire">PacketDeliverer</A> packetDeliverer)</PRE><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="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="registerCloseListener(org.jivesoftware.openfire.ConnectionCloseListener, java.lang.Object)"><!-- --></A><H3>registerCloseListener</H3><PRE>public void <B>registerCloseListener</B>(<A HREF="../../../../org/jivesoftware/openfire/ConnectionCloseListener.html" title="interface in org.jivesoftware.openfire">ConnectionCloseListener</A> 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> ignore)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#registerCloseListener(org.jivesoftware.openfire.ConnectionCloseListener, java.lang.Object)">Connection</A></CODE></B></DD><DD>Registers a listener for close event notification. Registrations after the Session is closed will be immediately notified <em>before</em> the registration call returns (within the context of the registration call). An optional handback object can be associated with the registration if the same listener is registered to listen for multiple connection closures.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#registerCloseListener(org.jivesoftware.openfire.ConnectionCloseListener, java.lang.Object)">registerCloseListener</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>listener</CODE> - the listener to register for events.<DD><CODE>ignore</CODE> - the object to send in the event notification.</DL></DD></DL><HR><A NAME="removeCloseListener(org.jivesoftware.openfire.ConnectionCloseListener)"><!-- --></A><H3>removeCloseListener</H3><PRE>public void <B>removeCloseListener</B>(<A HREF="../../../../org/jivesoftware/openfire/ConnectionCloseListener.html" title="interface in org.jivesoftware.openfire">ConnectionCloseListener</A> listener)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#removeCloseListener(org.jivesoftware.openfire.ConnectionCloseListener)">Connection</A></CODE></B></DD><DD>Removes a registered close event listener. Registered listeners must be able to receive close events up until the time this method returns. (i.e. it is possible to call unregister, receive a close event registration, and then have the unregister call return.)<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#removeCloseListener(org.jivesoftware.openfire.ConnectionCloseListener)">removeCloseListener</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>listener</CODE> - the listener to deregister for close events.</DL></DD></DL><HR><A NAME="getAddress()"><!-- --></A><H3>getAddress</H3><PRE>public 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><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getAddress()">Connection</A></CODE></B></DD><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>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getAddress()">getAddress</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 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>public <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><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getHostAddress()">Connection</A></CODE></B></DD><DD>Returns the IP address string in textual presentation.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getHostAddress()">getHostAddress</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 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>public <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><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getHostName()">Connection</A></CODE></B></DD><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>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getHostName()">getHostName</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 host name for this IP address, or if the operation is not allowed by the security check, the textual representation of the IP address.<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.<DT><B>See Also:</B><DD><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>InetAddress.getCanonicalHostName()</CODE></A>, <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/SecurityManager.html#checkConnect(java.lang.String, int)" title="class or interface in java.lang"><CODE>SecurityManager.checkConnect(java.lang.String, int)</CODE></A></DL></DD></DL><HR><A NAME="getLocalCertificates()"><!-- --></A><H3>getLocalCertificates</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/Certificate.html" title="class or interface in java.security.cert">Certificate</A>[] <B>getLocalCertificates</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getLocalCertificates()">Connection</A></CODE></B></DD><DD>Returns the local 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.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getLocalCertificates()">getLocalCertificates</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><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="getPeerCertificates()"><!-- --></A><H3>getPeerCertificates</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/Certificate.html" title="class or interface in java.security.cert">Certificate</A>[] <B>getPeerCertificates</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getPeerCertificates()">Connection</A></CODE></B></DD><DD>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.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/Connection.html#getPeerCertificates()">getPeerCertificates</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 + -