Class ClusterPacketRouter
java.lang.Object
org.jivesoftware.openfire.cluster.ClusterPacketRouter
- All Implemented Interfaces:
RemotePacketRouter
Route packets to other nodes of the cluster. If the remote node was not found or failed
to be reached then depending on the type of packet an error packet will be returned. In case
the remote node is reached but the remote node fails to route the packet to the recipient (e.g.
the recipient just left) then an error packet may be created from the remote node and send it
back to this node.
- Author:
- Gaston Dombiak
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbroadcastPacket(org.xmpp.packet.Message packet) Brodcasts the specified message to all local client sessions of each cluster node.booleanroutePacket(byte[] nodeID, org.xmpp.packet.JID recipient, org.xmpp.packet.Packet packet) Routes packet to specified recipient hosted in the specified node.
-
Constructor Details
-
ClusterPacketRouter
public ClusterPacketRouter()
-
-
Method Details
-
routePacket
public boolean routePacket(byte[] nodeID, org.xmpp.packet.JID recipient, org.xmpp.packet.Packet packet) Description copied from interface:RemotePacketRouterRoutes packet to specified recipient hosted in the specified node.- Specified by:
routePacketin interfaceRemotePacketRouter- Parameters:
nodeID- the ID of the node hosting the recipient.recipient- the target entity that will get the packet.packet- the packet to send.- Returns:
- true if the remote node was found.
-
broadcastPacket
public void broadcastPacket(org.xmpp.packet.Message packet) Description copied from interface:RemotePacketRouterBrodcasts the specified message to all local client sessions of each cluster node. The current cluster node is not going to be included.- Specified by:
broadcastPacketin interfaceRemotePacketRouter- Parameters:
packet- the message to broadcast.
-