com.multisoftgroup.jerry.webchat.plugin
Class ChatLogPlugin

java.lang.Object
  extended by com.multisoftgroup.jerry.webchat.plugin.ChatLogPlugin
All Implemented Interfaces:
ChatPlugin

public class ChatLogPlugin
extends Object
implements ChatPlugin

This Jerry Messenger plug-in creates a log file for each of web chat. Configuration parameters: path - path to log directory.

Author:
Pavel Savin

Constructor Summary
ChatLogPlugin()
           
 
Method Summary
 void close()
          Called on closing chat.
 void init(Chat chat, JID visitor, JID operator, Map<String,String> configParams)
          Called for the plug-in initializaion.
 boolean toOperator(Packet packet)
          Called before the message packet is sent to the operator.
 void toOperator(String message)
          Called before the message is sent to the operator.
 void toOperator(String subject, String message)
          Called before sending the offline message to the operator.
 boolean toVisitor(Packet packet)
          Called before the message packet is sent to the web visitor.
 void toVisitor(String message)
          Called before the message is sent to the web visitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChatLogPlugin

public ChatLogPlugin()
Method Detail

init

public void init(Chat chat,
                 JID visitor,
                 JID operator,
                 Map<String,String> configParams)
Description copied from interface: ChatPlugin
Called for the plug-in initializaion.

Specified by:
init in interface ChatPlugin
Parameters:
chat - Chat which creates this plug-in instance
visitor - jabber address of web visitor
operator - jabber address of operator
configParams - map of the plug-in parameters (name, value) passed from jerry.xml config file

toOperator

public void toOperator(String message)
Description copied from interface: ChatPlugin
Called before the message is sent to the operator. It can be used to log messages.

Specified by:
toOperator in interface ChatPlugin
Parameters:
message - text of the message

toOperator

public void toOperator(String subject,
                       String message)
Description copied from interface: ChatPlugin
Called before sending the offline message to the operator.

Specified by:
toOperator in interface ChatPlugin
Parameters:
subject - subject of the message
message - text of the message

toOperator

public boolean toOperator(Packet packet)
Description copied from interface: ChatPlugin
Called before the message packet is sent to the operator. It can be used as a message filter. If the method returns true, the message will be sent to operator otherwise it will be dropped.

Specified by:
toOperator in interface ChatPlugin
Parameters:
packet - message packet
Returns:
true - send packet; false - drop packet

toVisitor

public boolean toVisitor(Packet packet)
Description copied from interface: ChatPlugin
Called before the message packet is sent to the web visitor. It can be used as a message filter or in command processor to extend the messenger functionality.

Specified by:
toVisitor in interface ChatPlugin
Parameters:
packet - message packet
Returns:
true - send packet; false - drop packet

toVisitor

public void toVisitor(String message)
Description copied from interface: ChatPlugin
Called before the message is sent to the web visitor. It can be used to log messages.

Specified by:
toVisitor in interface ChatPlugin
Parameters:
message - text of the message

close

public void close()
Description copied from interface: ChatPlugin
Called on closing chat.

Specified by:
close in interface ChatPlugin