Author: toad
Date: 2008-06-20 17:35:38 +0000 (Fri, 20 Jun 2008)
New Revision: 20532

Modified:
   branches/db4o/freenet/src/freenet/client/async/ManifestElement.java
   branches/db4o/freenet/src/freenet/client/events/SplitfileProgressEvent.java
   branches/db4o/freenet/src/freenet/node/fcp/AddPeer.java
   branches/db4o/freenet/src/freenet/node/fcp/ClientGetMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ClientHelloMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java
   branches/db4o/freenet/src/freenet/node/fcp/ClientPutComplexDirMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ClientPutDiskDirMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ClientPutMessage.java
   
branches/db4o/freenet/src/freenet/node/fcp/CloseConnectionDuplicateClientNameMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ConfigData.java
   branches/db4o/freenet/src/freenet/node/fcp/DataFoundMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/DirPutFile.java
   branches/db4o/freenet/src/freenet/node/fcp/DirectDirPutFile.java
   branches/db4o/freenet/src/freenet/node/fcp/DiskDirPutFile.java
   branches/db4o/freenet/src/freenet/node/fcp/EndListPeerNotesMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/EndListPeersMessage.java
   
branches/db4o/freenet/src/freenet/node/fcp/EndListPersistentRequestsMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/FCPMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/FCPPluginMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/FCPPluginReply.java
   branches/db4o/freenet/src/freenet/node/fcp/FinishedCompressionMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/GenerateSSKMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/GetConfig.java
   branches/db4o/freenet/src/freenet/node/fcp/GetNode.java
   branches/db4o/freenet/src/freenet/node/fcp/GetPluginInfo.java
   branches/db4o/freenet/src/freenet/node/fcp/GetRequestStatusMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/IdentifierCollisionMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ListPeerMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ListPeerNotesMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ListPeersMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ListPersistentRequestsMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ModifyConfig.java
   branches/db4o/freenet/src/freenet/node/fcp/ModifyPeer.java
   branches/db4o/freenet/src/freenet/node/fcp/ModifyPeerNote.java
   branches/db4o/freenet/src/freenet/node/fcp/ModifyPersistentRequest.java
   branches/db4o/freenet/src/freenet/node/fcp/NodeData.java
   branches/db4o/freenet/src/freenet/node/fcp/NodeHelloMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/PeerMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/PeerNote.java
   branches/db4o/freenet/src/freenet/node/fcp/PeerRemoved.java
   branches/db4o/freenet/src/freenet/node/fcp/PersistentGet.java
   branches/db4o/freenet/src/freenet/node/fcp/PersistentPut.java
   branches/db4o/freenet/src/freenet/node/fcp/PersistentPutDir.java
   
branches/db4o/freenet/src/freenet/node/fcp/PersistentRequestModifiedMessage.java
   
branches/db4o/freenet/src/freenet/node/fcp/PersistentRequestRemovedMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/PluginInfoMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/PutFetchableMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/PutSuccessfulMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/RedirectDirPutFile.java
   branches/db4o/freenet/src/freenet/node/fcp/RemovePeer.java
   branches/db4o/freenet/src/freenet/node/fcp/RemovePersistentRequest.java
   branches/db4o/freenet/src/freenet/node/fcp/SSKKeypairMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/ShutdownMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/SimpleProgressMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/StartedCompressionMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/SubscribeUSKMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/SubscribedUSKUpdate.java
   branches/db4o/freenet/src/freenet/node/fcp/TestDDACompleteMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/TestDDAReplyMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/TestDDARequestMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/TestDDAResponseMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/URIGeneratedMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/UnknownNodeIdentifierMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/UnknownPeerNoteTypeMessage.java
   branches/db4o/freenet/src/freenet/node/fcp/WatchGlobal.java
Log:
Persist progressMessage.
Some related changes.

Modified: branches/db4o/freenet/src/freenet/client/async/ManifestElement.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/async/ManifestElement.java 
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/client/async/ManifestElement.java 
2008-06-20 17:35:38 UTC (rev 20532)
@@ -106,4 +106,10 @@
        public FreenetURI getTargetURI() {
                return targetURI;
        }
