From: Florian L. <fle...@us...> - 2006-03-29 14:49:57
|
Update of /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19173/src/net/sf/magicmap/server/facade Modified Files: PositionFacade2.java Log Message: Index: PositionFacade2.java =================================================================== RCS file: /cvsroot/magicmap/magicmapserver/src/net/sf/magicmap/server/facade/PositionFacade2.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PositionFacade2.java 29 Mar 2006 10:05:43 -0000 1.16 --- PositionFacade2.java 29 Mar 2006 14:49:45 -0000 1.17 *************** *** 2,6 **** --- 2,10 ---- package net.sf.magicmap.server.facade; + import java.io.File; + import java.io.FileOutputStream; import java.io.FileWriter; + import java.io.OutputStream; + import java.io.PrintWriter; import java.rmi.RemoteException; import java.util.Collection; *************** *** 93,114 **** pos.setPosY(positionY); PositionCache.getPositionCache().createOrUpdatePosition(map, pos, client.getMac()); ! ! FileWriter fw; String string; int i = 0; try{ ! fw = new FileWriter("referenzpunkt.txt", true); while (i < character.getSimpleScanResults().length){ ! string = "TimeStamp: " + System.currentTimeMillis() + " SessionID: " + sessionId + " PositionName: " ! + positionName + " MapName: " + mapName + " Postition.X " + positionX + " Postition.Y " + positionY ! + " Fixed: " + fixed + " Character.getMacAP " + character.getSimpleScanResults()[i].getMacAP() ! + " Character.LastSeen: " + character.getSimpleScanResults()[i].getLastSeen() + " Character.noise " ! + character.getSimpleScanResults()[i].getNoise() + " Character.SignalLevel: " ! + character.getSimpleScanResults()[i].getSignalLevel() + " \n"; ! fw.write(string, 0, string.length()); ++i; } ! fw.flush(); ! fw.close(); } catch (Exception e){ e.printStackTrace(); --- 97,123 ---- pos.setPosY(positionY); PositionCache.getPositionCache().createOrUpdatePosition(map, pos, client.getMac()); ! String string; int i = 0; try{ ! FileOutputStream fs = new FileOutputStream(new File("referenzpunkt.txt"), true); ! PrintWriter pw = new PrintWriter(fs,true); while (i < character.getSimpleScanResults().length){ ! string = "TimeStamp: " + System.currentTimeMillis() ! + " SessionID: " + sessionId ! + " PositionName: " + positionName ! + " MapName: " + mapName ! + " Postition.X " + positionX ! + " Postition.Y " + positionY ! + " Fixed: " + fixed ! + " Character.getMacAP " + character.getSimpleScanResults()[i].getMacAP() ! + " Character.LastSeen: " + character.getSimpleScanResults()[i].getLastSeen() ! + " Character.noise " + character.getSimpleScanResults()[i].getNoise() ! + " Character.SignalLevel: " + character.getSimpleScanResults()[i].getSignalLevel(); ! pw.println(string); ++i; } ! pw.close(); ! fs.close(); } catch (Exception e){ e.printStackTrace(); *************** *** 241,244 **** --- 250,254 ---- SignalCharacterDTO character, String clientMac, boolean fixed) throws SessionException, MapException{ this.logger.info("createOrUpdateClientPosition()"); + PersistenceManager pm = null; try{ *************** *** 296,316 **** PositionCache.getPositionCache().createOrUpdatePosition(map, pos); - FileWriter fw; String string; int i = 0; try{ ! fw = new FileWriter("client.txt", true); while (i < character.getSimpleScanResults().length){ ! string = "TimeStamp: " + System.currentTimeMillis() + " SessionID: " + sessionId + " ClientMAC: " + clientMac ! + " MapName: " + mapName + " Postition.X " + positionX + " Postition.Y " + positionY + " Fixed: " + fixed ! + " Character.MacAP " + character.getSimpleScanResults()[i].getMacAP() + " Character.LastSeen: " ! + character.getSimpleScanResults()[i].getLastSeen() + " Character.noise " ! + character.getSimpleScanResults()[i].getNoise() + " Character.SignalLevel: " ! + character.getSimpleScanResults()[i].getSignalLevel() + " \n"; ! fw.write(string, 0, string.length()); ++i; } ! fw.flush(); ! fw.close(); } catch (Exception e){ e.printStackTrace(); --- 306,331 ---- PositionCache.getPositionCache().createOrUpdatePosition(map, pos); String string; int i = 0; try{ ! FileOutputStream fs = new FileOutputStream(new File("client.txt"), true); ! PrintWriter pw = new PrintWriter(fs,true); while (i < character.getSimpleScanResults().length){ ! string = "TimeStamp: " + System.currentTimeMillis() ! + " SessionID: " + sessionId ! + " ClientMAC: " + clientMac ! + " MapName: " + mapName ! + " Postition.X " + positionX ! + " Postition.Y " + positionY ! + " Fixed: " + fixed ! + " Character.getMacAP " + character.getSimpleScanResults()[i].getMacAP() ! + " Character.LastSeen: " + character.getSimpleScanResults()[i].getLastSeen() ! + " Character.noise " + character.getSimpleScanResults()[i].getNoise() ! + " Character.SignalLevel: " + character.getSimpleScanResults()[i].getSignalLevel(); ! pw.println(string); ++i; } ! pw.close(); ! fs.close(); } catch (Exception e){ e.printStackTrace(); *************** *** 501,513 **** pm.currentTransaction().begin(); checkSession(sessionId, pm); ! AccessPoint ap = findOrCreateAccessPoint(accessPointMac, pm); ap.setHidden(hidden); ! Map map = checkMap(mapName, pm); PositionDTO pos = PositionCache.getPositionCache().getPositionForClientOnMap(map, accessPointMac); if (pos != null && pos.getAccessPoint() != null){ ! pos.getAccessPoint().setHidden(hidden); ! PositionCache.getPositionCache().createOrUpdatePosition(map, pos); ! } else{ pos = new PositionDTO(); if (ap != null){ --- 516,528 ---- pm.currentTransaction().begin(); checkSession(sessionId, pm); ! AccessPoint ap = findOrCreateAccessPoint(accessPointMac,pm); ap.setHidden(hidden); ! Map map = checkMap(mapName, pm); PositionDTO pos = PositionCache.getPositionCache().getPositionForClientOnMap(map, accessPointMac); if (pos != null && pos.getAccessPoint() != null){ ! pos.getAccessPoint().setHidden(hidden); ! PositionCache.getPositionCache().createOrUpdatePosition(map, pos); ! }else { pos = new PositionDTO(); if (ap != null){ *************** *** 524,528 **** PositionCache.getPositionCache().createOrUpdatePosition(map, pos); } ! pm.currentTransaction().commit(); } catch (Exception e){ --- 539,543 ---- PositionCache.getPositionCache().createOrUpdatePosition(map, pos); } ! pm.currentTransaction().commit(); } catch (Exception e){ |