public class ChatDatabase
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG |
static int |
VERSION |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Long> |
addChat(android.os.Bundle chatMessage)
Ability to take a correctly formatted Chat Bundle and add it to the ChatDatabase.
|
void |
addGroup(GroupContact gc,
boolean local) |
java.util.List<java.lang.String> |
getAvailableConversations()
Obtain the list of conversation identifiers.
|
android.os.Bundle |
getChatMessage(java.lang.String messageId)
Given a specific message identifier, retrieve the chat message associated.
|
java.util.List<java.lang.String> |
getGroupInfo(java.lang.String conversationId)
Returns the group information for a specific conversation identifier.
|
java.util.List<android.os.Bundle> |
getHistory(java.lang.String conversationId)
Returns the history of a given conversation as a list of bundles.
|
static ChatDatabase |
getInstance(android.content.Context ignored)
Get an instance of the ChatDabase for search, retrieval and archive of chat messages.
|
android.os.Bundle |
getMessage(long id,
java.lang.String table)
Given an id and a table, return the bundle for a specific message.
|
java.util.List<java.lang.String> |
getPersistedConversationIds()
Returns a list of the persisted conversation identifiers.
|
boolean |
removeChatMessage(java.lang.String messageId)
The ability to remove a chat message from the database given a message identifier.
|
void |
removeGroup(java.lang.String conversationId) |
static void |
writeToFile(java.lang.String filename,
java.util.List<java.util.List<java.lang.String>> resultTable)
Given a results table, write the values to a file.
|
public static final java.lang.String TAG
public static final int VERSION
public static ChatDatabase getInstance(android.content.Context ignored)
ignored
- no longer used.public java.util.List<java.lang.Long> addChat(android.os.Bundle chatMessage)
chatMessage
- a bundle created from ChatMessage.toBundle() or a bundle containing the
following keys - "conversationName", "conversationId", "messageId",
"senderUid", "senderCallsign", "parent", "paths", "deleteChild",
"groupOwner", "message", statuspublic void addGroup(GroupContact gc, boolean local)
public void removeGroup(java.lang.String conversationId)
public java.util.List<android.os.Bundle> getHistory(java.lang.String conversationId)
conversationId
- the chat conversation identificationpublic java.util.List<java.lang.String> getPersistedConversationIds()
public java.util.List<java.lang.String> getGroupInfo(java.lang.String conversationId)
conversationId
- the conversationIdpublic java.util.List<java.lang.String> getAvailableConversations()
public android.os.Bundle getMessage(long id, java.lang.String table)
id
- the given message idtable
- the table to pull frompublic android.os.Bundle getChatMessage(java.lang.String messageId)
messageId
- the messageIdpublic boolean removeChatMessage(java.lang.String messageId)
messageId
- the message identifier.public static void writeToFile(java.lang.String filename, java.util.List<java.util.List<java.lang.String>> resultTable) throws java.io.IOException
filename
- the filename to write toresultTable
- the results tablejava.io.IOException
- error if the write failed.