net.sf.colossus.webserver
Class ChatMsgStorage

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

public class ChatMsgStorage
extends java.lang.Object


Field Summary
private  ChatChannel channel
           
private  java.util.List<ChatMessage> lastNChatMessages
           
private static java.util.logging.Logger LOGGER
           
private  WebServerOptions options
           
private static java.lang.String SEP
          Just by coincidence, we use the same separator as for the network transmissions, so then there is no risk of "can't be unambiguely encoded".
 
Constructor Summary
ChatMsgStorage(ChatChannel theChannel, WebServerOptions options)
           
 
Method Summary
 void dispose()
           
 ChatChannel getChannel()
           
 java.util.List<ChatMessage> getLastNChatMessages()
           
 java.lang.String makeLine(ChatMessage msg)
           
private  void parseMsgLine(java.lang.String line)
           
private  void restoreMessages()
           
(package private)  void storeMessage(ChatMessage msg)
           
private  void storeMessages()
          Store all messages to a permanent storage (Disk file or DB) from where they can be read back when server is restarting
 
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

options

private final WebServerOptions options

channel

private final ChatChannel channel

lastNChatMessages

private final java.util.List<ChatMessage> lastNChatMessages

SEP

private static final java.lang.String SEP
Just by coincidence, we use the same separator as for the network transmissions, so then there is no risk of "can't be unambiguely encoded".

See Also:
Constant Field Values
Constructor Detail

ChatMsgStorage

public ChatMsgStorage(ChatChannel theChannel,
                      WebServerOptions options)
Method Detail

dispose

public void dispose()

getChannel

public ChatChannel getChannel()

getLastNChatMessages

public java.util.List<ChatMessage> getLastNChatMessages()

storeMessage

void storeMessage(ChatMessage msg)

storeMessages

private void storeMessages()
Store all messages to a permanent storage (Disk file or DB) from where they can be read back when server is restarting


restoreMessages

private void restoreMessages()

makeLine

public java.lang.String makeLine(ChatMessage msg)

parseMsgLine

private void parseMsgLine(java.lang.String line)