aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/notification
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-02-20 11:30:26 -0800
committerAnton Tananaev <anton@traccar.org>2023-02-20 11:30:26 -0800
commit1439422c6f4ce947f6719743b37fa49f251fc97f (patch)
tree45bb38bba8ac882a0267ce419c565bc0b2b02303 /src/main/java/org/traccar/notification
parent8ae0436e5edb76243e59ee6e9b2c1a6132fd9464 (diff)
downloadtrackermap-server-1439422c6f4ce947f6719743b37fa49f251fc97f.tar.gz
trackermap-server-1439422c6f4ce947f6719743b37fa49f251fc97f.tar.bz2
trackermap-server-1439422c6f4ce947f6719743b37fa49f251fc97f.zip
Refactor notificator classes
Diffstat (limited to 'src/main/java/org/traccar/notification')
-rw-r--r--src/main/java/org/traccar/notification/NotificatorManager.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/org/traccar/notification/NotificatorManager.java b/src/main/java/org/traccar/notification/NotificatorManager.java
index 1d9f4f423..c3ee7b480 100644
--- a/src/main/java/org/traccar/notification/NotificatorManager.java
+++ b/src/main/java/org/traccar/notification/NotificatorManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2018 - 2022 Anton Tananaev (anton@traccar.org)
+ * Copyright 2018 - 2023 Anton Tananaev (anton@traccar.org)
* Copyright 2018 Andrey Kunitsyn (andrey@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,15 +17,13 @@
package org.traccar.notification;
import com.google.inject.Injector;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.model.Typed;
import org.traccar.notificators.Notificator;
+import org.traccar.notificators.NotificatorCommand;
import org.traccar.notificators.NotificatorFirebase;
import org.traccar.notificators.NotificatorMail;
-import org.traccar.notificators.NotificatorNull;
import org.traccar.notificators.NotificatorPushover;
import org.traccar.notificators.NotificatorSms;
import org.traccar.notificators.NotificatorTelegram;
@@ -43,9 +41,8 @@ import java.util.stream.Collectors;
@Singleton
public class NotificatorManager {
- private static final Logger LOGGER = LoggerFactory.getLogger(NotificatorManager.class);
-
private static final Map<String, Class<? extends Notificator>> NOTIFICATORS_ALL = Map.of(
+ "command", NotificatorCommand.class,
"web", NotificatorWeb.class,
"mail", NotificatorMail.class,
"sms", NotificatorSms.class,
@@ -75,8 +72,7 @@ public class NotificatorManager {
return notificator;
}
}
- LOGGER.warn("Failed to get notificator {}", type);
- return new NotificatorNull();
+ throw new RuntimeException("Failed to get notificator " + type);
}
public Set<Typed> getAllNotificatorTypes() {