@Override public String getDataAsCsvString(Sessionlog session) { List<Acceleration> accLogs = logService.getAllBySessionId(Acceleration.class, session); List<Compass> comLogs = logService.getAllBySessionId(Compass.class, session); List<KeyPress> keyPresses = logService.getAllBySessionId(KeyPress.class, session); List<Keyboard> keyboards = logService.getAllBySessionId(Keyboard.class, session); List<Orientation> gyroLogs = logService.getAllBySessionId(Orientation.class, session); List<Gps> gpsLogs = logService.getAllBySessionId(Gps.class, session); List<Touch> touchLogs = logService.getAllBySessionId(Touch.class, session); Gson gson = new Gson(); com.google.gson.GsonBuilder builder = new com.google.gson.GsonBuilder(); Set<Entry<String, JsonElement>> entrySet = null; System.out.println("here"); for (Entry<String, JsonElement> entry : entrySet) { System.out.println(entry.getKey() + " : " + entry.getValue()); } System.out.println("and here"); // phoneid, networkInterface, searchResult, gpsJotai // asd,networkasd,asd,12 return null; // formatForJsp(session).getLogData(); }
@Transactional(readOnly = false) public void updateComputer(Computer pComputer) { Log l = new Log(); Date now = Calendar.getInstance().getTime(); l.setDateLog(now); l.setOptionLog("Uptade"); l.setComputerLog(pComputer.toString()); compDao.updateComputer(pComputer); logDao.addLog(l); }
@Transactional(readOnly = false) public void deleteComputer(int pIdComputer) { Log l = new Log(); Date now = Calendar.getInstance().getTime(); l.setDateLog(now); l.setOptionLog("Delete"); l.setComputerLog(this.getComputerById(pIdComputer).toString()); compDao.deleteComputer(pIdComputer); logDao.addLog(l); }
private <T extends Abstractlog> List<T> pullFromDb(Class<T> cls, DataHolder data) { return logService.getAllBySessionId(cls, data.getSession()); }