public final class GeoChatService extends java.lang.Object implements CotServiceRemote.CotEventListener, CotServiceRemote.ConnectionListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_CHATROOM_NAME
The translation of these is only used in one place, but all of the backend business logic
requires these to be in english
|
static java.lang.String |
DEFAULT_CHATROOM_NAME_LEGACY |
static java.lang.String |
TAG |
Modifier and Type | Method and Description |
---|---|
void |
exportHistory(java.lang.String filename) |
static GeoChatService |
getInstance() |
android.os.Bundle |
getMessage(long rowIdOfMessage,
long rowIdOfGroup) |
void |
onCotEvent(CotEvent cotEvent,
android.os.Bundle bundle)
Callback for when a CoT event is received.
|
void |
onCotServiceConnected(android.os.Bundle fullServiceState) |
void |
onCotServiceDisconnected() |
java.util.List<java.lang.String> |
persistMessage(android.os.Bundle cotMessage)
Given a CoT message in bundle form, add the message to the chat database and return the list
of ids in string form.
|
void |
sendMessage(android.os.Bundle cotMessage,
IndividualContact destination)
Given a cot message bundle and a destination, send the message out to
to the appropriate destination.
|
public static final java.lang.String TAG
public static final java.lang.String DEFAULT_CHATROOM_NAME
public static final java.lang.String DEFAULT_CHATROOM_NAME_LEGACY
public static GeoChatService getInstance()
public void onCotEvent(CotEvent cotEvent, android.os.Bundle bundle)
CotServiceRemote.CotEventListener
onCotEvent
in interface CotServiceRemote.CotEventListener
cotEvent
- the cot event.bundle
- the bundle which contains information such as where it was from.public void onCotServiceConnected(android.os.Bundle fullServiceState)
onCotServiceConnected
in interface CotServiceRemote.ConnectionListener
fullServiceState
- (Bundle[]) fullServiceState.getParcelableArray("streams") which appears to be and array of
all of the current TAK servers bundle made up of CotPort.DESCRIPTION_KEY,
CotPort.ENABLED_KEY, CotPort.CONNECTED_KEY
lifted from CotStreamListener
fullServiceState can also contain
(Bundle[]) fullServiceState.getParcelableArray(getPortType()) which follows the same rules
above.
lifted from CotPortListActivitypublic void onCotServiceDisconnected()
onCotServiceDisconnected
in interface CotServiceRemote.ConnectionListener
public void sendMessage(android.os.Bundle cotMessage, IndividualContact destination)
cotMessage,
- the chat message in a bundle form.destination
- individual contact destination to send the chat message to.public android.os.Bundle getMessage(long rowIdOfMessage, long rowIdOfGroup)
public java.util.List<java.lang.String> persistMessage(android.os.Bundle cotMessage)
cotMessage
- the message bundlepublic void exportHistory(java.lang.String filename)