aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-10-08 12:30:21 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-10-08 12:30:31 +1300
commit5f7b0b7183e7b7bb10bc3b24afc4ecf5d8654c9b (patch)
tree4366a4bf5564531a154d3e503516c500bf4daf67 /src/org/traccar
parent8e38a798ea6241e823f654d1467c1a143643c16d (diff)
downloadtraccar-server-5f7b0b7183e7b7bb10bc3b24afc4ecf5d8654c9b.tar.gz
traccar-server-5f7b0b7183e7b7bb10bc3b24afc4ecf5d8654c9b.tar.bz2
traccar-server-5f7b0b7183e7b7bb10bc3b24afc4ecf5d8654c9b.zip
Add parameter to refresh geofences (fix #2414)
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/api/resource/GeofenceResource.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/traccar/api/resource/GeofenceResource.java b/src/org/traccar/api/resource/GeofenceResource.java
index 960ab813f..615606cdc 100644
--- a/src/org/traccar/api/resource/GeofenceResource.java
+++ b/src/org/traccar/api/resource/GeofenceResource.java
@@ -45,9 +45,13 @@ public class GeofenceResource extends BaseResource {
@GET
public Collection<Geofence> get(
@QueryParam("all") boolean all, @QueryParam("userId") long userId, @QueryParam("groupId") long groupId,
- @QueryParam("deviceId") long deviceId) throws SQLException {
+ @QueryParam("deviceId") long deviceId, @QueryParam("refresh") boolean refresh) throws SQLException {
GeofenceManager geofenceManager = Context.getGeofenceManager();
+ if (refresh) {
+ geofenceManager.refreshGeofences();
+ }
+
Set<Long> result;
if (all) {
Context.getPermissionsManager().checkAdmin(getUserId());
@@ -57,7 +61,7 @@ public class GeofenceResource extends BaseResource {
userId = getUserId();
}
Context.getPermissionsManager().checkUser(getUserId(), userId);
- result = new HashSet<Long>(geofenceManager.getUserGeofencesIds(userId));
+ result = new HashSet<>(geofenceManager.getUserGeofencesIds(userId));
}
if (groupId != 0) {