org.omus.core
Class MessagingManager

java.lang.Object
  |
  +--org.omus.core.MessagingManager

public class MessagingManager
extends java.lang.Object

Handles the delivery of messages. The MessagingManager is intended for messages aimed at targets outside the current group. For messages that you want to send to clients within the current group use sentToClients in Group or sendToClient in User instead. The MessagingManager is similar to the ActionScript Messenger object in the Client API.


Method Summary
 void publish(Message msg)
          Sends a message to all users that have subscribed to the subject of this message.
 void sendToAll(Message msg)
          Sends a message to all users who are currently logged into the server.
 void sendToGroup(Message msg, java.lang.String groupName)
          Sends a message to all the members of a particular group.
 void sendToUser(Message msg, java.lang.String recipient)
          Sends a message to one user.
 void subscribe(User user, java.lang.String subject)
          Subscribes the specified user to all messages with the specified subject.
 void unsubscribe(User user, java.lang.String subject)
          Unsubscribes the specified user from all messages with the specified subject.
 void unsubscribeAll(User user)
          Unsubscribes the specified user from all messages.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sendToUser

public void sendToUser(Message msg,
                       java.lang.String recipient)
Sends a message to one user. It will be passed to the messageToUser method in org.omus.ext.GroupExtension in the group that the user is currently member of and then forwarded to the client and received in the onMessage event handler in the client side Messenger object.

sendToGroup

public void sendToGroup(Message msg,
                        java.lang.String groupName)
Sends a message to all the members of a particular group. It will be passed to the messageToGroup method in org.omus.ext.GroupExtension in the target group and then forwarded to the client and received in the onMessage event handler in the client side Messenger object.

sendToAll

public void sendToAll(Message msg)
Sends a message to all users who are currently logged into the server. It will be passed to the messageToUser method in org.omus.ext.GroupExtension for all the recipients and then forwarded to the clients and received in the onMessage event handler in the client side Messenger object.

publish

public void publish(Message msg)
Sends a message to all users that have subscribed to the subject of this message. It will be passed to the messageToUser method in org.omus.ext.GroupExtension for all the recipients and then forwarded to the clients and received in the onMessage event handler in the client side Messenger object.

subscribe

public void subscribe(User user,
                      java.lang.String subject)
Subscribes the specified user to all messages with the specified subject.

unsubscribe

public void unsubscribe(User user,
                        java.lang.String subject)
Unsubscribes the specified user from all messages with the specified subject.

unsubscribeAll

public void unsubscribeAll(User user)
Unsubscribes the specified user from all messages.