Author: batosai
Date: 2008-10-03 19:35:24 +0000 (Fri, 03 Oct 2008)
New Revision: 22933
Modified:
trunk/plugins/WoT/Config.java
trunk/plugins/WoT/Identity.java
trunk/plugins/WoT/IdentityFetcher.java
trunk/plugins/WoT/IdentityInserter.java
trunk/plugins/WoT/IdentityParser.java
trunk/plugins/WoT/WoT.java
Log:
Javadoc
Modified: trunk/plugins/WoT/Config.java
===================================================================
--- trunk/plugins/WoT/Config.java 2008-10-03 19:02:39 UTC (rev 22932)
+++ trunk/plugins/WoT/Config.java 2008-10-03 19:35:24 UTC (rev 22933)
@@ -16,9 +16,13 @@
*/
public class Config {
+ /**
+ * The HashMap that contains all cofiguration parameters
+ */
private HashMap<String, String> params = null;
/**
+ * Creates a new Config object.
*
* @param db The database where the configuration is stored.
*/
@@ -33,8 +37,8 @@
/**
* Sets a configuration parameter and stores it in the database.
*
- * @param key
- * @param value
+ * @param key Name of the config parameter.
+ * @param value Value of the config parameter.
*/
public synchronized void set(String key, String value) {
params.put(key, value);
@@ -51,6 +55,8 @@
}
/**
+ * Check wheter a config parameter exists.
+ *
* @param key name of the configuration parameter
* @return whether it exists or not
*/
Modified: trunk/plugins/WoT/Identity.java
===================================================================
--- trunk/plugins/WoT/Identity.java 2008-10-03 19:02:39 UTC (rev 22932)
+++ trunk/plugins/WoT/Identity.java 2008-10-03 19:35:24 UTC (rev 22933)
@@ -28,13 +28,21 @@
import freenet.support.Logger;
/**
- * An identity as handled by the WoT (a USK)
+ * An identity as handled by the WoT (a USK).
+ * <p>
+ * It has a nickName and as many custom properties as needed (set by the user).
*
* @author Julien Cornuwel (batosai at freenetproject.org)
+ * @param id A unique identifier used to query an Identity from the database
+ * @param requestURI The requestURI used to fetch this identity from Freenet
+ * @param nickName The nickname of an Identity
+ * @param publishTrustList Whether an identity publishes its trust list or not
+ * @param props A HashMap containing all custom properties o an Identity
+ * @param contexts An ArrayList containing contexts (eg. client apps) an
Identity is used for
*/
public class Identity {
- // Capacity is the maximum amount of points an identity can give to an
other by trusting it.
+ /** Capacity is the maximum amount of points an identity can give to an
other by trusting it. */
public final static int capacities[] = {
100,// Rank 0 : Own identities
40, // Rank 1 : Identities directly trusted by
ownIdenties
@@ -44,14 +52,22 @@
1 // Every identity above rank 5 can give 1 point
}; // Identities with negative score have zero
capacity
+ /**
+ * A unique identifier used to query this Identity from the database.
+ * In fact, it is simply a String representing its routing key.
+ */
private String id;
-
+ /** The requestURI used to fetch this identity from Freenet */
private FreenetURI requestURI;
-
+ /** Date of this identity's last modification (last time we fetched it
from Freenet) */
private Date lastChange;
+ /** The nickname of this Identity */
private String nickName;
+ /** Whether this Identity publishes its trust list or not */
private boolean publishTrustList;
+ /** A list of this Identity's custom properties */
private HashMap<String, String> props;
+ /** A list of contexts (eg. client apps) this Identity is used for */
private ArrayList<String> contexts;
/**
@@ -60,7 +76,7 @@
* @param requestURI A {@link FreenetURI} to fetch this Identity
* @param nickName The nickname of this identity
* @param publishTrustList Whether this identity publishes its
trustList or not
- * @throws InvalidParameterException if a parameter is invalid
+ * @throws InvalidParameterException if a supplied parameter is invalid
*/
public Identity (FreenetURI requestURI, String nickName, String
publishTrustList) throws InvalidParameterException {
@@ -80,7 +96,7 @@
* @param requestURI A String that will be converted to {@link
FreenetURI} before creating the identity
* @param nickName The nickname of this identity
* @param publishTrustList Whether this identity publishes its
trustList or not
- * @throws InvalidParameterException if a parameter is invalid
+ * @throws InvalidParameterException if a supplied parameter is invalid
* @throws MalformedURLException if the supplied requestURI isn't a
valid FreenetURI
*/
public Identity (String requestURI, String nickName, String
publishTrustList) throws InvalidParameterException, MalformedURLException {
Modified: trunk/plugins/WoT/IdentityFetcher.java
===================================================================
--- trunk/plugins/WoT/IdentityFetcher.java 2008-10-03 19:02:39 UTC (rev
22932)
+++ trunk/plugins/WoT/IdentityFetcher.java 2008-10-03 19:35:24 UTC (rev
22933)
@@ -31,8 +31,11 @@
*/
public class IdentityFetcher implements ClientCallback {
+ /** A reference to the database */
private ObjectContainer db;
+ /** A refeerence to the HighLevelSimpleClient used to talk with the
node */
private HighLevelSimpleClient client;
+ /** A list of all current requests */
private ArrayList<ClientGetter> requests;
/**
Modified: trunk/plugins/WoT/IdentityInserter.java
===================================================================
--- trunk/plugins/WoT/IdentityInserter.java 2008-10-03 19:02:39 UTC (rev
22932)
+++ trunk/plugins/WoT/IdentityInserter.java 2008-10-03 19:35:24 UTC (rev
22933)
@@ -39,10 +39,13 @@
*/
public class IdentityInserter implements Runnable {
+ /** A reference to the database */
ObjectContainer db;
+ /** A reference the HighLevelSimpleClient used to perform inserts */
HighLevelSimpleClient client;
+ /** The TempBucketFactory used to create buckets from Identities
before insert */
final TempBucketFactory tBF;
-
+ /** Used to tell the InserterThread if it should stop */
boolean isRunning;
/**
Modified: trunk/plugins/WoT/IdentityParser.java
===================================================================
--- trunk/plugins/WoT/IdentityParser.java 2008-10-03 19:02:39 UTC (rev
22932)
+++ trunk/plugins/WoT/IdentityParser.java 2008-10-03 19:35:24 UTC (rev
22933)
@@ -34,7 +34,7 @@
*
*/
public class IdentityParser {
-
+
ObjectContainer db;
HighLevelSimpleClient client;
IdentityFetcher fetcher;
Modified: trunk/plugins/WoT/WoT.java
===================================================================
--- trunk/plugins/WoT/WoT.java 2008-10-03 19:02:39 UTC (rev 22932)
+++ trunk/plugins/WoT/WoT.java 2008-10-03 19:35:24 UTC (rev 22933)
@@ -712,12 +712,10 @@
}
public String getString(String key) {
- // TODO Auto-generated method stub
return key;
}
public void setLanguage(LANGUAGE newLanguage) {
- // TODO Auto-generated method stub
}
public PageMaker getPageMaker() {