+
+       public void removeFrom(ObjectContainer container) {
+               data.removeFrom(container);
+               targetURI.removeFrom(container);
+               container.delete(this);
+       }
 }

Modified: 
branches/db4o/freenet/src/freenet/client/events/SplitfileProgressEvent.java
===================================================================
--- branches/db4o/freenet/src/freenet/client/events/SplitfileProgressEvent.java 
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/client/events/SplitfileProgressEvent.java 
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.client.events;

+import com.db4o.ObjectContainer;
+
 import freenet.support.Logger;

 public class SplitfileProgressEvent implements ClientEvent {
@@ -63,4 +65,8 @@
                return code;
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/AddPeer.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/AddPeer.java     2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/AddPeer.java     2008-06-20 
17:35:38 UTC (rev 20532)
@@ -14,6 +14,8 @@
 import java.net.URLConnection;
 import java.util.Arrays;

+import com.db4o.ObjectContainer;
+
 import freenet.io.comm.PeerParseException;
 import freenet.io.comm.ReferenceSignatureVerificationException;
 import freenet.node.FSParseException;
@@ -155,4 +157,8 @@
                handler.outputHandler.queue(new PeerMessage(pn, true, true, 
identifier));
        }

+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientGetMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientGetMessage.java    
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientGetMessage.java    
2008-06-20 17:35:38 UTC (rev 20532)
@@ -7,6 +7,8 @@
 import java.io.IOException;
 import java.net.MalformedURLException;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.FreenetURI;
 import freenet.node.Node;
 import freenet.node.RequestStarter;
@@ -265,4 +267,11 @@
                throw new IllegalArgumentException("Invalid or unsupported 
return type: "+returnTypeString(s));
        }

+       public void removeFrom(ObjectContainer container) {
+               uri.removeFrom(container);
+               container.delete(diskFile);
+               container.delete(tempFile);
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientHelloMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientHelloMessage.java  
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientHelloMessage.java  
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -46,4 +48,8 @@
                handler.setClientName(clientName);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java       
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientPutBase.java       
2008-06-20 17:35:38 UTC (rev 20532)
@@ -48,7 +48,7 @@
        // Not that important, so not saved on persistence.
        // Probably saving it would conflict with later changes (full 
persistence at
        // ClientPutter level).
-       private transient FCPMessage progressMessage;
+       private FCPMessage progressMessage;

        /** Whether to force an early generation of the CHK */
        protected final boolean earlyEncode;
@@ -188,10 +188,23 @@
                freeData(container);
                if(persistenceType == PERSIST_FOREVER) {
                        ctx.removeFrom(container);
-                       if(putFailedMessage != null)
-                               putFailedMessage.removeFrom(container);
-                       if(generatedURI != null)
-                               generatedURI.removeFrom(container);
+                       PutFailedMessage pfm;
+                       FreenetURI uri;
+                       FCPMessage progress;
+                       synchronized(this) {
+                               pfm = putFailedMessage;
+                               putFailedMessage = null;
+                               uri = generatedURI;
+                               generatedURI = null;
+                               progress = progressMessage;
+                               progressMessage = null;
+                       }
+                       if(pfm != null)
+                               pfm.removeFrom(container);
+                       if(uri != null)
+                               uri.removeFrom(container);
+                       if(progress != null)
+                               progress.removeFrom(container);
                        publicURI.removeFrom(container);
                }
        }
@@ -401,12 +414,18 @@
        }

        public void setVarsRestart(ObjectContainer container) {
+               PutFailedMessage pfm;
+               FCPMessage progress;
                synchronized(this) {
                        finished = false;
+                       pfm = putFailedMessage;
+                       progress = progressMessage;
                        this.putFailedMessage = null;
                        this.progressMessage = null;
                        started = false;
                }
+               pfm.removeFrom(container);
+               progress.removeFrom(container);
                if(persistenceType == PERSIST_FOREVER)
                        container.set(this);
        }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/ClientPutComplexDirMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientPutComplexDirMessage.java  
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientPutComplexDirMessage.java  
2008-06-20 17:35:38 UTC (rev 20532)
@@ -11,6 +11,8 @@
 import java.util.LinkedList;
 import java.util.Map;

+import com.db4o.ObjectContainer;
+
 import freenet.client.async.ManifestElement;
 import freenet.node.Node;
 import freenet.support.Logger;
@@ -172,4 +174,23 @@
                }
        }

+       public void removeFrom(ObjectContainer container) {
+               filesToRead.clear();
+               removeFrom(container, filesByName);
+               container.delete(this);
+       }
+
+       private void removeFrom(ObjectContainer container, HashMap filesByName) 
{
+               Iterator i = filesByName.values().iterator();
+               while(i.hasNext()) {
+                       Object val = i.next();
+                       if(val instanceof HashMap) {
+                               removeFrom(container, (HashMap) val);
+                       } else {
+                               ((DirPutFile)val).removeFrom(container);
+                       }
+               }
+               container.delete(this);
+       }
+
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/ClientPutDiskDirMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientPutDiskDirMessage.java     
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientPutDiskDirMessage.java     
2008-06-20 17:35:38 UTC (rev 20532)
@@ -9,6 +9,8 @@
 import java.io.OutputStream;
 import java.util.HashMap;

+import com.db4o.ObjectContainer;
+
 import freenet.client.DefaultMIMETypes;
 import freenet.client.async.ManifestElement;
 import freenet.node.Node;
@@ -112,4 +114,9 @@
                // Do nothing
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(dirname);
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ClientPutMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ClientPutMessage.java    
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ClientPutMessage.java    
2008-06-20 17:35:38 UTC (rev 20532)
@@ -7,6 +7,8 @@
 import java.io.IOException;
 import java.net.MalformedURLException;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.FreenetURI;
 import freenet.node.Node;
 import freenet.node.RequestStarter;
@@ -282,5 +284,12 @@
        boolean isGlobal() {
                return global;
        }
+
+       public void removeFrom(ObjectContainer container) {
+               uri.removeFrom(container);
+               container.delete(origFilename);
+               if(redirectTarget != null)
+                       redirectTarget.removeFrom(container);
+       }

 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/CloseConnectionDuplicateClientNameMessage.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/node/fcp/CloseConnectionDuplicateClientNameMessage.java
   2008-06-20 16:38:50 UTC (rev 20531)
+++ 
branches/db4o/freenet/src/freenet/node/fcp/CloseConnectionDuplicateClientNameMessage.java
   2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -25,4 +27,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"CloseConnectionDuplicateClientName goes from server to client not the other 
way around", null, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ConfigData.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ConfigData.java  2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ConfigData.java  2008-06-20 
17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.config.Config;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -99,4 +101,9 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "ConfigData goes 
from server to client not the other way around", null, false);
        }

+
+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/DataFoundMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/DataFoundMessage.java    
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/DataFoundMessage.java    
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.client.FetchResult;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -45,4 +47,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "DataFound goes 
from server to client not the other way around", identifier, global);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/DirPutFile.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/DirPutFile.java  2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/DirPutFile.java  2008-06-20 
17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.client.ClientMetadata;
 import freenet.client.DefaultMIMETypes;
 import freenet.client.async.ManifestElement;
@@ -72,4 +74,6 @@
                return new ManifestElement(n, getData(), getMIMEType(), 
getData().size());
        }

+       public abstract void removeFrom(ObjectContainer container);
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/DirectDirPutFile.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/DirectDirPutFile.java    
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/DirectDirPutFile.java    
2008-06-20 17:35:38 UTC (rev 20532)
@@ -4,6 +4,8 @@
 import java.io.InputStream;
 import java.io.OutputStream;

+import com.db4o.ObjectContainer;
+
 import freenet.support.SimpleFieldSet;
 import freenet.support.api.Bucket;
 import freenet.support.api.BucketFactory;
@@ -54,4 +56,10 @@
                return data;
        }

+       public void removeFrom(ObjectContainer container) {
+               data.free();
+               data.removeFrom(container);
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/DiskDirPutFile.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/DiskDirPutFile.java      
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/DiskDirPutFile.java      
2008-06-20 17:35:38 UTC (rev 20532)
@@ -5,6 +5,8 @@

 import java.io.File;

+import com.db4o.ObjectContainer;
+
 import freenet.client.DefaultMIMETypes;
 import freenet.support.SimpleFieldSet;
 import freenet.support.api.Bucket;
@@ -39,4 +41,9 @@
                return file;
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(file);
+               container.delete(this);
+       }
+
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/EndListPeerNotesMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/EndListPeerNotesMessage.java     
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/EndListPeerNotesMessage.java     
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -34,4 +36,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "EndListPeerNotes 
goes from server to client not the other way around", null, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/EndListPeersMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/EndListPeersMessage.java 
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/EndListPeersMessage.java 
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -31,4 +33,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "EndListPeers 
goes from server to client not the other way around", null, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/EndListPersistentRequestsMessage.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/node/fcp/EndListPersistentRequestsMessage.java
    2008-06-20 16:38:50 UTC (rev 20531)
+++ 
branches/db4o/freenet/src/freenet/node/fcp/EndListPersistentRequestsMessage.java
    2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -23,4 +25,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"EndListPersistentRequests goes from server to client not the other way 
around", null, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPMessage.java  2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPMessage.java  2008-06-20 
17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
 import java.io.IOException;
 import java.io.OutputStream;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.Logger;
 import freenet.support.SimpleFieldSet;
@@ -108,4 +110,7 @@
         * @throws MessageInvalidException */
        public abstract void run(FCPConnectionHandler handler, Node node) 
throws MessageInvalidException;

+       /** Remove this message and its dependancies (internal objects) from 
the database. */
+       public abstract void removeFrom(ObjectContainer container);
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPPluginMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPPluginMessage.java    
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPPluginMessage.java    
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.pluginmanager.PluginNotFoundException;
 import freenet.pluginmanager.PluginTalker;
@@ -105,4 +107,8 @@

        }

+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/FCPPluginReply.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FCPPluginReply.java      
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/FCPPluginReply.java      
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
 import freenet.support.api.Bucket;
@@ -72,4 +74,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, NAME + " goes 
from server to client not the other way around", null, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
+
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/FinishedCompressionMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/FinishedCompressionMessage.java  
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/FinishedCompressionMessage.java  
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.client.events.FinishedCompressionEvent;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -41,4 +43,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"FinishedCompression goes from server to client not the other way around", 
identifier, global);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/GenerateSSKMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/GenerateSSKMessage.java  
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/GenerateSSKMessage.java  
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.FreenetURI;
 import freenet.keys.InsertableClientSSK;
 import freenet.node.Node;
@@ -37,4 +39,8 @@
        handler.outputHandler.queue(msg);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/GetConfig.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/GetConfig.java   2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/GetConfig.java   2008-06-20 
17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.Fields;
 import freenet.support.SimpleFieldSet;
@@ -48,5 +50,9 @@
                }
                handler.outputHandler.queue(new ConfigData(node, withCurrent, 
withDefaults, withSortOrder, withExpertFlag, withForceWriteFlag, 
withShortDescription, withLongDescription, withDataTypes, identifier));
        }
+
+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }

 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/GetNode.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/GetNode.java     2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/GetNode.java     2008-06-20 
17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.Fields;
 import freenet.support.SimpleFieldSet;
@@ -41,5 +43,9 @@
                }
                handler.outputHandler.queue(new NodeData(node, giveOpennetRef, 
withPrivate, withVolatile, identifier));
        }
+
+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }

 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/GetPluginInfo.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/GetPluginInfo.java       
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/GetPluginInfo.java       
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.pluginmanager.PluginInfoWrapper;
 import freenet.support.Fields;
@@ -49,5 +51,9 @@
                        handler.outputHandler.queue(new PluginInfoMessage(pi, 
identifier, detailed));
                }
        }
