From 253f11afa0e31d97d332ca3269111eff36ee347b Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 26 Jun 2018 12:29:08 +0500 Subject: Rename transports to notificators --- .../traccar/api/resource/NotificationResource.java | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/org/traccar/api') diff --git a/src/org/traccar/api/resource/NotificationResource.java b/src/org/traccar/api/resource/NotificationResource.java index 9046569a0..bec1ce3ab 100644 --- a/src/org/traccar/api/resource/NotificationResource.java +++ b/src/org/traccar/api/resource/NotificationResource.java @@ -48,11 +48,17 @@ public class NotificationResource extends ExtendedObjectResource { public Collection get() { return Context.getNotificationManager().getAllNotificationTypes(); } + + @GET + @Path("notificators") + public Collection getNotificators() { + return Context.getNotificatorManager().getAllNotificatorTypes(); + } @POST @Path("test") public Response testMessage() throws NotificationException, InterruptedException { - for (Typed method : Context.getNotificatorManager().getNotificatorTypes()) { + for (Typed method : Context.getNotificatorManager().getAllNotificatorTypes()) { Context.getNotificatorManager() .getNotificator(method.getType()).sendSync(getUserId(), new Event("test", 0), null); } @@ -60,18 +66,11 @@ public class NotificationResource extends ExtendedObjectResource { } @POST - @Path("test/{method}") - public Response testMessage(@PathParam("method") String method) throws NotificationException, InterruptedException { - Context.getNotificatorManager().getNotificator(method).sendSync(getUserId(), new Event("test", 0), null); + @Path("test/{notificator}") + public Response testMessage(@PathParam("notificator") String notificator) + throws NotificationException, InterruptedException { + Context.getNotificatorManager().getNotificator(notificator).sendSync(getUserId(), new Event("test", 0), null); return Response.noContent().build(); } - - @GET - @Path("notificators") - public Collection getNotificators() { - return Context.getNotificatorManager().getNotificatorTypes(); - } - - } -- cgit v1.2.3