public class ClientGet extends ClientRequest implements ClientGetCallback, ClientEventListener, PersistentClientCallback
| Modifier and Type | Class and Description |
|---|---|
static class |
ClientGet.ReturnType |
ClientRequest.Persistenceclient, clientName, clientToken, completionTime, finished, global, identifier, lowLevelClient, origHandler, persistence, priorityClass, realTime, started, startupTime, uri, verbosity| Modifier | Constructor and Description |
|---|---|
protected |
ClientGet() |
|
ClientGet(FCPConnectionHandler handler,
ClientGetMessage message,
NodeClientCore core) |
|
ClientGet(PersistentRequestClient globalClient,
FreenetURI uri,
boolean dsOnly,
boolean ignoreDS,
boolean filterData,
int maxSplitfileRetries,
int maxNonSplitfileRetries,
long maxOutputLength,
ClientGet.ReturnType returnType,
boolean persistRebootOnly,
java.lang.String identifier,
int verbosity,
short prioClass,
java.io.File returnFilename,
java.lang.String charset,
boolean writeToClientCache,
boolean realTimeFlag,
boolean binaryBlob,
NodeClientCore core)
Create one for a global-queued request not made by FCP.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRestart() |
boolean |
filterData() |
protected void |
freeData()
Free cached data bucket(s)
|
boolean |
fullyResumed()
Return true if we resumed the original fetch from stored data (usually a file for a
splitfile download), rather than having to restart it (which happens in most other cases
when we resume).
|
Bucket |
getBucket()
Returns the
Bucket that contains the downloaded data. |
void |
getClientDetail(java.io.DataOutputStream dos,
ChecksumChecker checker)
Called to get a high level representation of the request.
|
protected ClientRequester |
getClientRequest() |
InsertContext.CompatibilityMode[] |
getCompatibilityMode() |
long |
getDataSize() |
java.io.File |
getDestFilename() |
boolean |
getDontCompress() |
double |
getFailedBlocks() |
java.lang.String |
getFailureReason(boolean longDescription) |
FetchException.FetchExceptionMode |
getFailureReasonCode() |
double |
getFatalyFailedBlocks() |
double |
getFetchedBlocks() |
java.lang.String |
getMIMEType() |
double |
getMinBlocks() |
byte[] |
getOverriddenSplitfileCryptoKey() |
double |
getSuccessFraction() |
double |
getTotalBlocks() |
FreenetURI |
getURI() |
boolean |
hasPermRedirect() |
boolean |
hasSucceeded() |
protected void |
innerResume(ClientContext context) |
boolean |
isDirect() |
boolean |
isToDisk() |
boolean |
isTotalFinalized()
Has the total number of blocks to insert been determined yet?
|
void |
onFailure(FetchException e,
ClientGetter state)
Called on failed/canceled fetch.
|
void |
onLostConnection(ClientContext context)
Lost connection
|
void |
onSuccess(FetchResult result,
ClientGetter state)
Called on successful fetch.
|
void |
receive(ClientEvent ce,
ClientContext context)
Hears an event.
|
void |
requestWasRemoved(ClientContext context)
Called after a RemovePersistentRequest.
|
boolean |
restart(ClientContext context,
boolean disableFilterData) |
static ClientRequest |
restartFrom(java.io.DataInputStream dis,
RequestIdentifier reqID,
ClientContext context,
ChecksumChecker checker) |
void |
sendPendingMessages(FCPConnectionOutputHandler handler,
java.lang.String listRequestIdentifier,
boolean includeData,
boolean onlyData)
Send any pending messages for a persistent request e.g.
|
void |
setSuccessForMigration(ClientContext context,
long completionTime,
Bucket data) |
void |
start(ClientContext context)
Start the request, if it has not already been started.
|
cancel, dropped, finish, getClient, getIdentifier, getLastActivity, getPriority, getRequestClient, getRequestIdentifier, hasFinished, hashCode, isGlobalQueue, isPersistent, isPersistentForever, isStarted, modifyRequest, onResume, onShutdown, restartAsyncclone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetRequestClient, onResumepublic ClientGet(PersistentRequestClient globalClient, FreenetURI uri, boolean dsOnly, boolean ignoreDS, boolean filterData, int maxSplitfileRetries, int maxNonSplitfileRetries, long maxOutputLength, ClientGet.ReturnType returnType, boolean persistRebootOnly, java.lang.String identifier, int verbosity, short prioClass, java.io.File returnFilename, java.lang.String charset, boolean writeToClientCache, boolean realTimeFlag, boolean binaryBlob, NodeClientCore core) throws IdentifierCollisionException, NotAllowedException, java.io.IOException
IdentifierCollisionExceptionNotAllowedExceptionjava.io.IOExceptionpublic ClientGet(FCPConnectionHandler handler, ClientGetMessage message, NodeClientCore core) throws IdentifierCollisionException, MessageInvalidException
protected ClientGet()
public void start(ClientContext context)
ClientRequeststart in class ClientRequestpublic void onLostConnection(ClientContext context)
ClientRequestonLostConnection in class ClientRequestpublic void onSuccess(FetchResult result, ClientGetter state)
ClientGetCallbackonSuccess in interface ClientGetCallbackpublic void setSuccessForMigration(ClientContext context, long completionTime, Bucket data) throws ResumeFailedException
ResumeFailedExceptionpublic void sendPendingMessages(FCPConnectionOutputHandler handler, java.lang.String listRequestIdentifier, boolean includeData, boolean onlyData)
ClientRequestsendPendingMessages in class ClientRequestpublic void onFailure(FetchException e, ClientGetter state)
ClientGetCallbackonFailure in interface ClientGetCallbackpublic void requestWasRemoved(ClientContext context)
ClientRequestrequestWasRemoved in class ClientRequestpublic void receive(ClientEvent ce, ClientContext context)
ClientEventListenerreceive in interface ClientEventListenerce - 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.protected ClientRequester getClientRequest()
getClientRequest in class ClientRequestprotected void freeData()
ClientRequestfreeData in class ClientRequestpublic boolean hasSucceeded()
hasSucceeded in class ClientRequestpublic boolean isDirect()
public boolean isToDisk()
public FreenetURI getURI()
public long getDataSize()
public java.lang.String getMIMEType()
public java.io.File getDestFilename()
public double getSuccessFraction()
getSuccessFraction in class ClientRequestpublic double getTotalBlocks()
getTotalBlocks in class ClientRequestpublic double getMinBlocks()
getMinBlocks in class ClientRequestpublic double getFailedBlocks()
getFailedBlocks in class ClientRequestpublic double getFatalyFailedBlocks()
getFatalyFailedBlocks in class ClientRequestpublic double getFetchedBlocks()
getFetchedBlocks in class ClientRequestpublic InsertContext.CompatibilityMode[] getCompatibilityMode()
public boolean getDontCompress()
public byte[] getOverriddenSplitfileCryptoKey()
public java.lang.String getFailureReason(boolean longDescription)
getFailureReason in class ClientRequestpublic FetchException.FetchExceptionMode getFailureReasonCode()
public boolean isTotalFinalized()
ClientRequestisTotalFinalized in class ClientRequestpublic Bucket getBucket()
Bucket that contains the downloaded data.Bucket, or null if this
isn’t applicablepublic boolean canRestart()
canRestart in class ClientRequestpublic boolean restart(ClientContext context, boolean disableFilterData)
restart in class ClientRequestpublic boolean hasPermRedirect()
public boolean filterData()
public void getClientDetail(java.io.DataOutputStream dos,
ChecksumChecker checker)
throws java.io.IOException
PersistentClientCallbackgetClientDetail in interface PersistentClientCallbackgetClientDetail in class ClientRequestjava.io.IOExceptionpublic static ClientRequest restartFrom(java.io.DataInputStream dis, RequestIdentifier reqID, ClientContext context, ChecksumChecker checker) throws StorageFormatException, java.io.IOException, ResumeFailedException
StorageFormatExceptionjava.io.IOExceptionResumeFailedExceptionprotected void innerResume(ClientContext context) throws ResumeFailedException
innerResume in class ClientRequestResumeFailedExceptionpublic boolean fullyResumed()
ClientRequestfullyResumed in class ClientRequest