@ThreadSafe public class ReplayDownSampleFilter extends Object implements IPacketFilter
For position reports 1,2,3,4 and 18, only one message will be forwarded within the give sampling rate. E.g. one message per minute.
For static reports 5 and 24 the same apply. But it is handled separately from the position reports.
All remaining message types are passed through without down sampling.
As opposed to the DownSampleFilter (which operates on current system time), this filter uses the timestamp on AisPackets as current time when filtering.
| Constructor and Description |
|---|
ReplayDownSampleFilter()
Empty contructor
|
ReplayDownSampleFilter(long samplingRate)
Constructor given sampling rate in seconds
|
| Modifier and Type | Method and Description |
|---|---|
protected static int |
getMessageId(AisPacket packet)
Gets message id.
|
long |
getSamplingRate()
Get sampling rate in seconds
|
boolean |
rejectedByFilter(AisPacket packet)
Rejected by filter boolean.
|
void |
setSamplingRate(long samplingRate)
Set sampling rate in seconds
|
public ReplayDownSampleFilter()
public ReplayDownSampleFilter(long samplingRate)
samplingRate - the sampling rateprotected static int getMessageId(AisPacket packet)
packet - the packetpublic boolean rejectedByFilter(AisPacket packet)
IPacketFilterrejectedByFilter in interface IPacketFilterpacket - the packetpublic long getSamplingRate()
public void setSamplingRate(long samplingRate)
samplingRate - the sampling rateCopyright © 2011–2019 Danish Maritime Authority. All rights reserved.