aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api/resource/AttributeResource.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/api/resource/AttributeResource.java')
-rw-r--r--src/org/traccar/api/resource/AttributeResource.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/api/resource/AttributeResource.java b/src/org/traccar/api/resource/AttributeResource.java
index fefc84041..de69d871c 100644
--- a/src/org/traccar/api/resource/AttributeResource.java
+++ b/src/org/traccar/api/resource/AttributeResource.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2017 - 2019 Anton Tananaev (anton@traccar.org)
* Copyright 2017 - 2018 Andrey Kunitsyn (andrey@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -46,12 +46,15 @@ public class AttributeResource extends ExtendedObjectResource<Attribute> {
@POST
@Path("test")
- public Response test(@QueryParam("deviceId") long deviceId, Attribute entity) throws SQLException {
+ public Response test(@QueryParam("deviceId") long deviceId, Attribute entity) {
Context.getPermissionsManager().checkAdmin(getUserId());
Context.getPermissionsManager().checkDevice(getUserId(), deviceId);
Position last = Context.getIdentityManager().getLastPosition(deviceId);
if (last != null) {
- Object result = new ComputedAttributesHandler().computeAttribute(entity, last);
+ Object result = new ComputedAttributesHandler(
+ Context.getConfig(),
+ Context.getIdentityManager(),
+ Context.getAttributesManager()).computeAttribute(entity, last);
if (result != null) {
switch (entity.getType()) {
case "number":