r27022 - in trunk/freenet/src/freenet: client/async node

[email protected] Sat, 18 Apr 2009 20:17:47 +0000
Newsgroups gmane.network.freenet.cvs
Message-ID <[email protected]>
Author: toad
Date: 2009-04-18 20:17:47 +0000 (Sat, 18 Apr 2009)
New Revision: 27022

Modified:
   trunk/freenet/src/freenet/client/async/BaseSingleFileFetcher.java
   trunk/freenet/src/freenet/client/async/OfferedKeysList.java
   trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
   trunk/freenet/src/freenet/node/BaseSendableGet.java
Log:
Add preRegister() hook


Modified: trunk/freenet/src/freenet/client/async/BaseSingleFileFetcher.java
===================================================================
--- trunk/freenet/src/freenet/client/async/BaseSingleFileFetcher.java	2009-04-18 20:10:36 UTC (rev 27021)
+++ trunk/freenet/src/freenet/client/async/BaseSingleFileFetcher.java	2009-04-18 20:17:47 UTC (rev 27022)
@@ -352,4 +352,9 @@
 		key.removeFrom(container);
 	}
 	
+	@Override
+	public void preRegister(ObjectContainer container, ClientContext context) {
+		// Ignore
+	}
+
 }

Modified: trunk/freenet/src/freenet/client/async/OfferedKeysList.java
===================================================================
--- trunk/freenet/src/freenet/client/async/OfferedKeysList.java	2009-04-18 20:10:36 UTC (rev 27021)
+++ trunk/freenet/src/freenet/client/async/OfferedKeysList.java	2009-04-18 20:17:47 UTC (rev 27022)
@@ -245,4 +245,9 @@
 		throw new UnsupportedOperationException();
 	}
 
+	@Override
+	public void preRegister(ObjectContainer container, ClientContext context) {
+		// Ignore
+	}
+
 }

Modified: trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java
===================================================================
--- trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java	2009-04-18 20:10:36 UTC (rev 27021)
+++ trunk/freenet/src/freenet/client/async/SplitFileFetcherSubSegment.java	2009-04-18 20:17:47 UTC (rev 27022)
@@ -863,4 +863,10 @@
 			throw new NullPointerException("Storing "+this+" but blockNums == null!");
 		return true;
 	}
+	
+	@Override
+	public void preRegister(ObjectContainer container, ClientContext context) {
+		// Ignore
+	}
+
 }

Modified: trunk/freenet/src/freenet/node/BaseSendableGet.java
===================================================================
--- trunk/freenet/src/freenet/node/BaseSendableGet.java	2009-04-18 20:10:36 UTC (rev 27021)
+++ trunk/freenet/src/freenet/node/BaseSendableGet.java	2009-04-18 20:17:47 UTC (rev 27022)
@@ -16,4 +16,7 @@
 	
 	public abstract boolean hasValidKeys(KeysFetchingLocally fetching, ObjectContainer container, ClientContext context);
 
+	/** Called after checking the datastore and before registering the request to be 
+	 * sent. Some gets may want to cancel here, some may want to send an event to FCP. */
+	public abstract void preRegister(ObjectContainer container, ClientContext context);
 }