Author: xor
Date: 2008-10-27 22:54:34 +0000 (Mon, 27 Oct 2008)
New Revision: 23123

Modified:
   trunk/plugins/FMSPlugin/WoT/FMSIdentityManagerWoT.java
   trunk/plugins/FMSPlugin/WoT/FMSIdentityWoT.java
   trunk/plugins/FMSPlugin/WoT/FMSOwnIdentityWoT.java
Log:
Implement.

Modified: trunk/plugins/FMSPlugin/WoT/FMSIdentityManagerWoT.java
===================================================================
--- trunk/plugins/FMSPlugin/WoT/FMSIdentityManagerWoT.java      2008-10-27 
22:54:16 UTC (rev 23122)
+++ trunk/plugins/FMSPlugin/WoT/FMSIdentityManagerWoT.java      2008-10-27 
22:54:34 UTC (rev 23123)
@@ -10,6 +10,10 @@
 import plugins.FMSPlugin.FMSIdentity;
 import plugins.FMSPlugin.FMSIdentityManager;

+import plugins.WoT.WoT;
+import plugins.WoT.Identity;
+import plugins.WoT.OwnIdentity;
+
 /**
  * An identity manager which uses the identities from the WoT plugin.
  * 
@@ -17,117 +21,23 @@
  *
  */
 public class FMSIdentityManagerWoT extends FMSIdentityManager {
+       
+       private WoT mWoT;

        /**
         * @param executor
         */
-       public FMSIdentityManagerWoT(Executor executor) {
+       public FMSIdentityManagerWoT(Executor executor, WoT newWoT) {
                super(executor);
-               // TODO Auto-generated constructor stub
+               mWoT = newWoT;
        }

-       /* (non-Javadoc)
-        * @see java.util.Set#add(java.lang.Object)
-        */
-       public boolean add(FMSIdentity e) {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#addAll(java.util.Collection)
-        */
-       public boolean addAll(Collection<? extends FMSIdentity> c) {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#clear()
-        */
-       public void clear() {
-               // TODO Auto-generated method stub
-
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#contains(java.lang.Object)
-        */
-       public boolean contains(Object o) {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#containsAll(java.util.Collection)
-        */
-       public boolean containsAll(Collection<?> c) {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#isEmpty()
-        */
-       public boolean isEmpty() {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#iterator()
-        */
-       public Iterator<FMSIdentity> iterator() {
-               // TODO Auto-generated method stub
+       public Iterator<FMSOwnIdentityWoT> ownIdentityIterator() {
                return null;
        }

-       /* (non-Javadoc)
-        * @see java.util.Set#remove(java.lang.Object)
-        */
-       public boolean remove(Object o) {
+       public Iterator<FMSIdentityWoT> iterator() {
                // TODO Auto-generated method stub
-               return false;
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#removeAll(java.util.Collection)
-        */
-       public boolean removeAll(Collection<?> c) {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#retainAll(java.util.Collection)
-        */
-       public boolean retainAll(Collection<?> c) {
-               // TODO Auto-generated method stub
-               return false;
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#size()
-        */
-       public int size() {
-               // TODO Auto-generated method stub
-               return 0;
-       }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#toArray()
-        */
-       public Object[] toArray() {
-               // TODO Auto-generated method stub
                return null;
        }
-
-       /* (non-Javadoc)
-        * @see java.util.Set#toArray(T[])
-        */
-       public <T> T[] toArray(T[] a) {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
 }

Modified: trunk/plugins/FMSPlugin/WoT/FMSIdentityWoT.java
===================================================================
--- trunk/plugins/FMSPlugin/WoT/FMSIdentityWoT.java     2008-10-27 22:54:16 UTC 
(rev 23122)
+++ trunk/plugins/FMSPlugin/WoT/FMSIdentityWoT.java     2008-10-27 22:54:34 UTC 
(rev 23123)
@@ -3,22 +3,39 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package plugins.FMSPlugin.WoT;

+import java.util.Date;
+
 import freenet.keys.FreenetURI;
 import plugins.FMSPlugin.FMSIdentity;

+import plugins.WoT.Identity;
+
 /**
  * @author xor
  *
  */
-public class FMSIdentityWoT extends FMSIdentity {
+public class FMSIdentityWoT implements FMSIdentity {
+       
+       protected final Identity mIdentity;

-       /**
-        * @param newNickname
-        * @param newRequestURI
-        */
-       public FMSIdentityWoT(String newNickname, FreenetURI newRequestURI) {
-               super(newNickname, newRequestURI);
-               // TODO Auto-generated constructor stub
+       public FMSIdentityWoT(Identity newIndentity) {
+               mIdentity = newIndentity;
        }

+       public boolean doesPublishTrustList() {
+               return mIdentity.doesPublishTrustList();
+       }
+
+       public Date getLastChange() {
+               return mIdentity.getLastChange();
+       }
+
+       public String getNickName() {
+               return mIdentity.getNickName();
+       }
+
+       public FreenetURI getRequestURI() {
+               return mIdentity.getRequestURI();
+       }
+
 }

Modified: trunk/plugins/FMSPlugin/WoT/FMSOwnIdentityWoT.java
===================================================================
--- trunk/plugins/FMSPlugin/WoT/FMSOwnIdentityWoT.java  2008-10-27 22:54:16 UTC 
(rev 23122)
+++ trunk/plugins/FMSPlugin/WoT/FMSOwnIdentityWoT.java  2008-10-27 22:54:34 UTC 
(rev 23123)
@@ -7,40 +7,28 @@

 import freenet.keys.FreenetURI;
 import plugins.FMSPlugin.FMSOwnIdentity;
+import plugins.WoT.Identity;
+import plugins.WoT.OwnIdentity;

 /**
  * @author xor
  *
  */
-public class FMSOwnIdentityWoT extends FMSOwnIdentity {
+public class FMSOwnIdentityWoT extends FMSIdentityWoT implements 
FMSOwnIdentity {

-       /**
-        * @param newNickname
-        * @param newRequestURI
-        * @param newInsertURI
-        * @param publishTrustList
-        */
-       public FMSOwnIdentityWoT(String newNickname, FreenetURI newRequestURI, 
FreenetURI newInsertURI, boolean publishTrustList) {
-               super(newNickname, newRequestURI, newInsertURI, 
publishTrustList);
-               // TODO Auto-generated constructor stub
+       public FMSOwnIdentityWoT(OwnIdentity newIndentity) {
+               super(newIndentity);
        }
+       
+       protected OwnIdentity getOwnIdentity() {
+               return (OwnIdentity)mIdentity;
+       }

-       /* (non-Javadoc)
-        * @see plugins.FMSPlugin.FMSOwnIdentity#getLastChange()
-        */
-       @Override
-       public Date getLastChange() {
-               // TODO Auto-generated method stub
-               return null;
+       public FreenetURI getInsertURI() {
+               return getOwnIdentity().getInsertURI();
        }

-       /* (non-Javadoc)
-        * @see plugins.FMSPlugin.FMSOwnIdentity#getLastInsert()
-        */
-       @Override
        public Date getLastInsert() {
-               // TODO Auto-generated method stub
-               return null;
+               return getOwnIdentity().getLastInsert();
        }
-
 }


Reply via email to