public abstract class CotDetailHandler
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
CotDetailHandler(java.util.Set<java.lang.String> detailNames) |
protected |
CotDetailHandler(java.lang.String detailName) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getDetailNames()
Get the set of detail names this handler supports
|
protected <T extends MapItem> |
getMapItem(java.lang.String uid)
Find a map item by a UID with a given class
|
protected GeoPointMetaData |
getPoint(MapItem item)
Helper method for obtaining a point given a map item
|
boolean |
isSupported(MapItem item,
CotEvent event,
CotDetail detail)
Check if this handler supports this item
Used to filter out certain types from being processed by a handler
|
protected double |
parseDouble(java.lang.String value,
double defaultVal)
Convert a string to a double (exceptions caught with fallback)
|
protected int |
parseInt(java.lang.String value,
int defaultVal)
Convert a string to an int (exceptions caught with fallback)
|
abstract boolean |
toCotDetail(MapItem item,
CotEvent event,
CotDetail root)
Convert map item metadata to a CoT detail
|
abstract CommsMapComponent.ImportResult |
toItemMetadata(MapItem item,
CotEvent event,
CotDetail detail)
Convert CoT event detail to map item metadata
|
protected CotDetailHandler(java.util.Set<java.lang.String> detailNames)
protected CotDetailHandler(java.lang.String detailName)
public final java.util.Set<java.lang.String> getDetailNames()
public abstract CommsMapComponent.ImportResult toItemMetadata(MapItem item, CotEvent event, CotDetail detail)
item
- Map itemevent
- Item's associated CoT eventdetail
- The detail associated with this handler (read from this)CommsMapComponent.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 laterpublic abstract boolean toCotDetail(MapItem item, CotEvent event, CotDetail root)
item
- Map item to readevent
- Item's associated CoT eventroot
- The CoT event root detail (add to this)public boolean isSupported(MapItem item, CotEvent event, CotDetail detail)
item
- Map itemevent
- CoT Eventdetail
- Associated CoT detailprotected GeoPointMetaData getPoint(MapItem item)
item
- Map itemprotected double parseDouble(java.lang.String value, double defaultVal)
value
- String valuedefaultVal
- Default value if conversion failsprotected int parseInt(java.lang.String value, int defaultVal)
value
- String valuedefaultVal
- Default value if conversion failsprotected <T extends MapItem> T getMapItem(java.lang.String uid)
T
- Class typeuid
- Map item UID