01: /**
02: * $RCSfile$
03: * $Revision: $
04: * $Date: $
05: *
06: * Copyright (C) 2006 Jive Software. All rights reserved.
07: *
08: * This software is published under the terms of the GNU Public License (GPL),
09: * a copy of which is included in this distribution.
10: */package org.jivesoftware.openfire;
11:
12: import org.xmpp.packet.IQ;
13: import org.xmpp.packet.Message;
14: import org.xmpp.packet.Packet;
15: import org.xmpp.packet.Presence;
16:
17: /**
18: * A router that handles incoming packets. Packets will be routed to their
19: * corresponding handler. A router is much like a forwarded with some logic
20: * to figute out who is the target for each packet.
21: *
22: * @author Gaston Dombiak
23: */
24: public interface PacketRouter {
25:
26: /**
27: * Routes the given packet based on its type.
28: *
29: * @param packet The packet to route.
30: */
31: void route(Packet packet);
32:
33: /**
34: * Routes the given IQ packet.
35: *
36: * @param packet The packet to route.
37: */
38: void route(IQ packet);
39:
40: /**
41: * Routes the given Message packet.
42: *
43: * @param packet The packet to route.
44: */
45: void route(Message packet);
46:
47: /**
48: * Routes the given Presence packet.
49: *
50: * @param packet The packet to route.
51: */
52: void route(Presence packet);
53: }
|