+
+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }

 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/GetRequestStatusMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/GetRequestStatusMessage.java     
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/GetRequestStatusMessage.java     
2008-06-20 17:35:38 UTC (rev 20532)
@@ -57,4 +57,8 @@
                }
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/IdentifierCollisionMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/IdentifierCollisionMessage.java  
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/IdentifierCollisionMessage.java  
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -32,4 +34,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"IdentifierCollision goes from server to client not the other way around", 
identifier, global);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ListPeerMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ListPeerMessage.java     
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ListPeerMessage.java     
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.node.PeerNode;
 import freenet.support.SimpleFieldSet;
@@ -45,4 +47,8 @@
                handler.outputHandler.queue(new PeerMessage(pn, true, true, 
identifier));
        }

+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ListPeerNotesMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ListPeerNotesMessage.java        
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ListPeerNotesMessage.java        
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.DarknetPeerNode;
 import freenet.node.Node;
 import freenet.node.PeerNode;
@@ -52,5 +54,9 @@
                handler.outputHandler.queue(new PeerNote(nodeIdentifier, 
noteText, Node.PEER_NOTE_TYPE_PRIVATE_DARKNET_COMMENT, identifier));
                handler.outputHandler.queue(new 
EndListPeerNotesMessage(nodeIdentifier, identifier));
        }
+
+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }

 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ListPeersMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ListPeersMessage.java    
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ListPeersMessage.java    
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.node.PeerNode;
 import freenet.support.Fields;
@@ -43,5 +45,9 @@

                handler.outputHandler.queue(new 
EndListPeersMessage(identifier));
        }
+
+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }

 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/ListPersistentRequestsMessage.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/node/fcp/ListPersistentRequestsMessage.java   
    2008-06-20 16:38:50 UTC (rev 20531)
+++ 
branches/db4o/freenet/src/freenet/node/fcp/ListPersistentRequestsMessage.java   
    2008-06-20 17:35:38 UTC (rev 20532)
@@ -56,5 +56,9 @@

                }, NativeThread.NORM_PRIORITY, false);
        }
+
+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }

 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ModifyConfig.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ModifyConfig.java        
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ModifyConfig.java        
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.config.Config;
 import freenet.config.Option;
 import freenet.config.SubConfig;
@@ -66,4 +68,8 @@
                node.clientCore.storeConfig();
                handler.outputHandler.queue(new ConfigData(node, true, false, 
false, false, false, false, false, false, identifier));
        }
+
+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ModifyPeer.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ModifyPeer.java  2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ModifyPeer.java  2008-06-20 
17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.DarknetPeerNode;
 import freenet.node.Node;
 import freenet.node.PeerNode;
@@ -85,4 +87,8 @@
                handler.outputHandler.queue(new PeerMessage(pn, true, true, 
identifier));
        }

+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/ModifyPeerNote.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ModifyPeerNote.java      
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ModifyPeerNote.java      
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.DarknetPeerNode;
 import freenet.node.FSParseException;
 import freenet.node.Node;
@@ -79,4 +81,8 @@
                handler.outputHandler.queue(new PeerNote(nodeIdentifier, 
noteText, peerNoteType, identifier));
        }

+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
+
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/ModifyPersistentRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ModifyPersistentRequest.java     
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ModifyPersistentRequest.java     
2008-06-20 17:35:38 UTC (rev 20532)
@@ -94,4 +94,8 @@
                }
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/NodeData.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/NodeData.java    2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/NodeData.java    2008-06-20 
17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -58,4 +60,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "NodeData goes 
from server to client not the other way around", identifier, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/NodeHelloMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/NodeHelloMessage.java    
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/NodeHelloMessage.java    
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.l10n.L10n;
 import freenet.node.Node;
 import freenet.node.NodeStarter;
@@ -55,4 +57,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "NodeHello goes 
from server to client not the other way around", null, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/PeerMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/PeerMessage.java 2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/PeerMessage.java 2008-06-20 
17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.node.PeerNode;
 import freenet.support.SimpleFieldSet;
