Class ChattingService
- java.lang.Object
-
- in.cs699.tensors.delagram.chatting_service.service.ChattingService
-
@Service public class ChattingService extends Object
This is a service class that supports the chat functionalities- Author:
- swaroop_nath
-
-
Constructor Summary
Constructors Constructor Description ChattingService()initializes the SQLite database and also starts the receiving thread
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeleteMessage(String timestamp, String sender, String receiver, String text)A function which deletes a particular message from the databaseVector<MyMessage>getAllMessages(String user)A function which returns all the messages sent or received for a particular user from SQLite databasevoiduploadMessage(String text, String timestamp, String sender, String receiver)Function call to upload message on firebase and SQLite database
-
-
-
Method Detail
-
uploadMessage
public void uploadMessage(String text, String timestamp, String sender, String receiver)
Function call to upload message on firebase and SQLite database- Parameters:
text- The message texttimestamp- The message timestampsender- The sender of the messagereceiver- The receiver of the message
-
getAllMessages
public Vector<MyMessage> getAllMessages(String user)
A function which returns all the messages sent or received for a particular user from SQLite database- Parameters:
user- the user for whom the messages are to be fetched- Returns:
- A Vector of messages
-
deleteMessage
public void deleteMessage(String timestamp, String sender, String receiver, String text)
A function which deletes a particular message from the database- Parameters:
timestamp- The message timestampsender- The sender of the messagereceiver- The receiver of the messagetext- The message text
-
-