Browse Source

Javadoc updated

lp-tu 10 years ago
parent
commit
df74b425f6

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/HoneyService.java

@@ -250,7 +250,7 @@ public class HoneyService extends Service {
 
 	/**
 	 * Creates a instance of each protocol defined in /res/values/protocols.xml and puts it in a List
-	 * @return ArrayList of {@link de.tudarmstadt.informatik.hostage.protocol.Protocol}
+	 * @return ArrayList of {@link de.tudarmstadt.informatik.hostage.protocol.Protocol Protocol}
 	 */
 	private ArrayList<Protocol> getProtocolArray() {
 		String[] protocols = getResources().getStringArray(R.array.protocols);

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/commons/GetExternalIPTask.java

@@ -10,7 +10,7 @@ import org.json.JSONObject;
 
 import android.os.AsyncTask;
 /**
- * A {@link android.os.AsyncTask} that determines and returns the external IP address of the device.
+ * A AsyncTask that determines and returns the external IP address of the device.
  * Therefore it uses a given URL to get a JSON Object containing the external IP address.
  * @author Lars Pandikow
  *

+ 5 - 1
src/de/tudarmstadt/informatik/hostage/handler/AbstractHandler.java

@@ -15,7 +15,11 @@ import de.tudarmstadt.informatik.hostage.logging.Logger;
 import de.tudarmstadt.informatik.hostage.logging.Record;
 import de.tudarmstadt.informatik.hostage.logging.Record.TYPE;
 import de.tudarmstadt.informatik.hostage.protocol.Protocol;
-
+/**
+ * Abstract class for a connection handler using a given protocol.
+ * @author Mihai Plasoianu 
+ *
+ */
 public abstract class AbstractHandler implements Runnable {
 
 	/**

+ 7 - 7
src/de/tudarmstadt/informatik/hostage/logging/DatabaseHandler.java

@@ -82,8 +82,8 @@ public class DatabaseHandler extends SQLiteOpenHelper {
 	}
 
 	/**
-	 * Adds a given record to the database.
-	 * @param record The added record.
+	 * Adds a given {@link Record}  to the database.
+	 * @param record The added {@link Record} .
 	 */
 	public void addRecord(Record record) {
 		SQLiteDatabase db = this.getWritableDatabase();
@@ -113,9 +113,9 @@ public class DatabaseHandler extends SQLiteOpenHelper {
 	}
 	
 	/**
-	 * Creates a {@link Record} from a {@link Cursor}. If the cursor does not show to a valid data structure a runtime exception is thrown.
+	 * Creates a {@link Record} from a Cursor. If the cursor does not show to a valid data structure a runtime exception is thrown.
 	 * @param cursor
-	 * @return Returns the created Record.
+	 * @return Returns the created {@link Record} .
 	 */
 	private Record createRecord(Cursor cursor){
 		Record record = new Record();
@@ -403,7 +403,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
     }
     
     /**
-     * Deletes all records from {@link TABLE_RECORDS} with a specific BSSID.
+     * Deletes all records from {@link #TABLE_RECORDS} with a specific BSSID.
      * @param bssid The BSSID to match against.
      */
     public void deleteByBSSID(String bssid){
@@ -413,7 +413,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
     }
     
     /**
-     * Deletes all records from {@link TABLE_RECORDS} with a time stamp smaller then the given
+     * Deletes all records from {@link #TABLE_RECORDS} with a time stamp smaller then the given
      * @param date A Date represented in milliseconds.
      */
     public void deleteByDate(long date){
@@ -424,7 +424,7 @@ public class DatabaseHandler extends SQLiteOpenHelper {
     }
     
     /**
-     *  Deletes all records from {@link TABLE_RECORDS}.
+     *  Deletes all records from {@link #TABLE_RECORDS}.
      */
     public void clearData(){
     	SQLiteDatabase db = this.getReadableDatabase();

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

@@ -211,8 +211,8 @@ public class Record implements Serializable {
 	}
 	
 	/**
-	 * Returns a string representation after a chosen format. Formats should be defined in /res/values/arrays.xml to use with {@link de.tudarmstadt.informatik.hostage.ui.ViewLog#exportDatabase(android.view.View)}
-	 * The Intger representation of the format is equal to its position in the format array.
+	 * Returns a string representation after a chosen format. Formats should be defined in /res/values/arrays.xml to use with {@link de.tudarmstadt.informatik.hostage.ui.ViewLog#exportDatabase(android.view.View) exportDatabase(...)}
+	 * The Integer representation of the format is equal to its position in the format array.
 	 * @param format Integer representation of the format.
 	 * @return A string representation after chosen format.
 	 */

+ 5 - 1
src/de/tudarmstadt/informatik/hostage/logging/SQLLogger.java

@@ -3,7 +3,11 @@ 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;

+ 5 - 2
src/de/tudarmstadt/informatik/hostage/net/MySSLSocketFactory.java

@@ -16,9 +16,12 @@ import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 
 import org.apache.http.conn.ssl.SSLSocketFactory;
-
+/**
+ * SocketFactory to create a SSL socket that accepts every certificate.
+ *
+ */
 public class MySSLSocketFactory extends SSLSocketFactory {
-	SSLContext sslContext = SSLContext.getInstance("TLS");
+	private SSLContext sslContext = SSLContext.getInstance("TLS");
 
 	public MySSLSocketFactory(KeyStore truststore)
 			throws NoSuchAlgorithmException, KeyManagementException,

+ 12 - 14
src/de/tudarmstadt/informatik/hostage/ui/MainActivity.java

@@ -185,7 +185,7 @@ public class MainActivity extends Activity {
 	}
 
 	/**
-	 * Called when User presses on/off button
+	 * Called when User presses on/off button.
 	 * @param view
 	 */
 	public void buttonOnOffClick(View view) {
@@ -203,7 +203,7 @@ public class MainActivity extends Activity {
 	}
 	
 	/**
-	 * Starts the ViewLog activity, when the Button is pressed
+	 * Starts the ViewLog activity, when the Button is pressed.
 	 * @see ViewLog
 	 * @param view View elements which triggers the method call.
 	 */
@@ -301,8 +301,7 @@ public class MainActivity extends Activity {
 	}
 
 	/**
-	 * Initializes the ListView. Creating its contents dynamic from protocol protocols.xml
-	 * @see /res/values/protocols.xml
+	 * Initializes the ListView. Creating its contents dynamic from protocol res/values/protocols.xml
 	 */
 	private void initListView() {
 		ArrayList<HashMap<String, String>> data = new ArrayList<HashMap<String, String>>();
@@ -345,9 +344,8 @@ public class MainActivity extends Activity {
 	}
 
 	/**
-	 * Checks if a HoneService instance is running.
-	 * @return True if HonerService is running, else false.
-	 * @see HonerService
+	 * Checks if a {@link HoneyService} instance is running.
+	 * @return True if {@link HoneyService}  is running, else false.
 	 */
 	private boolean isServiceRunning() {
 		ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
@@ -369,7 +367,7 @@ public class MainActivity extends Activity {
 
 	/**
 	 * Register broadcast receiver for custom broadcast.
-	 * @see MainActivity#BROADCAST
+	 * @see #BROADCAST
 	 */
 	private void registerReceiver() {
 		LocalBroadcastManager.getInstance(this).registerReceiver(mReceiver,
@@ -378,7 +376,7 @@ public class MainActivity extends Activity {
 
 	/**
 	 * Unregisters broadcast receiver for custom broadcast.
-	 * @see MainActivity#BROADCAST
+	 * @see #BROADCAST
 	 */
 	private void unregisterReceiver() {
 		LocalBroadcastManager.getInstance(this).unregisterReceiver(mReceiver);
@@ -386,7 +384,7 @@ public class MainActivity extends Activity {
 	
 	/**
 	 * Receiver for custom broadcast.
-	 * @see MainActivity#BROADCAST
+	 * @see #BROADCAST
 	 */
 	private BroadcastReceiver mReceiver = new BroadcastReceiver() {
 		@Override
@@ -489,10 +487,10 @@ public class MainActivity extends Activity {
 	/**
 	 * Sets the big light indicator.
 	 * @param light Integer code to set the light color.
-	 * @see MainActivity#LIGHT_GREY 
-	 * @see MainActivity#LIGHT_GREEN
-	 * @see MainActivity#LIGHT_RED
-	 * @see MainActivity#LIGHT_YELLOW
+	 * @see #LIGHT_GREY 
+	 * @see #LIGHT_GREEN
+	 * @see #LIGHT_RED
+	 * @see #LIGHT_YELLOW
 	 */
 	private void updateStatusLight(int light) {
 		switch (light) {

+ 1 - 1
src/de/tudarmstadt/informatik/hostage/ui/SettingsActivity.java

@@ -11,7 +11,7 @@ import android.preference.PreferenceManager;
 import android.util.Log;
 import android.widget.Toast;
 /**
- * SettingsActivity creates the settings defined in /xml/preferences.xml.
+ * SettingsActivity creates the settings defined in /res/xml/preferences.xml.
  * @author Lars Pandikow.
  */
 public class SettingsActivity extends PreferenceActivity implements OnSharedPreferenceChangeListener {