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 TypeMethodDescriptionvoid
broadcastPacket
(org.xmpp.packet.Message packet) Brodcasts the specified message to all local client sessions of each cluster node.boolean
routePacket
(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:RemotePacketRouter
Routes packet to specified recipient hosted in the specified node.- Specified by:
routePacket
in 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:RemotePacketRouter
Brodcasts the specified message to all local client sessions of each cluster node. The current cluster node is not going to be included.- Specified by:
broadcastPacket
in interfaceRemotePacketRouter
- Parameters:
packet
- the message to broadcast.
-