package edu.cmu.sv.ws.ssnoc.data.dao;

import java.util.List;

import edu.cmu.sv.ws.ssnoc.data.po.MessagePO;

/**
 * Interface specifying the contract that all implementations will implement to
 * provide persistence of Status Crumb information in the system.
 * 
 */
public interface IMessageDAO {
	/**
	 * This method will save the information of the wall message into the database.
	 * 
	 * @param MessagePO
	 *            - Status Crumb information to be saved.
	 */
	long saveWallMessage(MessagePO messagePO);
	
	/**
	 * This method will save the information of the chat message into the database.
	 * 
	 * @param MessagePO
	 *            - Status Crumb information to be saved.
	 */
	long saveChatMessage(MessagePO messagePO);
	
	/**
	 * This method will load all wall message in the
	 * database.
	 * 
	 * @return - List of all  wall messages.
	 */
	List<MessagePO> loadWallMessages();
	

	/**
	 * This method will load all chat message in the
	 * database.
	 * 
	 * @return - List of all  chat messages.
	 */
	List<MessagePO> loadChatMessages();
	
	/**
	 * This method will load a particular message by it's id.
	 * 
	 * @param messageId
	 *            - message id to search for.
	 * 
	 * @return - messagePO.
	 */

	MessagePO loadMessageById(long messageId);


	/**
	 * load chat messages exchanged between two users
	 * 
	 * @param userName1
	 * 			- the sender
	 * @param userName2
	 * 			- the receiver
	 * 
	 * @return - List of messages
	 */
	List<MessagePO> getAllChatMessagesForPeers(String userName1, String userName2);
	
	/**
	 * save a new incoming chat message
	 */
	void savePrivateChatMessage(String senderName, String receiverName, MessagePO po);
}

@@ -255,18 +255,17 @@
 stem.%0A *
- 
 %0A
+
  */%0Apubl
@@ -372,33 +372,32 @@
 he database.%0A%09 *
- 
 %0A%09 * @param Mess
@@ -498,34 +498,33 @@
 ePO messagePO);%0A
-%09
 %0A
+
 %09/**%0A%09 * This me
@@ -592,25 +592,24 @@
 atabase.%0A%09 *
- 
 %0A%09 * @param 
@@ -722,18 +722,17 @@
 agePO);%0A
-%09
 %0A
+
 %09/**%0A%09 *
@@ -787,33 +787,32 @@
  * database.%0A%09 *
- 
 %0A%09 * @return - L
@@ -880,18 +880,17 @@
 ages();%0A
-%09
 %0A
+
 %0A%09/**%0A%09 
@@ -950,25 +950,24 @@
 atabase.%0A%09 *
- 
 %0A%09 * @return
@@ -1039,18 +1039,17 @@
 ages();%0A
-%09
 %0A
+
 %09/**%0A%09 *
@@ -1103,25 +1103,24 @@
 it's id.%0A%09 *
- 
 %0A%09 * @param 
@@ -1171,25 +1171,24 @@
 rch for.%0A%09 *
- 
 %0A%09 * @return
@@ -1308,25 +1308,24 @@
 wo users%0A%09 *
- 
 %0A%09 * @param 
@@ -1400,17 +1400,16 @@
 iver%0A%09 *
- 
 %0A%09 * @re
@@ -1518,17 +1518,16 @@
 Name2);%0A
-%09
 %0A%09/**%0A%09 

Remove trailing whitespace