aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/BaseProtocolDecoder.java
diff options
context:
space:
mode:
authorPhilipp Prangenberg <philipp.prangenberg@derkurier.de>2016-12-08 08:10:50 +0100
committerPhilipp Prangenberg <philipp.prangenberg@derkurier.de>2016-12-08 08:10:50 +0100
commitd196a75e70f80dd1a45202b82052b1227bf1ae8d (patch)
tree95ff5ea79636ea5ccd852287c8dee7b837a20e9c /src/org/traccar/BaseProtocolDecoder.java
parent3c9af23be923b8cf4bc40f6f964b5b3e719e4c8e (diff)
downloadtrackermap-server-d196a75e70f80dd1a45202b82052b1227bf1ae8d.tar.gz
trackermap-server-d196a75e70f80dd1a45202b82052b1227bf1ae8d.tar.bz2
trackermap-server-d196a75e70f80dd1a45202b82052b1227bf1ae8d.zip
Moving from GroupName to GroupID in default settings
Diffstat (limited to 'src/org/traccar/BaseProtocolDecoder.java')
-rw-r--r--src/org/traccar/BaseProtocolDecoder.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/org/traccar/BaseProtocolDecoder.java b/src/org/traccar/BaseProtocolDecoder.java
index 103a999b0..ff7ab685a 100644
--- a/src/org/traccar/BaseProtocolDecoder.java
+++ b/src/org/traccar/BaseProtocolDecoder.java
@@ -19,7 +19,6 @@ import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.socket.DatagramChannel;
import org.traccar.helper.Log;
import org.traccar.model.Device;
-import org.traccar.model.Group;
import org.traccar.model.Position;
import java.net.InetSocketAddress;
@@ -35,16 +34,13 @@ public abstract class BaseProtocolDecoder extends ExtendedObjectDecoder {
public long addUnknownDevice(String uniqueId) {
Device device = new Device();
- String defaultGroupName = Context.getConfig().getString("database.registerUnknown.defaultGroup", "NOTDEFINED");
+ long defaultGroupId = Context.getConfig().getLong("database.registerUnknown.defaultGroupId");
device.setName(uniqueId);
device.setUniqueId(uniqueId);
- device.setCategory(Context.getConfig().getString("database.registerUnknown.defaultCategory", "default"));
+ device.setCategory(Context.getConfig().getString("database.registerUnknown.defaultCategory"));
- if (!defaultGroupName.equals("NOTDEFINED")) {
- Group defaultGroup = Context.getDeviceManager().getGroupByName(defaultGroupName);
- if (defaultGroup != null) {
- device.setGroupId(defaultGroup.getId());
- }
+ if (defaultGroupId != 0) {
+ device.setGroupId(defaultGroupId);
}
try {