fr.paris.lutece.plugins.chat.service
Class ChatService

java.lang.Object
  extended by fr.paris.lutece.plugins.chat.service.ChatService
All Implemented Interfaces:
java.lang.Runnable

public final class ChatService
extends java.lang.Object
implements java.lang.Runnable

This class manages chat users and rooms.


Method Summary
static int doEnterRoom(javax.servlet.http.HttpServletRequest request)
          Room entering process
static java.lang.String getNickname(javax.servlet.http.HttpServletRequest request)
          Get nickname attached to the request or to user's session
static ChatRoom getRoom(javax.servlet.http.HttpServletRequest request)
          Get the room attached to the session
static RoomList getRoomList()
          Returns the rooms list
static void initRooms()
          Initialize rooms
static boolean newMessage(javax.servlet.http.HttpServletRequest request)
           
 void run()
          Scan rooms for no activity users in order to remove them.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doEnterRoom

public static int doEnterRoom(javax.servlet.http.HttpServletRequest request)
Room entering process

Parameters:
request - The Http request
Returns:
One of the error codes defined in the ChatRoom class
See Also:
ChatRoom

getRoom

public static ChatRoom getRoom(javax.servlet.http.HttpServletRequest request)
Get the room attached to the session

Parameters:
request - the servlet request
Returns:
the room attached to the session

getRoomList

public static RoomList getRoomList()
Returns the rooms list

Returns:
the rooms ist as a RoomList object

initRooms

public static void initRooms()
Initialize rooms


run

public void run()
Scan rooms for no activity users in order to remove them. Use Runnable implementation

Specified by:
run in interface java.lang.Runnable

getNickname

public static java.lang.String getNickname(javax.servlet.http.HttpServletRequest request)
Get nickname attached to the request or to user's session

Parameters:
request - the servlet request
Returns:
The nickname

newMessage

public static boolean newMessage(javax.servlet.http.HttpServletRequest request)
Parameters:
request - the HttpServlet request
Returns:
if a new message is processed


Copyright © 2010 Mairie de Paris. All Rights Reserved.