aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BaseProtocolDecoder.java
diff options
context:
space:
mode:
authorjon-stumpf <jon.stumpf@gmail.com>2014-10-21 15:00:55 -0400
committerjon-stumpf <jon.stumpf@gmail.com>2014-10-21 16:02:45 -0400
commit0d59336ac1fbe9934260e56811c3bcafa0aeaeca (patch)
tree57aea8c58bbd8d197d61e6b7013937c44f950de7 /src/org/traccar/BaseProtocolDecoder.java
parentf0790eba6f3194daf4677c27e8259f783aae3207 (diff)
downloadtrackermap-server-0d59336ac1fbe9934260e56811c3bcafa0aeaeca.tar.gz
trackermap-server-0d59336ac1fbe9934260e56811c3bcafa0aeaeca.tar.bz2
trackermap-server-0d59336ac1fbe9934260e56811c3bcafa0aeaeca.zip
Updated BaseProtocolDecoder constructor to take three parameters (DataManager, String, Properties); Removed second constructor;
Diffstat (limited to 'src/org/traccar/BaseProtocolDecoder.java')
-rw-r--r--src/org/traccar/BaseProtocolDecoder.java38
1 files changed, 11 insertions, 27 deletions
diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java
index e4a3448f1..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,46 +32,27 @@ import org.traccar.database.DataManager;
*/
public abstract class BaseProtocolDecoder extends OneToOneDecoder {
- private final ServerManager serverManager;
private final DataManager dataManager;
private final String protocol;
+ private final Properties properties;
public final DataManager getDataManager() {
return dataManager;
}
- public final ServerManager getServerManager() {
- return serverManager;
- }
-
public final String getProtocol() {
return protocol;
}
-
- public BaseProtocolDecoder(DataManager dataManager) {
- // This constructor must only be used by test classes.
- // There should be a way to check this at compile time.
-
- assert (dataManager != null) :
- "BaseProtocolDecoder() initialized with NULL dataManager";
-
- serverManager = null;
- protocol = null;
-
- this.dataManager = dataManager;
+
+ public final Properties getProperties() {
+ return properties;
}
- public BaseProtocolDecoder(ServerManager serverManager, String protocol) {
- assert (serverManager != null) :
- "BaseProtocolDecoder() initialized with NULL serverManager";
-
- assert (protocol != null) :
- "BaseProtocolDecoder() initialized with NULL protocol";
-
- this.serverManager = serverManager;
+
+ public BaseProtocolDecoder(DataManager dataManager, String protocol, Properties properties) {
+ this.dataManager = dataManager;
this.protocol = protocol;
-
- dataManager = serverManager.getDataManager();
+ this.properties = properties;
}
@Override