diff options
Diffstat (limited to 'src/main/java/org/traccar/ExtendedObjectDecoder.java')
-rw-r--r-- | src/main/java/org/traccar/ExtendedObjectDecoder.java | 5 |
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))); } } } |