aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BaseProtocol.java
diff options
context:
space:
mode:
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));
}