@ThreadSafe public class EventEmittingTrackerImpl extends Object implements EventEmittingTracker
The tracker will emit events to its subscribes when certain tracking related events occur. Examples of such events are cell changes (a target entered a new grid cell), position changes, track goes stale (has not been updated for a duration of time), heart beats (TimeEvents).
The heart beat mechanism is based on timestamps from the data stream and therefore quite unprecise. Significant slack must be expected.
| Constructor and Description |
|---|
EventEmittingTrackerImpl(dk.dma.enav.model.geometry.grid.Grid grid)
Initialize the tracker.
|
EventEmittingTrackerImpl(dk.dma.enav.model.geometry.grid.Grid grid,
int... blackListedMmsis)
Initialize the tracker.
|
| Modifier and Type | Method and Description |
|---|---|
Target |
get(int mmsi)
Returns the latest target info for the specified MMSI number.
|
int |
getNumberOfTracks()
Deprecated.
Use #size() instead
|
Collection<Track> |
getTracks() |
void |
listen(com.google.common.eventbus.DeadEvent event) |
void |
registerSubscriber(Object subscriber)
Register subscriber.
|
int |
size()
Returns the number of targets that is being tracked.
|
void |
update(AisPacket packet)
Update the tracker with a single AisPacket.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsubscribeToPacketReader, subscribeToPacketStreampublic EventEmittingTrackerImpl(dk.dma.enav.model.geometry.grid.Grid grid)
grid - the gridpublic EventEmittingTrackerImpl(dk.dma.enav.model.geometry.grid.Grid grid,
int... blackListedMmsis)
grid - the gridblackListedMmsis - the black listed mmsispublic void update(AisPacket packet)
public Target get(int mmsi)
Trackerpublic void listen(com.google.common.eventbus.DeadEvent event)
event - the eventpublic void registerSubscriber(Object subscriber)
registerSubscriber in interface EventEmittingTrackersubscriber - the subscriberpublic Collection<Track> getTracks()
public int size()
public int getNumberOfTracks()
Copyright © 2011–2019 Danish Maritime Authority. All rights reserved.