Package org.astrogrid.samp.client
Interface MessageHandler
-
- All Known Implementing Classes:
AbstractMessageHandler
public interface MessageHandler
Interface for a client which wishes to receive messages. In most cases it is more convenient to subclass the abstract classAbstractMessageHandler
than to implement this interface directly.- Since:
- 16 Jul 2008
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map
getSubscriptions()
Returns a Subscriptions map corresponding to the messages handled by this object.void
receiveCall(HubConnection connection, java.lang.String senderId, java.lang.String msgId, Message message)
Processes a message which does require a response.void
receiveNotification(HubConnection connection, java.lang.String senderId, Message message)
Processes a message which does not require a response.
-
-
-
Method Detail
-
getSubscriptions
java.util.Map getSubscriptions()
Returns a Subscriptions map corresponding to the messages handled by this object. Only messages with MTypes which match the keys of this map will be passed to this object.- Returns:
Subscriptions
-like map
-
receiveNotification
void receiveNotification(HubConnection connection, java.lang.String senderId, Message message) throws java.lang.Exception
Processes a message which does not require a response.- Parameters:
connection
- hub connectionsenderId
- public ID of client which sent the messagemessage
- message- Throws:
java.lang.Exception
-
receiveCall
void receiveCall(HubConnection connection, java.lang.String senderId, java.lang.String msgId, Message message) throws java.lang.Exception
Processes a message which does require a response. Implementations should make sure that a subsequent call toconnection.reply()
is made using the suppliedmsgId
.- Parameters:
connection
- hub connectionsenderId
- public ID of client which sent the messagemsgId
- message IDmessage
- message- Throws:
java.lang.Exception
-
-