public class CommsMapComponent extends AbstractMapComponent implements android.content.SharedPreferences.OnSharedPreferenceChangeListener, CrashListener
Modifier and Type | Class and Description |
---|---|
static interface |
CommsMapComponent.DirectCotProcessor
Interface for
AbstractInput & AbstractStreaming to directly
process an event rather than using a CotDispatcher
If set, this is used prior rather than dispatching |
static class |
CommsMapComponent.ImportResult
Status of an import, either one of
SUCCESS - no problems
FAILURE - problems not importable.
|
class |
CommsMapComponent.MasterFileIO |
class |
CommsMapComponent.MasterMPIO |
static interface |
CommsMapComponent.PreSendProcessor
Interface for a single plugin to post process a CotEvent provided a list of uids.
|
AbstractMapComponent.OnAllComponentsCreatedCallback
CrashListener.CrashLogSection
Constructor and Description |
---|
CommsMapComponent() |
Modifier and Type | Method and Description |
---|---|
void |
addInput(java.lang.String uniqueKey,
android.os.Bundle portBundle,
int port,
java.lang.String mcastAddress) |
void |
addInputsChangedListener(CotServiceRemote.InputsChangedListener listener) |
void |
addOnCotEventListener(CotServiceRemote.CotEventListener cel)
Registers an additional CoT event listener to be used if the CoT Event is completely unknown by the
system.
|
void |
addOutput(java.lang.String uniqueKey,
android.os.Bundle portBundle,
int port,
java.lang.String mcastAddress) |
void |
addOutputsChangedListener(CotServiceRemote.OutputsChangedListener listener) |
void |
addStreaming(java.lang.String uniqueKey,
android.os.Bundle portBundle,
boolean missingParams,
java.lang.String hostname,
int port,
byte[] clientCert,
byte[] caCert,
java.lang.String certPassword,
java.lang.String caCertPassword,
java.lang.String authUser,
java.lang.String authPass) |
void |
addTcpInput(java.lang.String uniqueKey,
android.os.Bundle portBundle,
int port) |
void |
contactAdded(Contact c) |
void |
contactRemoved(Contact c) |
void |
cotMessageReceived(java.lang.String message,
java.lang.String rxEndpointId)
Invoked when a CoT Message has been received.
|
CloudClient |
createCloudClient(CloudIO io,
CloudIOProtocol proto,
java.lang.String host,
int port,
java.lang.String basePath,
java.lang.String user,
java.lang.String password) |
CloudClient |
createCloudClient(CloudIO io,
CloudIOProtocol proto,
java.lang.String host,
int port,
java.lang.String basePath,
java.lang.String user,
java.lang.String password,
byte[] caCerts,
java.lang.String s) |
Contact |
createKnownEndpointContact(java.lang.String name,
java.lang.String ipAddr,
int port) |
void |
destroyCloudClient(CloudClient client) |
java.lang.String |
generateCSR(java.util.Map<java.lang.String,java.lang.String> dnEntries,
java.lang.String privateKey,
java.lang.String password) |
java.lang.String |
generateKey(java.lang.String password) |
java.lang.String |
generateKeystore(java.lang.String certPem,
java.util.List<java.lang.String> caPem,
java.lang.String privateKeyPem,
java.lang.String password,
java.lang.String friendlyName) |
android.os.Bundle |
getAllPortsBundle()
Retrieve a listing of all the networks inputs/outputs/streaming connections
as an uber bundle.
|
CotService |
getCotService() |
static CommsMapComponent |
getInstance() |
void |
interfaceDown(NetInterface iface) |
void |
interfaceError(NetInterface iface,
NetInterfaceErrorCode errCode) |
void |
interfaceUp(NetInterface iface) |
CrashListener.CrashLogSection |
onCrash()
Take action upon crash, optionally return section for inclusion in crash log
|
void |
onCreate(android.content.Context context,
android.content.Intent intent,
MapView view)
Called when the component is first created
|
void |
onDestroyImpl(android.content.Context context,
MapView view)
This method is invoked as a subset of the onDestroy call as part of the
MapComponent lifecycle.
|
void |
onPause(android.content.Context context,
MapView view)
Default implementation for an abstract map component which does not respond to the onPause
state transition.
|
void |
onResume(android.content.Context context,
MapView view)
Default implementation for an abstract map component which does not respond to the onResume
state transition.
|
void |
onSharedPreferenceChanged(android.content.SharedPreferences prefs,
java.lang.String key) |
void |
onStart(android.content.Context context,
MapView view)
Default implementation for an abstract map component which does not respond to the onStart
state transition.
|
void |
onStop(android.content.Context context,
MapView view)
Default implementation for an abstract map component which does not respond to the onStop
state transition.
|
void |
registerCommsLogger(CommsLogger logger)
Registers a communication logger with the communication map component.
|
void |
registerDirectProcessor(CommsMapComponent.DirectCotProcessor dp)
Used internally by ATAK to set up the direct processing workflow for
CotEvent messages.
|
void |
registerFileIOProvider(FileIOProvider provider)
Registers a FileIOProvider with Commo
|
void |
registerPreSendProcessor(CommsMapComponent.PreSendProcessor psp)
Allows a enternal plugin to provide a capability to have one last look at a CotEvent
and uid list used.
|
void |
removeInput(java.lang.String uniqueKey) |
void |
removeInputsChangedListener(CotServiceRemote.InputsChangedListener listener) |
void |
removeOnCotEventListener(CotServiceRemote.CotEventListener cel)
Unregisters the previously registered additional CoT event listener.
|
void |
removeOutput(java.lang.String uniqueKey) |
void |
removeOutputsChangedListener(CotServiceRemote.OutputsChangedListener listener) |
CotPortListActivity.CotPort |
removeStreaming(java.lang.String uniqueKey) |
void |
sendCoTFailure(java.lang.String host,
int port,
java.lang.String errorReason) |
void |
sendCoTInternally(CotEvent cotEvent,
android.os.Bundle extras) |
void |
sendCoTToEndpoint(CotEvent e,
java.lang.String endpoint) |
void |
sendCoTToServersByMission(java.lang.String uniqueIfaceKey,
java.lang.String mission,
CotEvent e)
Send the specified CotEvent to all configured and connected TAK servers.
|
void |
sendCoTToServersOnly(java.lang.String uniqueIfaceKey,
CotEvent e)
Send the specified CotEvent to all configured and connected TAK servers.
|
void |
sendMissionPackage(java.lang.String[] contactUuids,
java.io.File file,
java.lang.String remoteFileName,
java.lang.String transferName,
MPSendListener listener) |
void |
sendMissionPackage(java.lang.String uniqueServerIfaceKey,
java.io.File file,
java.lang.String transferFilename,
MPSendListener listener) |
boolean |
setMissionPackageEnabled(boolean enabled,
int localPort,
int secureLocalPort) |
void |
setMissionPackageHttpPort(int missionPackageHttpPort) |
void |
setMissionPackageHttpsPort(int missionPackageHttpsPort) |
void |
setMissionPackageReceiveInitiator(MPReceiveInitiator rxInit) |
void |
setPPPIncluded(boolean included)
Enabled PPP as a tunnel for use with the trellisware wireless connector.
|
void |
setPreferStreamEndpoint(boolean preferStream)
Set the preferred endpoint for responding to calls to be streaming
over mesh.
|
void |
setServerVersion(java.lang.String connectString,
ServerVersion version) |
void |
syncFileTransfer(CommsFileTransferListener listener,
boolean forUpload,
java.net.URI uri,
byte[] caCert,
java.lang.String caCertPassword,
java.lang.String username,
java.lang.String password,
java.io.File localFile) |
void |
triggerIfaceRescan()
Used by plugins to trigger a rescan ahead of the wait period.
|
void |
unregisterCommsLogger(CommsLogger logger)
Allows a communication logger to be removed from the communication map component.
|
void |
unregisterFileIOProvider(FileIOProvider provider)
Unregisters a FileIOProvider from Commo
|
addOverlay, onConfigurationChanged, onCreateOptionsMenu, onDestroy, onOptionsItemSelected, onOptionsMenuClosed, onPrepareOptionsMenu, registerReceiver, removeOverlay, setOnAllComponentsCreatedCallback, unregisterReceiver
public void onCreate(android.content.Context context, android.content.Intent intent, MapView view)
MapComponent
onCreate
in interface MapComponent
context
- the context of the component (the MapActivity instance)intent
- the intent of the MapActivityview
- the main MapViewpublic void registerFileIOProvider(FileIOProvider provider)
provider
- The provider to registerpublic void unregisterFileIOProvider(FileIOProvider provider)
provider
- The provider to unregisterpublic void registerCommsLogger(CommsLogger logger)
logger
- the implementation of the comms logger.public void unregisterCommsLogger(CommsLogger logger)
public CrashListener.CrashLogSection onCrash()
CrashListener
onCrash
in interface CrashListener
public void setPreferStreamEndpoint(boolean preferStream)
public void triggerIfaceRescan()
public void onSharedPreferenceChanged(android.content.SharedPreferences prefs, java.lang.String key)
onSharedPreferenceChanged
in interface android.content.SharedPreferences.OnSharedPreferenceChangeListener
public static CommsMapComponent getInstance()
public CotService getCotService()
public void addInputsChangedListener(CotServiceRemote.InputsChangedListener listener)
public void removeInputsChangedListener(CotServiceRemote.InputsChangedListener listener)
public void addOutputsChangedListener(CotServiceRemote.OutputsChangedListener listener)
public void removeOutputsChangedListener(CotServiceRemote.OutputsChangedListener listener)
public android.os.Bundle getAllPortsBundle()
Bundle b = getAllPortsBundle(); Bundle[] streams = b.getParcelableArray("streams", null); Bundle[] outputs = b.getParcelableArray("outputs", null); Bundle[] inputs = b.getParcelableArray("inputs", null); where an output bundle contains the following CotPort.DESCRIPTION_KEY CotPort.ENABLED_KEY CotPort.CONNECTED_KEY CotPort.CONNECT_STRING_KEY
public void addOnCotEventListener(CotServiceRemote.CotEventListener cel)
cel
- the cot event listenerpublic void removeOnCotEventListener(CotServiceRemote.CotEventListener cel)
cel
- the cot event listenerpublic void onDestroyImpl(android.content.Context context, MapView view)
AbstractMapComponent
onDestroyImpl
in class AbstractMapComponent
public void onStart(android.content.Context context, MapView view)
AbstractMapComponent
onStart
in interface MapComponent
onStart
in class AbstractMapComponent
context
- the context of the component (the MapActivity instance)view
- the main MapViewpublic void onStop(android.content.Context context, MapView view)
AbstractMapComponent
onStop
in interface MapComponent
onStop
in class AbstractMapComponent
context
- the context of the component (the MapActivity instance)view
- the main MapViewpublic void onPause(android.content.Context context, MapView view)
AbstractMapComponent
onPause
in interface MapComponent
onPause
in class AbstractMapComponent
context
- the context of the component (the MapActivity instance)view
- the main MapViewpublic void onResume(android.content.Context context, MapView view)
AbstractMapComponent
onResume
in interface MapComponent
onResume
in class AbstractMapComponent
context
- the context of the component (the MapActivity instance)view
- the main MapViewpublic void registerDirectProcessor(CommsMapComponent.DirectCotProcessor dp)
dp
- implementation of the DirectCotProcessor which is CotMapAdapter only.public void registerPreSendProcessor(CommsMapComponent.PreSendProcessor psp)
psp
- the Presend Processor triggered right before the message is sent down into the
sending libraries.public void setPPPIncluded(boolean included)
included
- true if ppp[0..4] should be enabled or false if it should be disabled.public void addInput(java.lang.String uniqueKey, android.os.Bundle portBundle, int port, java.lang.String mcastAddress)
public void addTcpInput(java.lang.String uniqueKey, android.os.Bundle portBundle, int port)
public void removeInput(java.lang.String uniqueKey)
public void addOutput(java.lang.String uniqueKey, android.os.Bundle portBundle, int port, java.lang.String mcastAddress)
public void removeOutput(java.lang.String uniqueKey)
public void addStreaming(java.lang.String uniqueKey, android.os.Bundle portBundle, boolean missingParams, java.lang.String hostname, int port, byte[] clientCert, byte[] caCert, java.lang.String certPassword, java.lang.String caCertPassword, java.lang.String authUser, java.lang.String authPass)
public CotPortListActivity.CotPort removeStreaming(java.lang.String uniqueKey)
public void sendCoTToEndpoint(CotEvent e, java.lang.String endpoint)
public void sendCoTToServersByMission(java.lang.String uniqueIfaceKey, java.lang.String mission, CotEvent e)
uniqueIfaceKey
- the unique key identifier specifying a configured
streaming interface, or null to send to all active
streaming interfacesmission
- the mission identifier used to route the messagee
- valid CotEvent to sendpublic void sendCoTToServersOnly(java.lang.String uniqueIfaceKey, CotEvent e)
uniqueIfaceKey
- the unique key identifier specifying a configured
streaming interface, or null to send to all active
streaming interfacese
- valid CotEvent to sendpublic void sendCoTFailure(java.lang.String host, int port, java.lang.String errorReason)
public void cotMessageReceived(java.lang.String message, java.lang.String rxEndpointId)
message
- the CoT message that was receivedrxEndpointId
- identifier of NetworkInterface upon which
the message was received, if known, or null
if not knownpublic void sendCoTInternally(CotEvent cotEvent, android.os.Bundle extras)
public void syncFileTransfer(CommsFileTransferListener listener, boolean forUpload, java.net.URI uri, byte[] caCert, java.lang.String caCertPassword, java.lang.String username, java.lang.String password, java.io.File localFile) throws CommoException, java.io.IOException, java.lang.InterruptedException
CommoException
java.io.IOException
java.lang.InterruptedException
public void setMissionPackageReceiveInitiator(MPReceiveInitiator rxInit)
public boolean setMissionPackageEnabled(boolean enabled, int localPort, int secureLocalPort)
public void sendMissionPackage(java.lang.String[] contactUuids, java.io.File file, java.lang.String remoteFileName, java.lang.String transferName, MPSendListener listener) throws java.net.UnknownServiceException, CommoException
java.net.UnknownServiceException
CommoException
public void sendMissionPackage(java.lang.String uniqueServerIfaceKey, java.io.File file, java.lang.String transferFilename, MPSendListener listener) throws java.net.UnknownServiceException, CommoException
java.net.UnknownServiceException
CommoException
public Contact createKnownEndpointContact(java.lang.String name, java.lang.String ipAddr, int port)
public void contactAdded(Contact c)
public void contactRemoved(Contact c)
public void interfaceDown(NetInterface iface)
public void interfaceUp(NetInterface iface)
public void interfaceError(NetInterface iface, NetInterfaceErrorCode errCode)
public void setServerVersion(java.lang.String connectString, ServerVersion version)
public java.lang.String generateKey(java.lang.String password)
public java.lang.String generateKeystore(java.lang.String certPem, java.util.List<java.lang.String> caPem, java.lang.String privateKeyPem, java.lang.String password, java.lang.String friendlyName)
public java.lang.String generateCSR(java.util.Map<java.lang.String,java.lang.String> dnEntries, java.lang.String privateKey, java.lang.String password)
public CloudClient createCloudClient(CloudIO io, CloudIOProtocol proto, java.lang.String host, int port, java.lang.String basePath, java.lang.String user, java.lang.String password)
public CloudClient createCloudClient(CloudIO io, CloudIOProtocol proto, java.lang.String host, int port, java.lang.String basePath, java.lang.String user, java.lang.String password, byte[] caCerts, java.lang.String s)
public void destroyCloudClient(CloudClient client)
public void setMissionPackageHttpsPort(int missionPackageHttpsPort)
public void setMissionPackageHttpPort(int missionPackageHttpPort)