aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BaseProtocol.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-10-17 17:08:59 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-10-17 17:08:59 +1300
commit61d4c1f15b645aa06c84905933108437e1ade92a (patch)
tree33ca5e2e7d262c6941d66a6c23ff37c2c32e7a8f /src/org/traccar/BaseProtocol.java
parentae32084f88df4436e1a2cdcb346ff1e7e286e369 (diff)
downloadtrackermap-server-61d4c1f15b645aa06c84905933108437e1ade92a.tar.gz
trackermap-server-61d4c1f15b645aa06c84905933108437e1ade92a.tar.bz2
trackermap-server-61d4c1f15b645aa06c84905933108437e1ade92a.zip
Move server init into constructor
Diffstat (limited to 'src/org/traccar/BaseProtocol.java')
-rw-r--r--src/org/traccar/BaseProtocol.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/org/traccar/BaseProtocol.java b/src/org/traccar/BaseProtocol.java
index 6e44b7285..4ece8f848 100644
--- a/src/org/traccar/BaseProtocol.java
+++ b/src/org/traccar/BaseProtocol.java
@@ -24,6 +24,8 @@ import org.traccar.model.Command;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Set;
public abstract class BaseProtocol implements Protocol {
@@ -31,6 +33,7 @@ public abstract class BaseProtocol implements Protocol {
private final String name;
private final Set<String> supportedDataCommands = new HashSet<>();
private final Set<String> supportedTextCommands = new HashSet<>();
+ private final List<TrackerServer> serverList = new LinkedList<>();
private StringProtocolEncoder textCommandEncoder = null;
@@ -48,6 +51,15 @@ public abstract class BaseProtocol implements Protocol {
return name;
}
+ protected void addServer(TrackerServer server) {
+ serverList.add(server);
+ }
+
+ @Override
+ public Collection<TrackerServer> getServerList() {
+ return serverList;
+ }
+
public void setSupportedDataCommands(String... commands) {
supportedDataCommands.addAll(Arrays.asList(commands));
}