public abstract class MapItemImporter extends CotEventTypeImporter
Modifier and Type | Field and Description |
---|---|
protected android.content.Context |
_context |
protected MapGroup |
_group |
protected MapView |
_mapView |
protected android.content.SharedPreferences |
_prefs |
protected static java.lang.String |
FROM_MISSIONPACKAGE |
protected static java.lang.String |
FROM_STATESAVER |
protected static NotificationIdRecycler |
NOTIFICATION_ID |
crcBlacklist, supportedMimeTypes
contentType
Modifier | Constructor and Description |
---|---|
protected |
MapItemImporter(MapView mapView,
MapGroup group) |
protected |
MapItemImporter(MapView mapView,
MapGroup group,
java.util.Set<java.lang.String> types) |
protected |
MapItemImporter(MapView mapView,
MapGroup group,
java.lang.String... types) |
Modifier and Type | Method and Description |
---|---|
protected void |
addToGroup(MapItem item) |
protected void |
addToGroup(MapItem item,
MapGroup group)
Helper method for adding an item to the defined group for this instance
|
protected void |
dispatchItemImported(MapItem item,
android.os.Bundle extras)
Dispatch event for when the item has been imported
|
protected MapItem |
findItem(CotEvent event) |
protected MapItem |
findItem(java.lang.String uid)
Find a map item given its CoT event
This should be a quick operation
|
protected int |
getNotificationIcon(MapItem item)
Get an to represent this importer's notification
Note: Due to a limitation with the Android notification API,
this method MUST return an ATAK core icon resource ID
|
CommsMapComponent.ImportResult |
importData(CotEvent event,
android.os.Bundle extras) |
protected abstract CommsMapComponent.ImportResult |
importMapItem(MapItem existing,
CotEvent cot,
android.os.Bundle extras)
Import a map item via CoT event
Sub-class implementation is responsible for the following:
- Create the new map item (if it doesn't exist)
- Update item metadata based on event content
- Add the item to a map group (if not already added)
|
protected boolean |
isLocalImport(android.os.Bundle extras)
Helper method to check if import extras signify a local import
depending on the "from" attribute
|
protected boolean |
isStateSaverImport(android.os.Bundle extras)
Helper method to check if import extras signify an import from the
statesaver.
|
protected boolean |
persist(MapItem item,
android.os.Bundle extras)
Persist a map item if it 'should' be persisted
(has the archive flag and isn't being imported from the statesaver)
|
protected void |
postNotification(MapItem item)
Post notification for a newly received map item
|
getSupportedCotTypes, importNonCotData, isPrefixOnly, setPrefixOnly
crcDetails, getSupportedMIMETypes, importData, importData, importData, parseColor, parseDouble, parseInt
deleteData, getContentType, importUriAsStream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deleteData, getContentType
protected static final java.lang.String FROM_STATESAVER
protected static final java.lang.String FROM_MISSIONPACKAGE
protected static final NotificationIdRecycler NOTIFICATION_ID
protected final MapView _mapView
protected final android.content.Context _context
protected final android.content.SharedPreferences _prefs
protected final MapGroup _group
protected MapItemImporter(MapView mapView, MapGroup group, java.util.Set<java.lang.String> types)
protected MapItemImporter(MapView mapView, MapGroup group, java.lang.String... types)
public CommsMapComponent.ImportResult importData(CotEvent event, android.os.Bundle extras)
importData
in interface CotEventImporter
importData
in class CotEventTypeImporter
protected void dispatchItemImported(MapItem item, android.os.Bundle extras)
item
- Map itemextras
- Import extrasprotected abstract CommsMapComponent.ImportResult importMapItem(MapItem existing, CotEvent cot, android.os.Bundle extras)
existing
- Existing map item (null if new)cot
- CoT eventextras
- Import extrasCommsMapComponent.ImportResult.SUCCESS
if handled successfully
CommsMapComponent.ImportResult.FAILURE
if handled but failed
CommsMapComponent.ImportResult.IGNORE
if not handled or N/A
CommsMapComponent.ImportResult.DEFERRED
if we should try again laterprotected MapItem findItem(java.lang.String uid)
protected void addToGroup(MapItem item, MapGroup group)
item
- Map itemprotected void addToGroup(MapItem item)
protected boolean isLocalImport(android.os.Bundle extras)
extras
- Import extrasprotected boolean isStateSaverImport(android.os.Bundle extras)
extras
- Import extrasprotected boolean persist(MapItem item, android.os.Bundle extras)
item
- Map itemextras
- Import extrasprotected int getNotificationIcon(MapItem item)
item
- Map item (not null)protected void postNotification(MapItem item)
item
- Map item to post the notification for