diff options
author | Ivan Martinez <ivanfmartinez@users.noreply.github.com> | 2018-03-25 22:16:09 -0300 |
---|---|---|
committer | Ivan Martinez <ivanfmartinez@users.noreply.github.com> | 2018-04-01 18:09:50 -0300 |
commit | bb289a69fa4d292378c5c534e10985be65b2e392 (patch) | |
tree | 43ded3eed61aabf70d8212e663aa6c966b55a9dc /src/org/traccar/model | |
parent | 0117dfeef0a7ffbc7a47d9681811177136336730 (diff) | |
download | traccar-server-bb289a69fa4d292378c5c534e10985be65b2e392.tar.gz traccar-server-bb289a69fa4d292378c5c534e10985be65b2e392.tar.bz2 traccar-server-bb289a69fa4d292378c5c534e10985be65b2e392.zip |
generalization for notifications processing
Diffstat (limited to 'src/org/traccar/model')
-rw-r--r-- | src/org/traccar/model/Notification.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/org/traccar/model/Notification.java b/src/org/traccar/model/Notification.java index cc80f2ae2..0d0b34cd4 100644 --- a/src/org/traccar/model/Notification.java +++ b/src/org/traccar/model/Notification.java @@ -15,6 +15,9 @@ */ package org.traccar.model; +import java.util.HashSet; +import java.util.Set; + public class Notification extends ScheduledModel { private boolean always; @@ -66,4 +69,19 @@ public class Notification extends ScheduledModel { public void setSms(boolean sms) { this.sms = sms; } + + public Set<String> getMethods() { + final Set<String> set = new HashSet<>(); + if (web) { + set.add("web"); + } + if (mail) { + set.add("mail"); + } + if (sms) { + set.add("sms"); + } + return set; + } + } |