|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.servlet.GenericServlet | +--ChatServlet
This servlet will take care of incoming users connecting through the Chatlet and open a connection to an IRC server, thereafter relaying information between them.
Constructor Summary | |
ChatServlet()
|
Method Summary | |
void |
broadcast(java.lang.String str)
Used to broadcast a message to all connected users. |
void |
closeConnection(UserConnection activeConnection)
Used to close a connection and log out a user from IRC and from the servlet. |
UserConnection |
connectUser(java.lang.String input,
java.io.ObjectOutputStream userStream,
java.lang.String ip,
java.lang.String host)
Used in the login sequence to create a user object. |
void |
destroy()
Invoked when the servlet is being shut down by the servlet engine or web server. |
UserConnection |
findConnection(int code,
java.lang.String ip)
Used to find a connection associated with a user. |
int |
getDebug()
Used to get the current debug level mask. |
java.lang.String |
getServletInfo()
Used to retrieve information from the servlet. |
java.lang.String |
getVersion()
Used to retrieve version information. |
void |
init()
Invoked when the servlet is created. |
boolean |
isHostBanned(java.lang.String host)
Used to check whether a connecting host is banned or not. |
void |
service(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response)
Takes care of incoming messages and commands from users. |
Methods inherited from class javax.servlet.GenericServlet |
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ChatServlet()
Method Detail |
public java.lang.String getServletInfo()
getServletInfo
in class javax.servlet.GenericServlet
public java.lang.String getVersion()
public void destroy()
destroy
in class javax.servlet.GenericServlet
public void init()
init
in class javax.servlet.GenericServlet
public void service(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response) throws javax.servlet.ServletException, java.io.IOException
service
in class javax.servlet.GenericServlet
request
- The request object.response
- The response object.public UserConnection findConnection(int code, java.lang.String ip) throws java.io.IOException
code
- The unique code for this user.host
- The host the user is connecting from.public UserConnection connectUser(java.lang.String input, java.io.ObjectOutputStream userStream, java.lang.String ip, java.lang.String host) throws java.io.IOException, java.lang.IndexOutOfBoundsException, java.lang.NumberFormatException
input
- The input containing login information.userStream
- The stream connected to this user.ip
- The ip the user is connecting from.host
- The host the user is connecting from.public int getDebug()
0000 (0) = no debug messages
0001 (1) = incoming irc messages will be printed
0010 (2) = incoming user messages will be printed
0100 (4) = outgoing irc messages will be printed
1000 (8) = outgoing user messages will be printed
public boolean isHostBanned(java.lang.String host)
host
- The host to check.public void closeConnection(UserConnection activeConnection)
activeConnection
- The connection to close.public void broadcast(java.lang.String str)
str
- The String to be broadcasted.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |