1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- package de.tudarmstadt.informatik.hostage.logging;
- import java.util.ArrayList;
- import android.content.Context;
- /**
- * Implementation of the Logger interface using the {@link DatabaseHandler} to create a SQL database.
- * @author Lars Pandikow
- *
- */
- public class SQLLogger implements Logger{
- Context context;
- DatabaseHandler dbh;
-
- public SQLLogger(Context context){
- this.context = context;
- dbh = new DatabaseHandler(context);
- }
-
- public synchronized void write(Record record) {
- dbh.addRecord(record);
- }
-
- public ArrayList<Record> getAllRecords() {
- return dbh.getAllRecords();
- }
-
- public ArrayList<Record> getRecordOfEachAttack(int lastUploadedAttackId) {
- return dbh.getRecordOfEachAttack(lastUploadedAttackId);
- }
-
- public Record getRecordOfAttackId(long attack_id) {
- return dbh.getRecordOfAttackId(attack_id);
- }
-
- public int getAttackCount() {
- return dbh.getAttackCount();
- }
-
- public int getAttackPerProtokolCount(String protocol) {
- return dbh.getAttackPerProtokolCount(protocol);
- }
-
- public long getSmallestAttackId() {
- return dbh.getSmallestAttackId();
- }
-
- public long getHighestAttackId() {
- return dbh.getHighestAttackId();
- }
-
- public boolean bssidSeen(String protocol, String bssid) {
- return dbh.bssidSeen(protocol, bssid);
- }
-
- public String[] getAllBSSIDS() {
- return dbh.getAllBSSIDS();
- }
-
- public String getSSID(String bssid) {
- return dbh.getSSID(bssid);
- }
-
- public void deleteByDate(long time) {
- dbh.deleteByDate(time);
- }
-
- public void deleteByBSSID(String bssid) {
- dbh.deleteByBSSID(bssid);
- }
-
- public void clearData() {
- dbh.clearData();
- }
- }
|