aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-08-29 10:02:04 +0500
committerAbyss777 <abyss@fox5.ru>2017-08-29 10:02:04 +0500
commit19d4f15ac891e1a684be456d544ef32d6b276dcd (patch)
treeb77a7a5c66a7be27ca1dea02f7827efca3084f7e /src/org
parent132c672081947776c72a4bfed4112b771c45637d (diff)
downloadtrackermap-server-19d4f15ac891e1a684be456d544ef32d6b276dcd.tar.gz
trackermap-server-19d4f15ac891e1a684be456d544ef32d6b276dcd.tar.bz2
trackermap-server-19d4f15ac891e1a684be456d544ef32d6b276dcd.zip
Mark out functions to skip filtering
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/FilterHandler.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java
index bcc958e59..08be43f65 100644
--- a/src/org/traccar/FilterHandler.java
+++ b/src/org/traccar/FilterHandler.java
@@ -138,13 +138,17 @@ public class FilterHandler extends BaseDataHandler {
return false;
}
- private boolean filterLimit(Position position, Position last) {
+ private boolean skipLimit(Position position, Position last) {
if (filterLimit != 0 && last != null) {
return (position.getFixTime().getTime() - last.getFixTime().getTime()) > filterLimit;
}
return false;
}
+ private boolean skipAlarms(Position position) {
+ return keepAlarms && position.getAttributes().containsKey(Position.KEY_ALARM);
+ }
+
private boolean filter(Position position) {
StringBuilder filterType = new StringBuilder();
@@ -154,7 +158,7 @@ public class FilterHandler extends BaseDataHandler {
last = Context.getIdentityManager().getLastPosition(position.getDeviceId());
}
- if (filterLimit(position, last) || keepAlarms && position.getAttributes().containsKey(Position.KEY_ALARM)) {
+ if (skipLimit(position, last) || skipAlarms(position)) {
return false;
}