Author: batosai
Date: 2008-08-31 15:12:07 +0000 (Sun, 31 Aug 2008)
New Revision: 22277

Modified:
   trunk/apps/WoT/src/plugins/WoT/WoT.java
Log:
Logging

Modified: trunk/apps/WoT/src/plugins/WoT/WoT.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/WoT.java     2008-08-31 15:07:48 UTC (rev 
22276)
+++ trunk/apps/WoT/src/plugins/WoT/WoT.java     2008-08-31 15:12:07 UTC (rev 
22277)
@@ -57,11 +57,14 @@
                boolean changedTrustValue = false;
                boolean changedComment = false;

-               Logger.debug(this, "New trust relationship : " + newTrust);
+               Logger.debug(this, "Handling : " + newTrust);

                ObjectSet<Trust> trustResult = db.queryByExample(new 
Trust(newTrust.getTruster(), newTrust.getTrustee(), 0));
                if(trustResult.size() != 0) { // We are updating a existing 
trust relationship
                        Trust oldTrust = trustResult.next();
+                       
+                       Logger.debug(this, "Updating : " + oldTrust);
+                       
                        if(oldTrust.getValue() != newTrust.getValue()) { // The 
trust value has changed
                                changedTrustValue = true;
                                oldTrust.setValue(newTrust.getValue());
@@ -73,6 +76,9 @@
                        if(changedComment || changedTrustValue) 
db.store(oldTrust); // We store the changes, if needed
                }
                else { // This is a new trust relationship
+                       
+                       Logger.debug(this, "Creating : " + newTrust);
+                       
                        db.store(newTrust);
                        changedTrustValue = true;
                }
@@ -203,6 +209,11 @@
                return identities.size() - getNbOwnIdentities();
        }

+       public int getNbTrusts() {
+               ObjectSet<Trust> trusts = db.queryByExample(Trust.class);
+               return trusts.size();
+       }
+       
        public ObjectSet<OwnIdentity> getOwnIdentities() {
                return db.queryByExample(OwnIdentity.class);
        }


Reply via email to