aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/TrackerClient.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-15 19:08:58 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-15 19:08:58 -0700
commitca884b765f3f7a642c435be886dbec40f9d1f661 (patch)
treeeb809ffe38faaf6e580fc2434beb9c4e0b3f90e5 /src/main/java/org/traccar/TrackerClient.java
parent63ecf80c11ec9bce19df18fc24ad863a9c2cb212 (diff)
downloadtrackermap-server-ca884b765f3f7a642c435be886dbec40f9d1f661.tar.gz
trackermap-server-ca884b765f3f7a642c435be886dbec40f9d1f661.tar.bz2
trackermap-server-ca884b765f3f7a642c435be886dbec40f9d1f661.zip
Convert some config usages
Diffstat (limited to 'src/main/java/org/traccar/TrackerClient.java')
-rw-r--r--src/main/java/org/traccar/TrackerClient.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/TrackerClient.java b/src/main/java/org/traccar/TrackerClient.java
index 12971849c..5a3c38212 100644
--- a/src/main/java/org/traccar/TrackerClient.java
+++ b/src/main/java/org/traccar/TrackerClient.java
@@ -54,14 +54,15 @@ public abstract class TrackerClient implements TrackerConnector {
}
public TrackerClient(String protocol) {
+ Config config = Context.getConfig();
- secure = Context.getConfig().getBoolean(Keys.PROTOCOL_SSL.withPrefix(protocol));
- interval = Context.getConfig().getLong(Keys.PROTOCOL_INTERVAL.withPrefix(protocol));
- address = Context.getConfig().getString(Keys.PROTOCOL_ADDRESS.withPrefix(protocol));
- port = Context.getConfig().getInteger(Keys.PROTOCOL_PORT.withPrefix(protocol), secure ? 443 : 80);
- devices = Context.getConfig().getString(Keys.PROTOCOL_DEVICES.withPrefix(protocol)).split("[, ]");
+ secure = config.getBoolean(Keys.PROTOCOL_SSL.withPrefix(protocol));
+ interval = config.getLong(Keys.PROTOCOL_INTERVAL.withPrefix(protocol));
+ address = config.getString(Keys.PROTOCOL_ADDRESS.withPrefix(protocol));
+ port = config.getInteger(Keys.PROTOCOL_PORT.withPrefix(protocol), secure ? 443 : 80);
+ devices = config.getString(Keys.PROTOCOL_DEVICES.withPrefix(protocol)).split("[, ]");
- BasePipelineFactory pipelineFactory = new BasePipelineFactory(this, protocol) {
+ BasePipelineFactory pipelineFactory = new BasePipelineFactory(this, config, protocol) {
@Override
protected void addTransportHandlers(PipelineBuilder pipeline) {
try {
@@ -78,7 +79,7 @@ public abstract class TrackerClient implements TrackerConnector {
@Override
protected void addProtocolHandlers(PipelineBuilder pipeline) {
try {
- TrackerClient.this.addProtocolHandlers(pipeline, Context.getConfig());
+ TrackerClient.this.addProtocolHandlers(pipeline, config);
} catch (Exception e) {
throw new RuntimeException(e);
}