aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/ExtendedObjectDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-10-15 21:15:12 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-10-15 21:15:12 -0700
commiteaffa34a7061232601668c2493a5f18e1b1c80f5 (patch)
tree140725fa580fc374c2beed152ffbd08cf34cfb15 /src/main/java/org/traccar/ExtendedObjectDecoder.java
parentcf883bc9e41f27613f456045b67d15d0ff443f0e (diff)
downloadtrackermap-server-eaffa34a7061232601668c2493a5f18e1b1c80f5.tar.gz
trackermap-server-eaffa34a7061232601668c2493a5f18e1b1c80f5.tar.bz2
trackermap-server-eaffa34a7061232601668c2493a5f18e1b1c80f5.zip
Save original config key
Diffstat (limited to 'src/main/java/org/traccar/ExtendedObjectDecoder.java')
-rw-r--r--src/main/java/org/traccar/ExtendedObjectDecoder.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/ExtendedObjectDecoder.java b/src/main/java/org/traccar/ExtendedObjectDecoder.java
index dad52d3ff..46720da52 100644
--- a/src/main/java/org/traccar/ExtendedObjectDecoder.java
+++ b/src/main/java/org/traccar/ExtendedObjectDecoder.java
@@ -21,6 +21,7 @@ import io.netty.channel.Channel;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.util.ReferenceCountUtil;
+import org.traccar.config.Keys;
import org.traccar.helper.DataConverter;
import org.traccar.model.Position;
@@ -31,14 +32,14 @@ import java.util.Collection;
public abstract class ExtendedObjectDecoder extends ChannelInboundHandlerAdapter {
private void saveOriginal(Object decodedMessage, Object originalMessage) {
- if (Context.getConfig().getBoolean("database.saveOriginal") && decodedMessage instanceof Position) {
+ if (Context.getConfig().getBoolean(Keys.DATABASE_SAVE_ORIGINAL) && decodedMessage instanceof Position) {
Position position = (Position) decodedMessage;
if (originalMessage instanceof ByteBuf) {
ByteBuf buf = (ByteBuf) originalMessage;
position.set(Position.KEY_ORIGINAL, ByteBufUtil.hexDump(buf, 0, buf.writerIndex()));
} else if (originalMessage instanceof String) {
position.set(Position.KEY_ORIGINAL, DataConverter.printHex(
- ((String) originalMessage).getBytes(StandardCharsets.US_ASCII)));
+ ((String) originalMessage).getBytes(StandardCharsets.US_ASCII)));
}
}
}