pl.mn.communicator
Class DefaultMessageService

java.lang.Object
  extended by pl.mn.communicator.DefaultMessageService
All Implemented Interfaces:
IMessageService

public class DefaultMessageService
extends java.lang.Object
implements IMessageService

Created on 2004-11-28 The default implementation of IMessageService.

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

Constructor Summary
DefaultMessageService(Session session)
           
 
Method Summary
 void addMessageListener(MessageListener messageListener)
          Adds MessageListener object to the list that will be notified of message related events.
 IGroupChat createGroupChat()
           
 IGroupChat createGroupChat(int[] uins)
           
 ISingleChat createSingleChat(int uin)
          Create chat with some Gadu-Gadu user.
protected  void notifyMessageArrived(IIncommingMessage incommingMessage)
           
protected  void notifyMessageDelivered(int uin, int messageID, MessageStatus messageStatus)
           
protected  void notifyMessageSent(IOutgoingMessage outgoingMessage)
           
 void removeMessageListener(MessageListener messageListener)
          Remove MessageListener from the list that will be notified of message related events.
 void sendMessage(IOutgoingMessage outgoingMessage)
          Invocation of this method sends the message to the Gadu-Gadu server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMessageService

DefaultMessageService(Session session)
Method Detail

sendMessage

public void sendMessage(IOutgoingMessage outgoingMessage)
                 throws GGException
Description copied from interface: IMessageService
Invocation of this method sends the message to the Gadu-Gadu server.

Specified by:
sendMessage in interface IMessageService
Parameters:
outgoingMessage - the message that will be sent to the server.
Throws:
GGException - if there is an error while sending message to server.
GGSessionException - if user is not logged in.
See Also:
pl.mn.communicator.IMessageService#sendMessage(pl.mn.communicator.OutgoingMessage)

createSingleChat

public ISingleChat createSingleChat(int uin)
Description copied from interface: IMessageService
Create chat with some Gadu-Gadu user.

Specified by:
createSingleChat in interface IMessageService
Parameters:
uin - the Gadu-Gadu number of the user one wants to chat with
Returns:
chat object that represents chat with some user.
See Also:
IMessageService.createSingleChat(int)

createGroupChat

public IGroupChat createGroupChat()
Specified by:
createGroupChat in interface IMessageService
See Also:
IMessageService.createGroupChat()

createGroupChat

public IGroupChat createGroupChat(int[] uins)
Specified by:
createGroupChat in interface IMessageService
See Also:
IMessageService.createGroupChat(int[])

addMessageListener

public void addMessageListener(MessageListener messageListener)
Description copied from interface: IMessageService
Adds MessageListener object to the list that will be notified of message related events.

Specified by:
addMessageListener in interface IMessageService
Parameters:
messageListener - the MessageListener instance to be notified.
See Also:
IMessageService.addMessageListener(pl.mn.communicator.event.MessageListener)

removeMessageListener

public void removeMessageListener(MessageListener messageListener)
Description copied from interface: IMessageService
Remove MessageListener from the list that will be notified of message related events.

Specified by:
removeMessageListener in interface IMessageService
Parameters:
messageListener - the MessageListener instance that will no longer be notified.
See Also:
IMessageService.removeMessageListener(pl.mn.communicator.event.MessageListener)

notifyMessageSent

protected void notifyMessageSent(IOutgoingMessage outgoingMessage)

notifyMessageArrived

protected void notifyMessageArrived(IIncommingMessage incommingMessage)

notifyMessageDelivered

protected void notifyMessageDelivered(int uin,
                                      int messageID,
                                      MessageStatus messageStatus)


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