com.web_visage.ichat
Class AbstractMessageFactory

java.lang.Object
  extended by com.web_visage.ichat.AbstractMessageFactory
All Implemented Interfaces:
IChatMessageConstants, IChatMessageFactory
Direct Known Subclasses:
DefaultMessageFactory

public abstract class AbstractMessageFactory
extends java.lang.Object
implements IChatMessageConstants, IChatMessageFactory

Abstract class for implementing ichat message factories.

Author:
K.Baturytski

Field Summary
 
Fields inherited from interface com.web_visage.ichat.IChatMessageConstants
BEGIN_END_MARKER, COMMON_LINE, ICHAT_TAG, PRIVATE_TAG, SEPARATOR, WILDCARD
 
Constructor Summary
AbstractMessageFactory(java.lang.String version)
          Constructor.
 
Method Summary
 IChatAlertMessage createAlertMessage(int aMessageId, IChatSender aSender, java.lang.String anAlertText)
          Creates "alert" message.
 IChatBoardMessage createBoardMessage(int aMessageId, IChatSender aSender, int aBlockNumber, java.lang.String aText)
          Creates "board" message.
 IChatTextMessage createBroadcastMessage(int aMessageId, IChatSender aSender, java.lang.String aText)
          Creates private broadcast iChat message.
 IChatConnectMessage createConnectMessage(int aMessageId, IChatSender aSender, java.lang.String aLogin, java.lang.String aNickName, java.lang.String aGreetingMessage, java.lang.String aRecepient, EnumStatus aStatus)
          Creates connect message.
 IChatConnectMessage createConnectToLineMessage(int aMessageId, IChatSender aSender, java.lang.String aLogin, java.lang.String aNickName, java.lang.String aLine, java.lang.String aGreetingMessage, EnumStatus aStatus)
          Creates connect to line message.
 IChatCreateLineMessage createCreateLineMessage(int aMessageId, IChatSender aSender, java.lang.String aLine, java.lang.String aPassword)
          Creates create line message.
 IChatCreateMessage createCreateMessage(int aMessageId, IChatSender aSender, java.lang.String aLineId, java.lang.String aReceiver)
          Creates "create" message.
 IChatMessage createDisconnectFromLineMessage(int aMessageId, IChatSender aSender, java.lang.String aLineName)
          Creates disconnect from line message.
 IChatDisconnectMessage createDisconnectMessage(int aMessageId, IChatSender aSender)
          Creates disconnect message.
 IChatMeMessage createMeMessage(int aMessageId, IChatSender aSender, java.lang.String aText)
          Creates "me" message.
 IChatMessage createPrivateMessage(int aMessageId, IChatSender aSender, java.lang.String aReceiver, java.lang.String aText)
          Creates private iChat message.
 IChatTextMessage createPublicMessage(int aMessageId, IChatSender aSender, java.lang.String aText)
          Creates public iChat message.
 IChatReceivedMessage createReceivedMessage(int aMessageId, IChatSender aSender, java.lang.String aConfirmationText)
          Creates "received" message.
 IChatRefreshBoardMessage createRefreshBoardMessage(int aMessageId, IChatSender aSender)
          Creates "refresh board" message.
 IChatRefreshMessage createRefreshLineMessage(int aMessageId, IChatSender aSender, java.lang.String aLogin, java.lang.String aNickName, java.lang.String aLineName, java.lang.String aGreetingMessage, java.lang.String aReceiver, EnumStatus aStatus)
          Creates refresh-line message.
 IChatRefreshMessage createRefreshMessage(int aMessageId, IChatSender aSender, java.lang.String aLogin, java.lang.String aNickName, java.lang.String aGreetingMessage, java.lang.String aReceiver, EnumStatus aStatus)
          Creates refresh message.
 IChatRenameMessage createRenameMessage(int aMessageId, IChatSender aSender, java.lang.String aNewNick)
          Creates "rename" message.
 IChatStatusMessage createStatusMessage(int aMessageId, IChatSender aSender, EnumStatus aStatus, java.lang.String aGreetingMessage)
          Creates STATUS message.
 IChatStatusReqMessage createStatusReqMessage(int aMessageId, IChatSender aSender)
          Creates STATUS_REQ message.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.web_visage.ichat.IChatMessageFactory
createForwardMessage, createMessage, createServerForwardMessage
 

Constructor Detail

AbstractMessageFactory

public AbstractMessageFactory(java.lang.String version)
Constructor.

Parameters:
version - - ichat client version
Method Detail

createAlertMessage

public IChatAlertMessage createAlertMessage(int aMessageId,
                                            IChatSender aSender,
                                            java.lang.String anAlertText)
Creates "alert" message.

Specified by:
createAlertMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - sender object
anAlertText - - alert text
Returns:
fulfilled message object

createBoardMessage

public IChatBoardMessage createBoardMessage(int aMessageId,
                                            IChatSender aSender,
                                            int aBlockNumber,
                                            java.lang.String aText)
Creates "board" message.

Specified by:
createBoardMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - a sender
aBlockNumber - - a block number
aText - - a message text
Returns:

createBroadcastMessage

public IChatTextMessage createBroadcastMessage(int aMessageId,
                                               IChatSender aSender,
                                               java.lang.String aText)
Creates private broadcast iChat message.

Specified by:
createBroadcastMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - a sender
aText - - text of the public message
Returns:

createConnectMessage

public IChatConnectMessage createConnectMessage(int aMessageId,
                                                IChatSender aSender,
                                                java.lang.String aLogin,
                                                java.lang.String aNickName,
                                                java.lang.String aGreetingMessage,
                                                java.lang.String aRecepient,
                                                EnumStatus aStatus)
Creates connect message.

