aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BaseProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-10-22 09:43:19 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2014-10-22 09:43:19 +1300
commit91395e9ac0dd5de366b87bb5d082990b15a946e9 (patch)
tree57aea8c58bbd8d197d61e6b7013937c44f950de7 /src/org/traccar/BaseProtocolDecoder.java
parent8876e964cf26a090d11fd855642c95bc02a17c7f (diff)
parent0d59336ac1fbe9934260e56811c3bcafa0aeaeca (diff)
downloadtrackermap-server-91395e9ac0dd5de366b87bb5d082990b15a946e9.tar.gz
trackermap-server-91395e9ac0dd5de366b87bb5d082990b15a946e9.tar.bz2
trackermap-server-91395e9ac0dd5de366b87bb5d082990b15a946e9.zip
Merge pull request #918 from jon-stumpf/enhancement-eliminate-hardcoded-protocol-names
Eliminate hardcoded protocol names
Diffstat (limited to 'src/org/traccar/BaseProtocolDecoder.java')
-rw-r--r--src/org/traccar/BaseProtocolDecoder.java35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java
index e23367278..04b1a1eec 100644
--- a/src/org/traccar/BaseProtocolDecoder.java
+++ b/src/org/traccar/BaseProtocolDecoder.java
@@ -16,12 +16,15 @@
package org.traccar;
import java.net.SocketAddress;
+import java.util.Properties;
+
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelHandlerContext;
import static org.jboss.netty.channel.Channels.fireMessageReceived;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.handler.codec.oneone.OneToOneDecoder;
+
import org.traccar.database.DataManager;
/**
@@ -29,33 +32,27 @@ import org.traccar.database.DataManager;
*/
public abstract class BaseProtocolDecoder extends OneToOneDecoder {
- private ServerManager serverManager;
- private DataManager dataManager;
-
- public final void setDataManager(DataManager dataManager) {
- this.dataManager = dataManager;
- }
+ private final DataManager dataManager;
+ private final String protocol;
+ private final Properties properties;
public final DataManager getDataManager() {
return dataManager;
}
- public final void setServerManager(ServerManager serverManager) {
- this.serverManager = serverManager;
- }
-
- public final ServerManager getServerManager() {
- return serverManager;
+ public final String getProtocol() {
+ return protocol;
}
-
- public BaseProtocolDecoder() {
+
+ public final Properties getProperties() {
+ return properties;
}
- public BaseProtocolDecoder(ServerManager serverManager) {
- if (serverManager != null) {
- this.serverManager = serverManager;
- dataManager = serverManager.getDataManager();
- }
+
+ public BaseProtocolDecoder(DataManager dataManager, String protocol, Properties properties) {
+ this.dataManager = dataManager;
+ this.protocol = protocol;
+ this.properties = properties;
}
@Override