@@ -50,4 +52,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "Peer goes from 
server to client not the other way around", null, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/PeerNote.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/PeerNote.java    2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/PeerNote.java    2008-06-20 
17:35:38 UTC (rev 20532)
@@ -5,6 +5,8 @@

 import java.io.UnsupportedEncodingException;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.Base64;
 import freenet.support.SimpleFieldSet;
@@ -47,4 +49,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PeerNote goes 
from server to client not the other way around", identifier, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/PeerRemoved.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/PeerRemoved.java 2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/PeerRemoved.java 2008-06-20 
17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -37,4 +39,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PeerRemoved goes 
from server to client not the other way around", identifier, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/PersistentGet.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/PersistentGet.java       
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/PersistentGet.java       
2008-06-20 17:35:38 UTC (rev 20532)
@@ -5,6 +5,8 @@

 import java.io.File;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.FreenetURI;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -83,4 +85,11 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PersistentGet 
goes from server to client not the other way around", identifier, global);
        }

+       public void removeFrom(ObjectContainer container) {
+               uri.removeFrom(container);
+               container.delete(targetFile);
+               container.delete(tempFile);
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/PersistentPut.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/PersistentPut.java       
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/PersistentPut.java       
2008-06-20 17:35:38 UTC (rev 20532)
@@ -5,6 +5,8 @@

 import java.io.File;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.FreenetURI;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -90,4 +92,11 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PersistentPut 
goes from server to client not the other way around", identifier, global);
        }

+       public void removeFrom(ObjectContainer container) {
+               uri.removeFrom(container);
+               container.delete(origFilename);
+               targetURI.removeFrom(container);
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/PersistentPutDir.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/PersistentPutDir.java    
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/PersistentPutDir.java    
2008-06-20 17:35:38 UTC (rev 20532)
@@ -4,7 +4,10 @@
 package freenet.node.fcp;

 import java.util.HashMap;
+import java.util.Iterator;

+import com.db4o.ObjectContainer;
+
 import freenet.client.async.ManifestElement;
 import freenet.client.async.SimpleManifestPutter;
 import freenet.keys.FreenetURI;
@@ -115,6 +118,22 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PersistentPut 
goes from server to client not the other way around", identifier, global);
        }

+       public void removeFrom(ObjectContainer container) {
+               uri.removeFrom(container);
+               removeFrom(manifestElements, container);
+               container.delete(this);
+       }

+       private void removeFrom(HashMap manifestElements, ObjectContainer 
container) {
+               for(Iterator 
i=manifestElements.values().iterator();i.hasNext();) {
+                       Object o = i.next();
+                       if(o instanceof HashMap)
+                               removeFrom((HashMap)o, container);
+                       else
+                               ((ManifestElement) o).removeFrom(container);
+               }
+               manifestElements.clear();
+               container.delete(manifestElements);
+       }

 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/PersistentRequestModifiedMessage.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/node/fcp/PersistentRequestModifiedMessage.java
    2008-06-20 16:38:50 UTC (rev 20531)
+++ 
branches/db4o/freenet/src/freenet/node/fcp/PersistentRequestModifiedMessage.java
    2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.*;
 import freenet.support.*;

@@ -48,4 +50,8 @@
     public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
         throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"PersistentRequestModified goes from server to client not the other way 
around", ident, global);
     }
+
+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/PersistentRequestRemovedMessage.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/node/fcp/PersistentRequestRemovedMessage.java 
    2008-06-20 16:38:50 UTC (rev 20531)
+++ 
branches/db4o/freenet/src/freenet/node/fcp/PersistentRequestRemovedMessage.java 
    2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.*;
 import freenet.support.*;

@@ -33,4 +35,8 @@
     public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
         throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"PersistentRequestRemoved goes from server to client not the other way around", 
ident, global);
     }
+
+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/PluginInfoMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/PluginInfoMessage.java   
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/PluginInfoMessage.java   
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.pluginmanager.PluginInfoWrapper;
 import freenet.support.SimpleFieldSet;
@@ -54,4 +56,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, NAME + " goes 
from server to client not the other way around", null, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/PutFetchableMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/PutFetchableMessage.java 
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/PutFetchableMessage.java 
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.FreenetURI;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -37,4 +39,9 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "PutFetchable 
goes from server to client not the other way around", identifier, global);
        }

