pl.mn.communicator
Class OutgoingMessage

java.lang.Object
  extended by pl.mn.communicator.AbstractMessage
      extended by pl.mn.communicator.OutgoingMessage
All Implemented Interfaces:
IMessage, IOutgoingMessage

public class OutgoingMessage
extends AbstractMessage
implements IOutgoingMessage

The class that represents message that will be sent to the Gadu-Gadu server.

Created on 2004-11-21

Version:
$Id: OutgoingMessage.java,v 1.1 2005/11/05 23:34:52 winnetou25 Exp $
Author:
Mateusz Szczap

Field Summary
 
Fields inherited from class pl.mn.communicator.AbstractMessage
m_messageBody, m_messageClass, m_messageID, m_recipientUin
 
Method Summary
 void addAdditionalRecipient(int recipientUin)
           
static OutgoingMessage createChatMessage(int uin, java.lang.String messageBody)
          Creates an outgoing message that is a part of a previous conversation
static OutgoingMessage createMessageWithoutConfirmation(int uin, java.lang.String messageBody)
          Creates an outgoing message and sets a special flag that will notify Gadu-Gadu server that we do not want to receive the confirmation from the server that this message was delivered to the user it is addressed.
static OutgoingMessage createNewMessage(int uin, java.lang.String messageBody)
          Creates an outgoing message that will be poped up in a new window.
static OutgoingMessage createPingMessage(int uin)
          Creates an outgoing message that only pings the user.
 int[] getAdditionalRecipients()
           
 int[] getAllRecipients()
           
 void removeAdditionalRecipient(int recipientUin)
           
 void setMessageBody(java.lang.String messageBody)
          Use this method if you want to set new message body on this message.
 void setRecipientUin(int recipientUin)
          Use this method if you want to set new uin on this message.
 
Methods inherited from class pl.mn.communicator.AbstractMessage
getMessageBody, getMessageClass, getMessageID, getRecipientUin, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface pl.mn.communicator.IMessage
getMessageBody, getMessageClass, getMessageID, getRecipientUin
 

Method Detail

createNewMessage

public static OutgoingMessage createNewMessage(int uin,
                                               java.lang.String messageBody)
Creates an outgoing message that will be poped up in a new window.

Parameters:
uin - Gadu-Gadu number to of the user to whom this message is addressed.
messageBody - the body of the message.
Returns:
OutgoingMessage outgoing message.

createChatMessage

public static OutgoingMessage createChatMessage(int uin,
                                                java.lang.String messageBody)
Creates an outgoing message that is a part of a previous conversation

Parameters:
uin - Gadu-Gadu number to of the user to whom this message is addressed.
messageBody - the body of the message.
Returns:
OutgoingMessage outgoing message.

createPingMessage

public static OutgoingMessage createPingMessage(int uin)
Creates an outgoing message that only pings the user.

Parameters:
uin - Gadu-Gadu number to of the user to whom this ping is addressed.
Returns:
OutgoingMessage outgoing message.

createMessageWithoutConfirmation

public static OutgoingMessage createMessageWithoutConfirmation(int uin,
                                                               java.lang.String messageBody)
Creates an outgoing message and sets a special flag that will notify Gadu-Gadu server that we do not want to receive the confirmation from the server that this message was delivered to the user it is addressed.

Parameters:
uin - Gadu-Gadu number to of the user to whom this message is addressed.
messageBody - the body of the message.
Returns:
OutgoingMessage outgoing message.

setMessageBody

public void setMessageBody(java.lang.String messageBody)
Use this method if you want to set new message body on this message.

Specified by:
setMessageBody in interface IOutgoingMessage
Parameters:
messageBody - the new message body.
Throws:
java.lang.NullPointerException - if the messageBody object is null.

setRecipientUin

public void setRecipientUin(int recipientUin)
Use this method if you want to set new uin on this message.

Specified by:
setRecipientUin in interface IOutgoingMessage
Parameters:
uin - the new Gadu-Gadu number to whom this message will be addressed.
Throws:
java.lang.IllegalArgumentException - if the uin is a negative value.

addAdditionalRecipient

public void addAdditionalRecipient(int recipientUin)
Specified by:
addAdditionalRecipient in interface IOutgoingMessage

removeAdditionalRecipient

public void removeAdditionalRecipient(int recipientUin)
Specified by:
removeAdditionalRecipient in interface IOutgoingMessage

getAdditionalRecipients

public int[] getAdditionalRecipients()
Specified by:
getAdditionalRecipients in interface IOutgoingMessage

getAllRecipients

public int[] getAllRecipients()
Specified by:
getAllRecipients in interface IOutgoingMessage


Copyright 2004-2004-2005 SourceForge.net. All Rights Reserved.