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

📄 routingtableimpl.html

📁 开源软件openfire的API文件。进行openfire的二次开发所必需的工具。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</DD><DD><DL><DT><B>Parameters:</B><DD><CODE>packet</CODE> - the message to broadcast.<DD><CODE>onlyLocal</CODE> - true if only client sessions connecte to the local JVM will get the message.</DL></DD></DL><HR><A NAME="routePacket(org.xmpp.packet.JID, org.xmpp.packet.Packet, boolean)"><!-- --></A><H3>routePacket</H3><PRE>public void <B>routePacket</B>(<A HREF="../../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A>&nbsp;jid,                        <A HREF="../../../../org/xmpp/packet/Packet.html" title="class in org.xmpp.packet">Packet</A>&nbsp;packet,                        boolean&nbsp;fromServer)                 throws <A HREF="../../../../org/jivesoftware/openfire/PacketException.html" title="class in org.jivesoftware.openfire">PacketException</A></PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#routePacket(org.xmpp.packet.JID, org.xmpp.packet.Packet, boolean)">RoutingTable</A></CODE></B></DD><DD>Routes a packet to the specified address. The packet destination can be a user on the local server, a component, or a foreign server.<p> When routing a packet to a remote server then a new outgoing connection will be created to the remote server if none was found and the packet will be delivered. If an existing outgoing connection already exists then it will be used for delivering the packet. Moreover, when runing inside of a cluster the node that has the actual outgoing connection will be requested to deliver the requested packet.<p> Packets routed to components will only be sent if the internal or external component is connected to the server. Moreover, when runing inside of a cluster the node that is hosting the component will be requested to deliver the requested packet. It will be first checked if the component is available in this JVM and if not then the first cluster node found hosting the component will be used.<p> Packets routed to users will be delivered if the user is connected to the server. Depending on the packet type and the sender of the packet only available or all user sessions could be considered. For instance, <A HREF="../../../../org/xmpp/packet/Message.html" title="class in org.xmpp.packet"><CODE>Messages</CODE></A> and <A HREF="../../../../org/xmpp/packet/Presence.html" title="class in org.xmpp.packet"><CODE>Presences</CODE></A> are only sent to available client sessions whilst <A HREF="../../../../org/xmpp/packet/IQ.html" title="class in org.xmpp.packet"><CODE>IQs</CODE></A> originated to the server can be sent to available or unavailable sessions. When runing inside of a cluster the node that is hosting the user session will be requested to deliver the requested packet.<p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#routePacket(org.xmpp.packet.JID, org.xmpp.packet.Packet, boolean)">routePacket</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html" title="interface in org.jivesoftware.openfire">RoutingTable</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>jid</CODE> - the receipient of the packet to route.<DD><CODE>packet</CODE> - the packet to route.<DD><CODE>fromServer</CODE> - true if the packet was created by the server. This packets should        always be delivered<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/PacketException.html" title="class in org.jivesoftware.openfire">PacketException</A></CODE> - thrown if the packet is malformed (results in the sender's      session being shutdown).</DL></DD></DL><HR><A NAME="getClientRoute(org.xmpp.packet.JID)"><!-- --></A><H3>getClientRoute</H3><PRE>public <A HREF="../../../../org/jivesoftware/openfire/session/ClientSession.html" title="interface in org.jivesoftware.openfire.session">ClientSession</A> <B>getClientRoute</B>(<A HREF="../../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A>&nbsp;jid)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getClientRoute(org.xmpp.packet.JID)">RoutingTable</A></CODE></B></DD><DD>Returns the client session associated to the specified XMPP address or <tt>null</tt> if none was found. When running inside of a cluster and a remote node is hosting the client session then a session surrage will be returned.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getClientRoute(org.xmpp.packet.JID)">getClientRoute</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html" title="interface in org.jivesoftware.openfire">RoutingTable</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>jid</CODE> - the address of the session.<DT><B>Returns:</B><DD>the client session associated to the specified XMPP address or null if none was found.</DL></DD></DL><HR><A NAME="getClientsRoutes(boolean)"><!-- --></A><H3>getClientsRoutes</H3><PRE>public <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/session/ClientSession.html" title="interface in org.jivesoftware.openfire.session">ClientSession</A>&gt; <B>getClientsRoutes</B>(boolean&nbsp;onlyLocal)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getClientsRoutes(boolean)">RoutingTable</A></CODE></B></DD><DD>Returns collection of client sessions authenticated with the server. When running inside of a cluster the returned sessions will include sessions connected to this JVM and also other cluster nodes. TODO Prevent usage of this message and change original requirement to avoid having to load all sessions. TODO This may not scale when hosting millions of sessions.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getClientsRoutes(boolean)">getClientsRoutes</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html" title="interface in org.jivesoftware.openfire">RoutingTable</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>onlyLocal</CODE> - true if only client sessions connected to this JVM must be considered.<DT><B>Returns:</B><DD>collection of client sessions authenticated with the server.</DL></DD></DL><HR><A NAME="getServerRoute(org.xmpp.packet.JID)"><!-- --></A><H3>getServerRoute</H3><PRE>public <A HREF="../../../../org/jivesoftware/openfire/session/OutgoingServerSession.html" title="interface in org.jivesoftware.openfire.session">OutgoingServerSession</A> <B>getServerRoute</B>(<A HREF="../../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A>&nbsp;jid)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getServerRoute(org.xmpp.packet.JID)">RoutingTable</A></CODE></B></DD><DD>Returns the outgoing server session associated to the specified XMPP address or <tt>null</tt> if none was found. When running inside of a cluster and a remote node is hosting the session then a session surrage will be returned.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getServerRoute(org.xmpp.packet.JID)">getServerRoute</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html" title="interface in org.jivesoftware.openfire">RoutingTable</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>jid</CODE> - the address of the session.<DT><B>Returns:</B><DD>the outgoing server session associated to the specified XMPP address or null if none was found.</DL></DD></DL><HR><A NAME="getServerHostnames()"><!-- --></A><H3>getServerHostnames</H3><PRE>public <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="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&gt; <B>getServerHostnames</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getServerHostnames()">RoutingTable</A></CODE></B></DD><DD>Returns a collection with the hostnames of the remote servers that currently may receive packets sent from this server.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getServerHostnames()">getServerHostnames</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html" title="interface in org.jivesoftware.openfire">RoutingTable</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>a collection with the hostnames of the remote servers that currently may receive         packets sent from this server.</DL></DD></DL><HR><A NAME="getServerSessionsCount()"><!-- --></A><H3>getServerSessionsCount</H3><PRE>public int <B>getServerSessionsCount</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getServerSessionsCount()">RoutingTable</A></CODE></B></DD><DD>Returns the number of outgoing server sessions hosted in this JVM. When runing inside of a cluster you will need to get this value for each cluster node to learn the total number of outgoing server sessions.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getServerSessionsCount()">getServerSessionsCount</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html" title="interface in org.jivesoftware.openfire">RoutingTable</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of outgoing server sessions hosted in this JVM.</DL></DD></DL><HR><A NAME="getComponentsDomains()"><!-- --></A><H3>getComponentsDomains</H3><PRE>public <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="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&gt; <B>getComponentsDomains</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getComponentsDomains()">RoutingTable</A></CODE></B></DD><DD>Returns domains of components hosted by the server. When running in a cluster, domains of components running in any node will be returned.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#getComponentsDomains()">getComponentsDomains</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html" title="interface in org.jivesoftware.openfire">RoutingTable</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>domains of components hosted by the server.</DL></DD></DL><HR><A NAME="hasClientRoute(org.xmpp.packet.JID)"><!-- --></A><H3>hasClientRoute</H3><PRE>public boolean <B>hasClientRoute</B>(<A HREF="../../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A>&nbsp;jid)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#hasClientRoute(org.xmpp.packet.JID)">RoutingTable</A></CODE></B></DD><DD>Returns true if a registered user or anonymous user with the specified full JID is currently logged. When running inside of a cluster a true value will be returned as long as the user is connected to any cluster node. // TODO Should we care about available or not available????<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#hasClientRoute(org.xmpp.packet.JID)">hasClientRoute</A></CODE> in interface <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html" title="interface in org.jivesoftware.openfire">RoutingTable</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>jid</CODE> - the full JID of the user.<DT><B>Returns:</B><DD>true if a registered user or anonymous user with the specified full JID is currently logged.</DL></DD></DL><HR><A NAME="isAnonymousRoute(org.xmpp.packet.JID)"><!-- --></A><H3>isAnonymousRoute</H3><PRE>public boolean <B>isAnonymousRoute</B>(<A HREF="../../../../org/xmpp/packet/JID.html" title="class in org.xmpp.packet">JID</A>&nbsp;jid)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/jivesoftware/openfire/RoutingTable.html#isAnonymousRoute(org.xmpp.packet.JID)">RoutingTable</A></CODE></B></DD><DD>Returns true if an anonymous user with the specified full JID is currently logged. When running inside of a cluster a true value will be returned as long as the user is connected to any cluster node.

⌨️ 快捷键说明

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