com.jakeapp.jake.ics.msgservice
Interface IMsgService

All Known Implementing Classes:
FriendsOnlyMsgService, MockMsgAndStatusService

public interface IMsgService

The task of the InterClient Communication Service (ICService) is to provide a communication layer based on the network for communication between users based on messages and objects.

userid: A way of identifying the user within the used network protocol. example: user@host

network service: The implementation of IICService use some sort of Interclient Communication protocol. We reference to this underlying system as network service. examples: XMPP, TCP-Sockets, ...

Author:
johannes

Method Summary
 IMsgService getFriendMsgService()
          get a MsgService that can only send and receive from the UserIds in IUsersService
 void registerLoginStateListener(ILoginStateListener loginListener)
           
 void registerReceiveMessageListener(IMessageReceiveListener receiveListener)
          Registers a callback for the event that a message is received.
 java.lang.Boolean sendMessage(UserId to_userid, java.lang.String content)
          Sends a message to another user.
 void unRegisterLoginStateListener(ILoginStateListener loginListener)
           
 void unRegisterReceiveMessageListener(IMessageReceiveListener receiveListener)
          Unregisteres a previously registered callback.
 

Method Detail

sendMessage

java.lang.Boolean sendMessage(UserId to_userid,
                              java.lang.String content)
                              throws NetworkException,
                                     TimeoutException,
                                     NoSuchUseridException,
                                     OtherUserOfflineException
Sends a message to another user.

Parameters:
to_userid - Userid to send to
content - Full message content as String
Returns:
wether the message could be sent. Does not guarantee the object has been retrieved.
Throws:
NetworkException - if the network connection is down
NotLoggedInException - if the user is not logged in
TimeoutException - if a timeout occured
NoSuchUseridException
OtherUserOfflineException

registerReceiveMessageListener

void registerReceiveMessageListener(IMessageReceiveListener receiveListener)
Registers a callback for the event that a message is received. These will be kept over logouts.

Parameters:
receiveListener - object to be called

registerLoginStateListener

void registerLoginStateListener(ILoginStateListener loginListener)

getFriendMsgService

IMsgService getFriendMsgService()
get a MsgService that can only send and receive from the UserIds in IUsersService

Returns:

unRegisterReceiveMessageListener

void unRegisterReceiveMessageListener(IMessageReceiveListener receiveListener)
Unregisteres a previously registered callback.

Parameters:
receiveListener - previously registered callback.

unRegisterLoginStateListener

void unRegisterLoginStateListener(ILoginStateListener loginListener)


Copyright © 2011. All Rights Reserved.