aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DeviceManager.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/database/DeviceManager.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/database/DeviceManager.java')
-rw-r--r--src/org/traccar/database/DeviceManager.java16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java
index a75b0616c..c70e67231 100644
--- a/src/org/traccar/database/DeviceManager.java
+++ b/src/org/traccar/database/DeviceManager.java
@@ -49,7 +49,6 @@ public class DeviceManager implements IdentityManager {
private AtomicLong devicesLastUpdate = new AtomicLong();
private Map<Long, Group> groupsById;
- private Map<String, Group> groupsByName;
private AtomicLong groupsLastUpdate = new AtomicLong();
private final Map<Long, Position> positions = new ConcurrentHashMap<>();
@@ -246,9 +245,6 @@ public class DeviceManager implements IdentityManager {
if (groupsById == null) {
groupsById = new ConcurrentHashMap<>(databaseGroups.size());
}
- if (groupsByName == null) {
- groupsByName = new ConcurrentHashMap<>(databaseGroups.size());
- }
Set<Long> databaseGroupsIds = new HashSet<>();
for (Group group : databaseGroups) {
databaseGroupsIds.add(group.getId());
@@ -258,7 +254,6 @@ public class DeviceManager implements IdentityManager {
cachedGroup.setGroupId(group.getGroupId());
} else {
groupsById.put(group.getId(), group);
- groupsByName.put(group.getName(), group);
}
}
for (Long cachedGroupId : groupsById.keySet()) {
@@ -274,10 +269,6 @@ public class DeviceManager implements IdentityManager {
return groupsById.get(id);
}
- public Group getGroupByName(String name) {
- return groupsByName.get(name);
- }
-
public Collection<Group> getAllGroups() {
boolean forceUpdate = groupsById.isEmpty();
@@ -313,24 +304,17 @@ public class DeviceManager implements IdentityManager {
checkGroupCycles(group);
dataManager.addGroup(group);
groupsById.put(group.getId(), group);
- groupsByName.put(group.getName(), group);
}
public void updateGroup(Group group) throws SQLException {
- String oldGroupName = groupsById.get(group.getId()).getName();
checkGroupCycles(group);
dataManager.updateGroup(group);
groupsById.put(group.getId(), group);
- if (!oldGroupName.equals(group.getName())) {
- groupsByName.remove(oldGroupName);
- }
- groupsByName.put(group.getName(), group);
}
public void removeGroup(long groupId) throws SQLException {
dataManager.removeGroup(groupId);
groupsById.remove(groupId);
- groupsByName.remove(getGroupById(groupId).getName());
}
public boolean lookupAttributeBoolean(