Author: batosai
Date: 2008-08-31 11:39:39 +0000 (Sun, 31 Aug 2008)
New Revision: 22271
Modified:
trunk/apps/WoT/src/plugins/WoT/WoTplugin.java
Log:
Logging
Modified: trunk/apps/WoT/src/plugins/WoT/WoTplugin.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/WoTplugin.java 2008-08-31 10:30:37 UTC
(rev 22270)
+++ trunk/apps/WoT/src/plugins/WoT/WoTplugin.java 2008-08-31 11:39:39 UTC
(rev 22271)
@@ -224,6 +224,8 @@
// Remove the old identity
db.delete(old);
+ Logger.normal(this, "Successfully restored an already
known identity from Freenet (" + id.getNickName() + ")");
+
} catch (UnknownIdentityException e) {
id = new OwnIdentity(insertURI, requestURI, new Date(),
new Date(0), "Restore in progress...", "false");
@@ -233,6 +235,8 @@
// Store the new identity
db.store(id);
+
+ Logger.normal(this, "Trying to restore a not-yet-known
identity from Freenet (" + id.getRequestURI() + ")");
}
db.commit();
@@ -274,12 +278,14 @@
Identity identity;
try {
identity = wot.getIdentityByURI(requestURI);
+ Logger.error(this, "Tried to manually add an identity
we already know, ignored.");
throw new InvalidParameterException("We already have
this identity");
}
catch (UnknownIdentityException e) {
identity = new Identity(requestURI, new
Date(0), "Not found yet...", "false");
db.store(identity);
db.commit();
+ Logger.normal(this, "Trying to fetch manually
added identity (" + identity.getRequestURI() + ")");
fetcher.fetch(identity);
}
return identity;
@@ -312,6 +318,8 @@
// This identity trusts the seed identity
wot.setTrust(new Trust(identity, seed, 100, "I trust the WoT
plugin"));
+
+ Logger.normal(this, "Successfully created a new OwnIdentity ("
+ identity.getNickName() + ")");
db.commit();
@@ -323,6 +331,8 @@
id.addContext(context, db);
id.setLastChange(new Date());
db.store(id);
+
+ Logger.normal(this, "Added context '" + context + "' to
identity '" + id.getNickName() + "'");
}
private void removeContext(String identity, String context) throws
InvalidParameterException, MalformedURLException, UnknownIdentityException {
@@ -330,6 +340,8 @@
id.removeContext(context, db);
id.setLastChange(new Date());
db.store(id);
+
+ Logger.normal(this, "Removed context '" + context + "' from
identity '" + id.getNickName() + "'");
}
private void setProperty(String identity, String property, String
value) throws InvalidParameterException, MalformedURLException,
UnknownIdentityException {
@@ -337,6 +349,8 @@
id.setProp(property, value, db);
id.setLastChange(new Date());
db.store(id);
+
+ Logger.normal(this, "Added property '" + property + "=" + value
+ "' to identity '" + id.getNickName() + "'");
}
private String getProperty(String identity, String property) throws
InvalidParameterException, MalformedURLException, UnknownIdentityException {
@@ -348,6 +362,8 @@
id.removeProp(property, db);
id.setLastChange(new Date());
db.store(id);
+
+ Logger.normal(this, "Removed property '" + property + "' from
identity '" + id.getNickName() + "'");
}
@Override