+       public void removeFrom(ObjectContainer container) {
+               uri.removeFrom(container);
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/PutSuccessfulMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/PutSuccessfulMessage.java        
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/PutSuccessfulMessage.java        
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.FreenetURI;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -43,4 +45,9 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "InsertSuccessful 
goes from server to client not the other way around", identifier, global);
        }

+       public void removeFrom(ObjectContainer container) {
+               uri.removeFrom(container);
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/RedirectDirPutFile.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/RedirectDirPutFile.java  
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/RedirectDirPutFile.java  
2008-06-20 17:35:38 UTC (rev 20532)
@@ -2,6 +2,8 @@

 import java.net.MalformedURLException;

+import com.db4o.ObjectContainer;
+
 import freenet.client.ClientMetadata;
 import freenet.client.async.ManifestElement;
 import freenet.keys.FreenetURI;
@@ -35,4 +37,9 @@
        public ManifestElement getElement() {
                return new ManifestElement(name, targetURI, getMIMEType());
        }
+
+       public void removeFrom(ObjectContainer container) {
+               targetURI.removeFrom(container);
+               container.delete(this);
+       }
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/RemovePeer.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/RemovePeer.java  2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/RemovePeer.java  2008-06-20 
17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.node.PeerNode;
 import freenet.support.SimpleFieldSet;
@@ -47,4 +49,8 @@
                handler.outputHandler.queue(new PeerRemoved(identity, 
nodeIdentifier, identifier));
        }

+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
+
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/RemovePersistentRequest.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/RemovePersistentRequest.java     
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/RemovePersistentRequest.java     
2008-06-20 17:35:38 UTC (rev 20532)
@@ -64,4 +64,8 @@
                }
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/SSKKeypairMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/SSKKeypairMessage.java   
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/SSKKeypairMessage.java   
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.FreenetURI;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -35,6 +37,12 @@
        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "SSKKeypair goes 
from server to client not the other way around", identifier, false);
        }
+
+       public void removeFrom(ObjectContainer container) {
+               insertURI.removeFrom(container);
+               requestURI.removeFrom(container);
+               container.delete(this);
+       }




Modified: branches/db4o/freenet/src/freenet/node/fcp/ShutdownMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/ShutdownMessage.java     
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/ShutdownMessage.java     
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.node.fcp.FCPMessage;
 import freenet.support.SimpleFieldSet;
@@ -29,5 +31,9 @@
                FCPMessage msg = new 
ProtocolErrorMessage(ProtocolErrorMessage.SHUTTING_DOWN,true,"The node is 
shutting down","Node",false);
                handler.outputHandler.queue(msg);
                node.exit("Received FCP shutdown message");
+       }
+
+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
        }       
 }
\ No newline at end of file

Modified: branches/db4o/freenet/src/freenet/node/fcp/SimpleProgressMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/SimpleProgressMessage.java       
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/SimpleProgressMessage.java       
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.client.events.SplitfileProgressEvent;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -68,4 +70,9 @@
                return event.finalizedTotal;
        }

+       public void removeFrom(ObjectContainer container) {
+               event.removeFrom(container);
+               container.delete(this);
+       }
+
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/StartedCompressionMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/StartedCompressionMessage.java   
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/StartedCompressionMessage.java   
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -36,4 +38,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"StartedCompression goes from server to client not the other way around", 
identifier, global);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/SubscribeUSKMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/SubscribeUSKMessage.java 
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/SubscribeUSKMessage.java 
2008-06-20 17:35:38 UTC (rev 20532)
@@ -5,6 +5,8 @@

 import java.net.MalformedURLException;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.FreenetURI;
 import freenet.keys.USK;
 import freenet.node.Node;
@@ -62,4 +64,8 @@
                new SubscribeUSK(this, node.clientCore, handler);
        }