Specified by:
createConnectMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id (increments with each message sent)
aSender - - a sender object
aLogin - - user's system login
aNickName - - your nick name
aGreetingMessage - - greeting message
aStatus - - user status
Returns:

createConnectToLineMessage

public IChatConnectMessage createConnectToLineMessage(int aMessageId,
                                                      IChatSender aSender,
                                                      java.lang.String aLogin,
                                                      java.lang.String aNickName,
                                                      java.lang.String aLine,
                                                      java.lang.String aGreetingMessage,
                                                      EnumStatus aStatus)
Creates connect to line message.

Specified by:
createConnectToLineMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id (increments with each message sent)
aSender - - a sender
aLogin - - user's system login
aNickName - - your nick name
aLine - - line name
aGreetingMessage - - greeting message
aStatus - - user status
Returns:

createCreateMessage

public IChatCreateMessage createCreateMessage(int aMessageId,
                                              IChatSender aSender,
                                              java.lang.String aLineId,
                                              java.lang.String aReceiver)
Creates "create" message.

Specified by:
createCreateMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - sender object
aLineId - - line identifier
aReceiver - - receiver
Returns:

createCreateLineMessage

public IChatCreateLineMessage createCreateLineMessage(int aMessageId,
                                                      IChatSender aSender,
                                                      java.lang.String aLine,
                                                      java.lang.String aPassword)
Creates create line message.

Specified by:
createCreateLineMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - a sender object
aLine - - a line name
aPassword - - the line password
Returns:

createDisconnectFromLineMessage

public IChatMessage createDisconnectFromLineMessage(int aMessageId,
                                                    IChatSender aSender,
                                                    java.lang.String aLineName)
Creates disconnect from line message.

Specified by:
createDisconnectFromLineMessage in interface IChatMessageFactory
Parameters:
aMessageId -
aSender -
aLineName -
Returns:

createDisconnectMessage

public IChatDisconnectMessage createDisconnectMessage(int aMessageId,
                                                      IChatSender aSender)
Creates disconnect message.

Specified by:
createDisconnectMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id (increments with each message sent)
aSender - - a sender
Returns:

createMeMessage

public IChatMeMessage createMeMessage(int aMessageId,
                                      IChatSender aSender,
                                      java.lang.String aText)
Creates "me" message.

Specified by:
createMeMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - sender object
aNewNick - - new nickname
Returns:
fulfilled message object

createPrivateMessage

public IChatMessage createPrivateMessage(int aMessageId,
                                         IChatSender aSender,
                                         java.lang.String aReceiver,
                                         java.lang.String aText)
Creates private iChat message.

Specified by:
createPrivateMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - a sender
aText - - text of the public message
aReceiver - - receiver of the message
Returns:

createPublicMessage

public IChatTextMessage createPublicMessage(int aMessageId,
                                            IChatSender aSender,
                                            java.lang.String aText)
Creates public iChat message.

Specified by:
createPublicMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - a sender
aText - - text of the public message
Returns:

createReceivedMessage

public IChatReceivedMessage createReceivedMessage(int aMessageId,
                                                  IChatSender aSender,
                                                  java.lang.String aConfirmationText)
Creates "received" message.

Specified by:
createReceivedMessage in interface IChatMessageFactory
Parameters:
aMessageId -
aSender -
aConfirmationText -
Returns:

createRefreshLineMessage

public IChatRefreshMessage createRefreshLineMessage(int aMessageId,
                                                    IChatSender aSender,
                                                    java.lang.String aLogin,
                                                    java.lang.String aNickName,
                                                    java.lang.String aLineName,
                                                    java.lang.String aGreetingMessage,
                                                    java.lang.String aReceiver,
                                                    EnumStatus aStatus)
Creates refresh-line message.

Specified by:
createRefreshLineMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - fully qualified sender name [ip-address/netbios-name/login] (192.168.1.11/SOME/name1)
aLogin -
aNickName -
aLineName -
aGreetingMessage -
aStatus -
Returns:

createRefreshBoardMessage

public IChatRefreshBoardMessage createRefreshBoardMessage(int aMessageId,
                                                          IChatSender aSender)
Creates "refresh board" message.

Specified by:
createRefreshBoardMessage in interface IChatMessageFactory
Parameters:
aMessageId - - an incremental message id
aSender - - sender object
Returns:

createRefreshMessage

public IChatRefreshMessage createRefreshMessage(int aMessageId,
                                                IChatSender aSender,
                                                java.lang.String aLogin,
                                                java.lang.String aNickName,
                                                java.lang.String aGreetingMessage,
                                                java.lang.String aReceiver,
                                                EnumStatus aStatus)
Creates refresh message.

Specified by:
createRefreshMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - fully qualified sender name [ip-address/netbios-name/login] (192.168.1.11/SOME/name1)
aLogin -
aNickName -
aGreetingMessage -
aStatus -
Returns:

createRenameMessage

public IChatRenameMessage createRenameMessage(int aMessageId,
                                              IChatSender aSender,
                                              java.lang.String aNewNick)
Creates "rename" message.

Specified by:
createRenameMessage in interface IChatMessageFactory
Parameters:
aMessageId -
aSender -
aNewNick -
Returns:

createStatusMessage

public IChatStatusMessage createStatusMessage(int aMessageId,
                                              IChatSender aSender,
                                              EnumStatus aStatus,
                                              java.lang.String aGreetingMessage)
Creates STATUS message.

Specified by:
createStatusMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - a sender
aStatus - - a status
aGreetingMessage -
Returns:

createStatusReqMessage

public IChatStatusReqMessage createStatusReqMessage(int aMessageId,
                                                    IChatSender aSender)
Creates STATUS_REQ message.

Specified by:
createStatusReqMessage in interface IChatMessageFactory
Parameters:
aMessageId - - incremental message id
aSender - - a sender
Returns: