aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model/Notification.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/model/Notification.java')
-rw-r--r--src/org/traccar/model/Notification.java43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/org/traccar/model/Notification.java b/src/org/traccar/model/Notification.java
index cc80f2ae2..f1983a03a 100644
--- a/src/org/traccar/model/Notification.java
+++ b/src/org/traccar/model/Notification.java
@@ -15,6 +15,13 @@
*/
package org.traccar.model;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.traccar.database.QueryIgnore;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
public class Notification extends ScheduledModel {
private boolean always;
@@ -37,33 +44,29 @@ public class Notification extends ScheduledModel {
this.type = type;
}
- private boolean web;
-
- public boolean getWeb() {
- return web;
- }
-
- public void setWeb(boolean web) {
- this.web = web;
- }
- private boolean mail;
+ private String notificators;
- public boolean getMail() {
- return mail;
+ public String getNotificators() {
+ return notificators;
}
- public void setMail(boolean mail) {
- this.mail = mail;
+ public void setNotificators(String transports) {
+ this.notificators = transports;
}
- private boolean sms;
- public boolean getSms() {
- return sms;
+ @JsonIgnore
+ @QueryIgnore
+ public Set<String> getNotificatorsTypes() {
+ final Set<String> result = new HashSet<>();
+ if (notificators != null) {
+ final String[] transportsList = notificators.split(",");
+ for (String transport : transportsList) {
+ result.add(transport.trim());
+ }
+ }
+ return result;
}
- public void setSms(boolean sms) {
- this.sms = sms;
- }
}