From 825ee0d178a24620f075cb4ffb8d49c75b046484 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 26 Jun 2018 12:05:16 +0500 Subject: Cleanup and some adjustments --- src/org/traccar/api/resource/NotificationResource.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 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 2347b43fa..9046569a0 100644 --- a/src/org/traccar/api/resource/NotificationResource.java +++ b/src/org/traccar/api/resource/NotificationResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2016 - 2018 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,8 +52,9 @@ public class NotificationResource extends ExtendedObjectResource { @POST @Path("test") public Response testMessage() throws NotificationException, InterruptedException { - for (String method : Context.getNotificatorManager().getNotificatorTypes()) { - Context.getNotificatorManager().getNotificator(method).sendSync(getUserId(), new Event("test", 0), null); + for (Typed method : Context.getNotificatorManager().getNotificatorTypes()) { + Context.getNotificatorManager() + .getNotificator(method.getType()).sendSync(getUserId(), new Event("test", 0), null); } return Response.noContent().build(); } @@ -68,7 +69,7 @@ public class NotificationResource extends ExtendedObjectResource { @GET @Path("notificators") - public Collection getNotificators() { + public Collection getNotificators() { return Context.getNotificatorManager().getNotificatorTypes(); } -- cgit v1.2.3