KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jivesoftware > messenger > plugin > presence > PresenceInfoProvider


1 /**
2  * $RCSfile: PresenceInfoProvider.java,v $
3  * $Revision: 1.1 $
4  * $Date: 2005/07/21 03:05:27 $
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.plugin.presence;
13
14 import org.xmpp.packet.Presence;
15
16 import javax.servlet.http.HttpServletRequest JavaDoc;
17 import javax.servlet.http.HttpServletResponse JavaDoc;
18 import java.io.IOException JavaDoc;
19
20 /**
21  * Abstract class for the different ways to provide information about user presences.
22  *
23  * @author Gaston Dombiak
24  */

25 abstract class PresenceInfoProvider {
26
27     /**
28      * Sends information to the sender of the http request about the presence of a user.
29      *
30      * @param httpServletRequest the http request.
31      * @param httpServletResponse the http response.
32      * @param presence the presence of the user or <tt>null</tt> if the user is offline.
33      * @throws IOException If an error occured while sending the information.
34      */

35     public abstract void sendInfo(HttpServletRequest JavaDoc httpServletRequest,
36             HttpServletResponse JavaDoc httpServletResponse, Presence presence) throws IOException JavaDoc;
37
38     /**
39      * Informs the sender of the http request that the user presence is not available. This may
40      * happen if the user does not exist or if the user that made the request is not allowed to
41      * see the presence of the requested user.
42      *
43      * @param httpServletRequest the http request.
44      * @param httpServletResponse the http response.
45      * @throws IOException If an error occured while sending the information.
46      */

47     public abstract void sendUserNotFound(HttpServletRequest JavaDoc httpServletRequest,
48             HttpServletResponse JavaDoc httpServletResponse) throws IOException JavaDoc;
49 }
50
Popular Tags