diff options
author | Shinryuken <watertext@hotmail.it> | 2017-11-07 19:15:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-07 19:15:02 +0100 |
commit | 0801b279a4fe91c8cb1d653676f43dfe6c26a6f2 (patch) | |
tree | 5c73a1665d9ac4d24d17529a0000462bff4593d1 /src/org/traccar/notification/FormTypeEventForwarder.java | |
parent | 5117b2e64781161c9e06f57cbee217f174d5731e (diff) | |
download | traccar-server-0801b279a4fe91c8cb1d653676f43dfe6c26a6f2.tar.gz traccar-server-0801b279a4fe91c8cb1d653676f43dfe6c26a6f2.tar.bz2 traccar-server-0801b279a4fe91c8cb1d653676f43dfe6c26a6f2.zip |
User defaults when no User is available - EventForwarder refactoring
Diffstat (limited to 'src/org/traccar/notification/FormTypeEventForwarder.java')
-rw-r--r-- | src/org/traccar/notification/FormTypeEventForwarder.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/org/traccar/notification/FormTypeEventForwarder.java b/src/org/traccar/notification/FormTypeEventForwarder.java new file mode 100644 index 000000000..d2c4aa691 --- /dev/null +++ b/src/org/traccar/notification/FormTypeEventForwarder.java @@ -0,0 +1,24 @@ +package org.traccar.notification;
+
+import org.traccar.model.Event;
+import org.traccar.model.Position;
+
+import com.ning.http.client.AsyncHttpClient.BoundRequestBuilder;
+
+public class FormTypeEventForwarder extends EventForwarder {
+
+ @Override
+ protected String getContentType() {
+ return "application/x-www-form-urlencoded; charset=UTF-8";
+ }
+
+ @Override
+ protected void setContent(Event event, Position position, BoundRequestBuilder requestBuilder) {
+ if (!getAdditionalParams().equals("")) {
+ requestBuilder.setFormParams(splitParams(getAdditionalParams(), "="));
+ }
+ requestBuilder.addFormParam(getPayloadParamName(),
+ NotificationFormatter.formatForwarderMessage(event, position));
+ }
+
+}
|