Update of /cvsroot/magicmap//magicmapserver/src/net/sf/magicmap/server/cache
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9906/src/net/sf/magicmap/server/cache
Modified Files:
PositionCache.java
Log Message:
kleinere wichtige Bugfixes
Index: PositionCache.java
===================================================================
RCS file: /cvsroot/magicmap//magicmapserver/src/net/sf/magicmap/server/cache/PositionCache.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** PositionCache.java 23 Feb 2006 22:18:26 -0000 1.11
--- PositionCache.java 6 Mar 2006 10:59:03 -0000 1.12
***************
*** 168,171 ****
--- 168,176 ----
pos.setAccessPoint(ap);
}
+ if (position.getClient()==null && position.getAccessPoint()== null){
+ Client client = checkClient(getMapHashtable(map).getLocationCreator(position.getId()),pm);
+ setNewSignalCharacter(position,pm, client,pos);
+ }
+
JDOUtil.commit(tx);
} catch (Exception e) {
***************
*** 223,226 ****
--- 228,236 ----
dto.setClient(clientDTO);
}
+ if (client == null && ap == null){
+ String mac = ((ScanResult) pos.getScanResults().iterator().next()).getClient().getMac();
+ getMapHashtable(map).addLocationCreator(pos.getId(),mac);
+ }
+
dto.setId(new Long(pos.getId()));
dto.setDeleted(pos.isDeleted());
***************
*** 350,353 ****
--- 360,371 ----
}
+ public void createOrUpdatePosition(Map map, PositionDTO pos, String clientMac){
+
+ createOrUpdatePosition(map,pos);
+ getMapHashtable(map).addLocationCreator(getPositionForClientOnMap(map,pos.getName()).getId(),clientMac);
+
+
+ }
+
}
***************
*** 359,367 ****
--- 377,398 ----
private Hashtable<Long, String> idHash;
+
+ private Hashtable<Long, String> locationCreatorHash;
+ protected void addLocationCreator(Long id, String clientMac) {
+ if (locationCreatorHash.containsKey(id))
+ locationCreatorHash.remove(id);
+ locationCreatorHash.put(id, clientMac);
+ }
+
+ protected String getLocationCreator(Long id){
+ return locationCreatorHash.get(id);
+ }
+
protected PositionCacheEntry() {
positionHash = new Hashtable<String, PositionDTO>(60);
timeMap = new TreeMap<Long, String>();
idHash = new Hashtable<Long, String>(60);
+ locationCreatorHash = new Hashtable<Long, String>(60);
}
***************
*** 463,466 ****
--- 494,498 ----
positions[i++] = getPosition((String) it.next());
}
+ System.out.println("leaving getPositionsSince()");
return positions;
}
|