diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-12-02 13:35:15 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-12-02 13:35:15 +1300 |
commit | dc99e22966e542e6399df429c1e7611bc9c3bd52 (patch) | |
tree | 419630187f555348f1e469014d36c9e1e6ff5590 /src/org/traccar/api/resource/ServerResource.java | |
parent | 2d934d61544b1fbe3e8ec733988f90a358809956 (diff) | |
download | trackermap-server-dc99e22966e542e6399df429c1e7611bc9c3bd52.tar.gz trackermap-server-dc99e22966e542e6399df429c1e7611bc9c3bd52.tar.bz2 trackermap-server-dc99e22966e542e6399df429c1e7611bc9c3bd52.zip |
Implement server config update API
Diffstat (limited to 'src/org/traccar/api/resource/ServerResource.java')
-rw-r--r-- | src/org/traccar/api/resource/ServerResource.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/org/traccar/api/resource/ServerResource.java b/src/org/traccar/api/resource/ServerResource.java index 2c0373c62..36f7f14c3 100644 --- a/src/org/traccar/api/resource/ServerResource.java +++ b/src/org/traccar/api/resource/ServerResource.java @@ -22,10 +22,12 @@ import org.traccar.model.Server; import javax.annotation.security.PermitAll; import javax.ws.rs.Consumes; import javax.ws.rs.GET; +import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import java.sql.SQLException; @Path("server") @@ -43,4 +45,14 @@ public class ServerResource extends BaseResource { } } + @PUT + public Response update(Server entity) { + try { + Context.getDataManager().updateServer(entity); + return Response.ok(entity).build(); + } catch (SQLException e) { + throw new WebApplicationException(e); + } + } + } |