Maintains server-wide knowledge of routes to any node.
Routes are only concerned with node addresses. Destinations are packet handlers (typically of the three following types):
In almost all cases, the caller should not be concerned with what handler is associated with a given node. Simply obtain the packet handler and deliver the packet to the node, leaving the details up to the handler.
Routes are matched using the stringprep rules given in the XMPP specification. Wildcard routes for a particular name or resource is indicated by a null. E.g. routing to any address at server.com should set the name to null, the host to 'server.com' and the resource to null. A route to the best resource for user@server.com should indicate that route with a null resource component of the XMPPAddress. Session managers should add a route for both the generic user@server.com as well as user@server.com/resource routes (knowing that one is an alias for the other is the responsibility of the session or session manager).
In order to accomodate broadcasts, you can also do partial matches by querying all 'child' nodes of a particular node. The routing table contains a forest of node trees. The node tree is arranged in the following heirarchy:
Note: it is important that any component or action affecting routes update the routing table immediately.
@author Iain Shigeoka
|
|
|
|
|
|
|
|
|
|