aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/api
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2018-06-26 12:29:08 +0500
committerAbyss777 <abyss@fox5.ru>2018-06-26 12:29:08 +0500
commit253f11afa0e31d97d332ca3269111eff36ee347b (patch)
tree98866ec1ffed872995b4a71c0c1deb99a4f9c656 /src/org/traccar/api
parent825ee0d178a24620f075cb4ffb8d49c75b046484 (diff)
downloadtrackermap-server-253f11afa0e31d97d332ca3269111eff36ee347b.tar.gz
trackermap-server-253f11afa0e31d97d332ca3269111eff36ee347b.tar.bz2
trackermap-server-253f11afa0e31d97d332ca3269111eff36ee347b.zip
Rename transports to notificators
Diffstat (limited to 'src/org/traccar/api')
-rw-r--r--src/org/traccar/api/resource/NotificationResource.java23
1 files changed, 11 insertions, 12 deletions
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<Notification> {
public Collection<Typed> get() {
return Context.getNotificationManager().getAllNotificationTypes();
}
+
+ @GET
+ @Path("notificators")
+ public Collection<Typed> 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<Notification> {
}
@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<Typed> getNotificators() {
- return Context.getNotificatorManager().getNotificatorTypes();
- }
-
-
}