messaging
Class MessagingService

java.lang.Object
  extended by messaging.MessagingService

public abstract class MessagingService
extends Object


Field Summary
(package private)  GroupService groupService
          As messages imply group changes, the MessagingService must also communicate with the GroupService.
(package private)  Mailbox mailbox
          Messages are stored and retrieved via the Mailbox repository component.
(package private)  NetworkService networkService
          All messages are sent and received via the NetworkService, which is the one that contact/is contacted by the remote services.
(package private)  UserIO userIO
          The user must be notified about new messages.
 
Constructor Summary
MessagingService()
           
 
Method Summary
protected abstract  void checkForMessages()
          The MessagingService contacts the remote centralized Messaging service to retrieve any new messages.
abstract  List<Message> getAllMessages()
          A wrapper over the method offered by Mailbox, it provides to other components a list of all the messages in the user's mailbox.
abstract  List<Message> getMessages(MessageQueryCriteria criteria)
          A wrapper over the method offered by Mailbox, it provides a subset of messages of the logged in user based on the given criteria.
protected abstract  void informMessage(Message message)
          Informs the GroupService about a message it has to process.
abstract  void receiveMessage(Message message)
          The MessagingService receives a new Message from the remote centralized Messaging service.
abstract  void sendMessage(Message message)
          Sends a message to another user and also stores it in the Mailbox.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mailbox

Mailbox mailbox
Messages are stored and retrieved via the Mailbox repository component.


groupService

GroupService groupService
As messages imply group changes, the MessagingService must also communicate with the GroupService.


networkService

NetworkService networkService
All messages are sent and received via the NetworkService, which is the one that contact/is contacted by the remote services.


userIO

UserIO userIO
The user must be notified about new messages.

Constructor Detail

MessagingService

public MessagingService()
Method Detail

receiveMessage

public abstract void receiveMessage(Message message)
The MessagingService receives a new Message from the remote centralized Messaging service.

Parameters:
message - - the message (invitation, ownership transfer, reply)

sendMessage

public abstract void sendMessage(Message message)
Sends a message to another user and also stores it in the Mailbox. The message will be sent via the NetworkService to the remote Messaging Service, which will forward it to the destination user.

Parameters:
message - - the message (invitation, ownership transfer, reply)

informMessage

protected abstract void informMessage(Message message)
Informs the GroupService about a message it has to process.

Parameters:
message -

checkForMessages

protected abstract void checkForMessages()
The MessagingService contacts the remote centralized Messaging service to retrieve any new messages. The message will still be kept on the remote service after this retrieval. This method returns nothing, the NetworkingService will inform the MessagingService when it receives the reply from the remote service.


getAllMessages

public abstract List<Message> getAllMessages()
A wrapper over the method offered by Mailbox, it provides to other components a list of all the messages in the user's mailbox.

Returns:
a list of all the user's messages

getMessages

public abstract List<Message> getMessages(MessageQueryCriteria criteria)
A wrapper over the method offered by Mailbox, it provides a subset of messages of the logged in user based on the given criteria.

Parameters:
criteria - - filtering constraints for the list of messages (certain interval, certain destination etc)
Returns:
a list of Message objects