+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/SubscribedUSKUpdate.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/SubscribedUSKUpdate.java 
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/SubscribedUSKUpdate.java 
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.USK;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -38,4 +40,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"SubscribedUSKUpdate goes from server to client not the other way around", 
identifier, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/TestDDACompleteMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/TestDDACompleteMessage.java      
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/TestDDACompleteMessage.java      
2008-06-20 17:35:38 UTC (rev 20532)
@@ -6,6 +6,8 @@
 import java.io.File;
 import java.io.IOException;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.node.fcp.FCPConnectionHandler.DDACheckJob;
 import freenet.support.Logger;
@@ -76,4 +78,8 @@
        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, name + " goes 
from server to client not the other way around", name, false);
        }
+
+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/TestDDAReplyMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/TestDDAReplyMessage.java 
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/TestDDAReplyMessage.java 
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.node.fcp.FCPConnectionHandler.DDACheckJob;
 import freenet.support.SimpleFieldSet;
@@ -51,4 +53,8 @@
        public void run(FCPConnectionHandler handler, Node node) throws 
MessageInvalidException {
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, name + " goes 
from server to client not the other way around", name, false);
        }
+
+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/TestDDARequestMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/TestDDARequestMessage.java       
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/TestDDARequestMessage.java       
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.node.fcp.FCPConnectionHandler.DDACheckJob;
 import freenet.support.SimpleFieldSet;
@@ -59,4 +61,8 @@
                TestDDAReplyMessage reply = new TestDDAReplyMessage(job);
                handler.outputHandler.queue(reply);
        }
+
+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/TestDDAResponseMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/TestDDAResponseMessage.java      
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/TestDDAResponseMessage.java      
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.node.fcp.FCPConnectionHandler.DDACheckJob;
 import freenet.support.SimpleFieldSet;
@@ -56,4 +58,8 @@
                TestDDACompleteMessage reply = new 
TestDDACompleteMessage(handler, job, readContent);
                handler.outputHandler.queue(reply);
        }
+
+       public void removeFrom(ObjectContainer container) {
+               throw new UnsupportedOperationException();
+       }
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/URIGeneratedMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/URIGeneratedMessage.java 
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/URIGeneratedMessage.java 
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.keys.FreenetURI;
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;
@@ -33,4 +35,9 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, "URIGenerated 
goes from server to client not the other way around", identifier, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               uri.removeFrom(container);
+               container.delete(this);
+       }
+
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/UnknownNodeIdentifierMessage.java
===================================================================
--- 
branches/db4o/freenet/src/freenet/node/fcp/UnknownNodeIdentifierMessage.java    
    2008-06-20 16:38:50 UTC (rev 20531)
+++ 
branches/db4o/freenet/src/freenet/node/fcp/UnknownNodeIdentifierMessage.java    
    2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -33,4 +35,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"UnknownNodeIdentifier goes from server to client not the other way around", 
nodeIdentifier, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: 
branches/db4o/freenet/src/freenet/node/fcp/UnknownPeerNoteTypeMessage.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/UnknownPeerNoteTypeMessage.java  
2008-06-20 16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/UnknownPeerNoteTypeMessage.java  
2008-06-20 17:35:38 UTC (rev 20532)
@@ -3,6 +3,8 @@
  * http://www.gnu.org/ for further details of the GPL. */
 package freenet.node.fcp;

+import com.db4o.ObjectContainer;
+
 import freenet.node.Node;
 import freenet.support.SimpleFieldSet;

@@ -33,4 +35,8 @@
                throw new 
MessageInvalidException(ProtocolErrorMessage.INVALID_MESSAGE, 
"UnknownPeerNoteType goes from server to client not the other way around", 
identifier, false);
        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }

Modified: branches/db4o/freenet/src/freenet/node/fcp/WatchGlobal.java
===================================================================
--- branches/db4o/freenet/src/freenet/node/fcp/WatchGlobal.java 2008-06-20 
16:38:50 UTC (rev 20531)
+++ branches/db4o/freenet/src/freenet/node/fcp/WatchGlobal.java 2008-06-20 
17:35:38 UTC (rev 20532)
@@ -55,4 +55,8 @@

        }

+       public void removeFrom(ObjectContainer container) {
+               container.delete(this);
+       }
+
 }


Reply via email to