Browse Source

logger only for logging

Mihai Plasoianu 10 years ago
parent
commit
4afe222f7c

+ 0 - 44
src/de/tudarmstadt/informatik/hostage/logging/Logger.java

@@ -8,12 +8,8 @@ import de.tudarmstadt.informatik.hostage.persistence.HostageDBOpenHelper;
 public class Logger extends IntentService {
 
 	private static final String ACTION_LOG = "de.tudarmstadt.informatik.hostage.action.LOG";
-	private static final String ACTION_DELETE_BY_BSSID = "de.tudarmstadt.informatik.hostage.action.DELETE_BY_BSSID";
-	private static final String ACTION_DELETE_BY_DATE = "de.tudarmstadt.informatik.hostage.action.DELETE_BY_DATE";
-	private static final String ACTION_DELETE_ALL = "de.tudarmstadt.informatik.hostage.action.DELETE_ALL";
 
 	private static final String EXTRA_RECORD = "de.tudarmstadt.informatik.hostage.extra.RECORD";
-	private static final String EXTRA_MISC = "de.tudarmstadt.informatik.hostage.extra.MISC";
 
 	public static void log(Context context, Record record) {
 		Intent intent = new Intent(context, Logger.class);
@@ -22,26 +18,6 @@ public class Logger extends IntentService {
 		context.startService(intent);
 	}
 
-	public static void deleteByBssid(Context context, String bssid) {
-		Intent intent = new Intent(context, Logger.class);
-		intent.setAction(ACTION_DELETE_BY_BSSID);
-		intent.putExtra(EXTRA_MISC, bssid);
-		context.startService(intent);
-	}
-
-	public static void deleteByDate(Context context, long timestamp) {
-		Intent intent = new Intent(context, Logger.class);
-		intent.setAction(ACTION_DELETE_BY_DATE);
-		intent.putExtra(EXTRA_MISC, timestamp);
-		context.startService(intent);
-	}
-
-	public static void deleteAll(Context context) {
-		Intent intent = new Intent(context, Logger.class);
-		intent.setAction(ACTION_DELETE_ALL);
-		context.startService(intent);
-	}
-
 	private HostageDBOpenHelper mDbHelper;
 
 	public Logger() {
@@ -58,18 +34,6 @@ public class Logger extends IntentService {
 		mDbHelper.addRecord(record);
 	}
 
-	private void handleActionDeleteByBssid(String bssid) {
-		mDbHelper.deleteByBSSID(bssid);
-	}
-
-	private void handleActionDeleteByDate(long timestamp) {
-		mDbHelper.deleteByDate(timestamp);
-	}
-
-	private void handleActionDeleteAll() {
-		mDbHelper.clearData();
-	}
-
 	@Override
 	protected void onHandleIntent(Intent intent) {
 		if (intent != null) {
@@ -77,14 +41,6 @@ public class Logger extends IntentService {
 			if (ACTION_LOG.equals(action)) {
 				final Record record = intent.getParcelableExtra(EXTRA_RECORD);
 				handleActionLog(record);
-			} else if (ACTION_DELETE_BY_BSSID.equals(action)) {
-				final String bssid = intent.getStringExtra(EXTRA_MISC);
-				handleActionDeleteByBssid(bssid);
-			} else if (ACTION_DELETE_BY_DATE.equals(action)) {
-				final long timestamp = intent.getLongExtra(EXTRA_MISC, -1L);
-				handleActionDeleteByDate(timestamp);
-			} else if (ACTION_DELETE_ALL.equals(action)) {
-				handleActionDeleteAll();
 			}
 		}
 	}

+ 0 - 12
src/de/tudarmstadt/informatik/hostage/logging/Record.java

@@ -4,18 +4,6 @@ import android.os.Parcel;
 import android.os.Parcelable;
 import de.tudarmstadt.informatik.hostage.logging.formatter.Formatter;
 
-/**
- * This class defines the attributes of a record.<br>
- * A Record is a single message exchanged between the application and an
- * attacker.<br>
- * The class has no own functionality except for getter and setter methods. To
- * change the logging mechanism you have to to change the logger in
- * {@link de.tudarmstadt.informatik.hostage.Hostage HoneyService} and
- * {@link de.tudarmstadt.informatik.hostage.ui.ViewLog ViewLog}
- * 
- * @author Mihai Plasoianu
- * @author Lars Pandikow
- */
 public class Record implements Parcelable {
 
 	public static enum TYPE {