net.sf.colossus.webserver
Class ChatChannel

java.lang.Object
  extended by net.sf.colossus.webserver.ChatChannel

public class ChatChannel
extends java.lang.Object


Field Summary
private static java.lang.String[] chatHelp
           
private  java.lang.String chatId
           
private  java.io.PrintWriter chatLog
           
private static java.lang.String[] contactHelp
           
private static java.lang.String doubledashes
           
private static java.util.logging.Logger LOGGER
           
private static java.lang.String[] pingHelp
           
private  ChatMsgStorage storage
           
private  UserDB userDB
           
private  FormatWhen whenFormatter
           
 
Constructor Summary
ChatChannel(java.lang.String id, WebServerOptions options, UserDB userDB)
           
 
Method Summary
private  void appendToChatlog(ChatMessage msg)
           
 void createStoreAndDeliverMessage(java.lang.String sender, java.lang.String message)
           
 void createWelcomeMessage()
           
private  void deliverMessage(ChatMessage msg, UserDB userDB)
           
 void deliverMessageOfTheDayToClient(java.lang.String chatId, IWebClient client, java.util.List<java.lang.String> lines)
          Send message of the day lines to one client.
private  void deliverMessageToClient(ChatMessage msg, IWebClient client, boolean isResent)
           
 void deliverOldVersionWarning(java.lang.String chatId, java.lang.String userName, IWebClient client)
          Send message of the day lines to one client.
 void dispose()
           
 java.lang.String getChannelId()
           
 void handleUnknownCommand(java.lang.String msgAllLower, java.lang.String chatId, IWebClient client)
           
private  java.io.PrintWriter openLogForAppend(WebServerOptions options)
           
 void sendHelpToClient(java.lang.String msgAllLower, java.lang.String chatId, IWebClient client)
           
 void sendLinesToClient(java.lang.String chatId, IWebClient client, java.util.List<java.lang.String> lines, boolean spacer, java.lang.String sender)
          Send an arraylist full of lines to one client.
 void showContactHelp(java.lang.String chatId, IWebClient client)
           
 void tellLastMessagesToOne(IWebClient client)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

private static final java.util.logging.Logger LOGGER

userDB

private final UserDB userDB

chatId

private final java.lang.String chatId

storage

private final ChatMsgStorage storage

chatLog

private final java.io.PrintWriter chatLog

whenFormatter

private final FormatWhen whenFormatter

doubledashes

private static final java.lang.String doubledashes
See Also:
Constant Field Values

chatHelp

private static final java.lang.String[] chatHelp

pingHelp

private static final java.lang.String[] pingHelp

contactHelp

private static final java.lang.String[] contactHelp
Constructor Detail

ChatChannel

public ChatChannel(java.lang.String id,
                   WebServerOptions options,
                   UserDB userDB)
Method Detail

getChannelId

public java.lang.String getChannelId()

dispose

public void dispose()

createWelcomeMessage

public void createWelcomeMessage()

deliverMessageOfTheDayToClient

public void deliverMessageOfTheDayToClient(java.lang.String chatId,
                                           IWebClient client,
                                           java.util.List<java.lang.String> lines)
Send message of the day lines to one client.


handleUnknownCommand

public void handleUnknownCommand(java.lang.String msgAllLower,
                                 java.lang.String chatId,
                                 IWebClient client)

sendHelpToClient

public void sendHelpToClient(java.lang.String msgAllLower,
                             java.lang.String chatId,
                             IWebClient client)

showContactHelp

public void showContactHelp(java.lang.String chatId,
                            IWebClient client)
Parameters:
chatId - Id of the chat
client - WebClient connection who requested the contact help

sendLinesToClient

public void sendLinesToClient(java.lang.String chatId,
                              IWebClient client,
                              java.util.List<java.lang.String> lines,
                              boolean spacer,
                              java.lang.String sender)
Send an arraylist full of lines to one client.


deliverOldVersionWarning

public void deliverOldVersionWarning(java.lang.String chatId,
                                     java.lang.String userName,
                                     IWebClient client)
Send message of the day lines to one client.


createStoreAndDeliverMessage

public void createStoreAndDeliverMessage(java.lang.String sender,
                                         java.lang.String message)

deliverMessage

private void deliverMessage(ChatMessage msg,
                            UserDB userDB)

deliverMessageToClient

private void deliverMessageToClient(ChatMessage msg,
                                    IWebClient client,
                                    boolean isResent)

tellLastMessagesToOne

public void tellLastMessagesToOne(IWebClient client)

openLogForAppend

private java.io.PrintWriter openLogForAppend(WebServerOptions options)

appendToChatlog

private void appendToChatlog(ChatMessage msg)