Class ShortMessageService
- java.lang.Object
- 
- org.activecomponents.shortmessages.ShortMessageService
 
- 
- All Implemented Interfaces:
- IShortMessageService
 
 public class ShortMessageService extends java.lang.Object implements IShortMessageService Service that sends messages to followers. - Follower is online: directly call a client message - Follower is offline: add to his postbox
- 
- 
Field SummaryFields Modifier and Type Field Description protected IInternalAccesscomponentThe component.protected java.util.Map<User,java.util.Collection<ShortMessage>>postboxesThe post boxes of the users.
 - 
Constructor SummaryConstructors Constructor Description ShortMessageService()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddMessageToPostbox(User user, ShortMessage message)Add a message to a postbox of a user.IFuture<java.util.Collection<ShortMessage>>getMessages(java.lang.String usertoken)Get all messages.voidinit()Init of serviceIFuture<java.lang.Void>sendMessage(java.lang.String text, java.lang.String usertoken)Send a message to the followers.
 
- 
- 
- 
Field Detail- 
componentprotected IInternalAccess component The component.
 - 
postboxesprotected java.util.Map<User,java.util.Collection<ShortMessage>> postboxes The post boxes of the users.
 
- 
 - 
Method Detail- 
initpublic void init() Init of service
 - 
sendMessagepublic IFuture<java.lang.Void> sendMessage(java.lang.String text, java.lang.String usertoken) Send a message to the followers.- Specified by:
- sendMessagein interface- IShortMessageService
- Parameters:
- text- The text.
- sender- The sender.
 
 - 
getMessagespublic IFuture<java.util.Collection<ShortMessage>> getMessages(java.lang.String usertoken) Get all messages.- Specified by:
- getMessagesin interface- IShortMessageService
- Parameters:
- usertoken- The user token.
- Returns:
- the messages.
 
 - 
addMessageToPostboxprotected void addMessageToPostbox(User user, ShortMessage message) Add a message to a postbox of a user.- Parameters:
- user- The user.
- message- The message.
 
 
- 
 
-