public class FProxyFetchInProgress extends java.lang.Object implements ClientEventListener, ClientGetCallback
Modifier and Type | Class and Description |
---|---|
static class |
FProxyFetchInProgress.REFILTER_POLICY
What to do when we find data which matches the request but it has already been
filtered, assuming we want a filtered copy.
|
Modifier and Type | Field and Description |
---|---|
long |
maxSize
The maximum size specified by the client
|
FreenetURI |
uri
The key we are fetching
|
Constructor and Description |
---|
FProxyFetchInProgress(FProxyFetchTracker tracker,
FreenetURI key,
long maxSize2,
long identifier,
ClientContext context,
FetchContext fctx,
RequestClient rc,
FProxyFetchInProgress.REFILTER_POLICY refilter) |
Modifier and Type | Method and Description |
---|---|
void |
addCustomWaiter(FProxyFetchWaiter waiter) |
void |
addListener(FProxyFetchListener listener)
Adds a listener that will be notified when a change occurs to this fetch
|
boolean |
canCancel()
Caller should take the lock on FProxyToadlet.fetchers, then call this
function, if it returns true then finish the cancel outside the lock.
|
void |
close(FProxyFetchResult result) |
void |
close(FProxyFetchWaiter waiter) |
boolean |
fetchContextEquivalent(FetchContext context) |
void |
finishCancel()
Finish the cancel process, freeing the data if necessary.
|
boolean |
finished() |
long |
getETA() |
RequestClient |
getRequestClient()
Get the RequestClient context object used to indicate which requests are related to each
other for scheduling purposes.
|
FProxyFetchTracker |
getTracker() |
FProxyFetchWaiter |
getWaiter() |
boolean |
hasData() |
boolean |
hasNotifiedFailure() |
boolean |
hasWaited() |
long |
lastTouched() |
boolean |
notFinishedOrFatallyFinished() |
void |
onFailure(FetchException e,
ClientGetter state)
Called on failed/canceled fetch.
|
void |
onResume(ClientContext context)
Called for a persistent request when the node is restarted.
|
void |
onSuccess(FetchResult result,
ClientGetter state)
Called on successful fetch.
|
void |
receive(ClientEvent ce,
ClientContext context)
Hears an event.
|
void |
removeListener(FProxyFetchListener listener)
Removes a listener
|
void |
requestImmediateCancel()
Allows the fetch to be removed immediately
|
void |
setHasWaited() |
void |
start(ClientContext context) |
public final FreenetURI uri
public final long maxSize
public FProxyFetchInProgress(FProxyFetchTracker tracker, FreenetURI key, long maxSize2, long identifier, ClientContext context, FetchContext fctx, RequestClient rc, FProxyFetchInProgress.REFILTER_POLICY refilter)
public FProxyFetchWaiter getWaiter()
public FProxyFetchTracker getTracker()
public void addCustomWaiter(FProxyFetchWaiter waiter)
public void start(ClientContext context) throws FetchException
FetchException
public void receive(ClientEvent ce, ClientContext context)
ClientEventListener
receive
in interface ClientEventListener
ce
- ClientEventcontext
- The database context the event was generated in.
NOTE THAT IT MAY NOT HAVE BEEN GENERATED IN A DATABASE CONTEXT AT ALL:
In this case, container will be null, and you should use context to schedule a DBJob.public void onFailure(FetchException e, ClientGetter state)
ClientGetCallback
onFailure
in interface ClientGetCallback
public void onSuccess(FetchResult result, ClientGetter state)
ClientGetCallback
onSuccess
in interface ClientGetCallback
public boolean hasData()
public boolean finished()
public void close(FProxyFetchWaiter waiter)
public boolean canCancel()
public void finishCancel()
public void close(FProxyFetchResult result)
public long getETA()
public boolean notFinishedOrFatallyFinished()
public boolean hasNotifiedFailure()
public boolean hasWaited()
public void setHasWaited()
public void addListener(FProxyFetchListener listener)
listener
- - The listener to be addedpublic void removeListener(FProxyFetchListener listener)
listener
- - The listener to be removedpublic void requestImmediateCancel()
public long lastTouched()
public boolean fetchContextEquivalent(FetchContext context)
public void onResume(ClientContext context)
ClientBaseCallback
onResume
in interface ClientBaseCallback
public RequestClient getRequestClient()
ClientBaseCallback
getRequestClient
in interface ClientBaseCallback