aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/GlobalSatProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-12 17:54:00 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-12 17:54:00 +1200
commita2dac324574dde8fe8e57bd46dd7f94d0fb60231 (patch)
tree061e957cb53e00214a33acb6317be9c0849c50fa /src/org/traccar/protocol/GlobalSatProtocolDecoder.java
parentf1ae2d73584d4ddded6f727c665d97f03ecf9c25 (diff)
downloadtrackermap-server-a2dac324574dde8fe8e57bd46dd7f94d0fb60231.tar.gz
trackermap-server-a2dac324574dde8fe8e57bd46dd7f94d0fb60231.tar.bz2
trackermap-server-a2dac324574dde8fe8e57bd46dd7f94d0fb60231.zip
Re-factor configuration access
Diffstat (limited to 'src/org/traccar/protocol/GlobalSatProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/GlobalSatProtocolDecoder.java22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java
index c411b4c25..04b88114f 100644
--- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java
+++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java
@@ -17,14 +17,10 @@ package org.traccar.protocol;
import java.net.SocketAddress;
import java.util.Calendar;
-import java.util.Properties;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-
import org.jboss.netty.channel.Channel;
-import org.jboss.netty.channel.ChannelHandlerContext;
-
import org.traccar.BaseProtocolDecoder;
import org.traccar.Context;
import org.traccar.helper.UnitsConverter;
@@ -33,22 +29,14 @@ import org.traccar.model.Position;
public class GlobalSatProtocolDecoder extends BaseProtocolDecoder {
- // Default values
- private String format0 = "TSPRXAB27GHKLMnaicz*U!";
- private String format1 = "SARY*U!";
+ private String format0;
+ private String format1;
public GlobalSatProtocolDecoder(GlobalSatProtocol protocol) {
super(protocol);
-
- Properties properties = Context.getProps();
- if (properties != null) {
- if (properties.containsKey(protocol + ".format0")) {
- format0 = properties.getProperty(protocol + ".format0");
- }
- if (properties.containsKey(protocol + ".format1")) {
- format1 = properties.getProperty(protocol + ".format1");
- }
- }
+
+ format0 = Context.getConfig().getString(protocol + ".format0", "TSPRXAB27GHKLMnaicz*U!");
+ format1 = Context.getConfig().getString(protocol + ".format1", "SARY*U!");
}
public void setFormat0(String format) {