KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > messenger > ChannelHandler


1 /**
2  * $RCSfile: ChannelHandler.java,v $
3  * $Revision: 1.4 $
4  * $Date: 2005/04/04 06:36:48 $
5  *
6  * Copyright (C) 2004 Jive Software. All rights reserved.
7  *
8  * This software is published under the terms of the GNU Public License (GPL),
9  * a copy of which is included in this distribution.
10  */

11
12 package org.jivesoftware.messenger;
13
14 import org.xmpp.packet.Packet;
15 import org.jivesoftware.messenger.auth.UnauthorizedException;
16
17 /**
18  * Interface to handle packets delivered by Channels.
19  *
20  * @author Matt Tucker
21  */

22 public interface ChannelHandler<T extends Packet> {
23
24     /**
25      * Process an XMPP packet.
26      *
27      * @param packet a packet to process.
28      * @throws UnauthorizedException if not allowed to process the packet.
29      * @throws PacketException thrown if the packet is malformed (results in the sender's
30      * session being shutdown).
31      */

32     public abstract void process(T packet) throws UnauthorizedException, PacketException;
33 }
Popular Tags