public class ClientGet extends ClientRequest implements ClientGetCallback, ClientEventListener, PersistentClientCallback
Modifier and Type | Class and Description |
---|---|
static class |
ClientGet.ReturnType |
ClientRequest.Persistence
client, 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, restartAsync
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getRequestClient, onResume
public 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
IdentifierCollisionException
NotAllowedException
java.io.IOException
public ClientGet(FCPConnectionHandler handler, ClientGetMessage message, NodeClientCore core) throws IdentifierCollisionException, MessageInvalidException
protected ClientGet()
public void start(ClientContext context)
ClientRequest
start
in class ClientRequest
public void onLostConnection(ClientContext context)
ClientRequest
onLostConnection
in class ClientRequest
public void onSuccess(FetchResult result, ClientGetter state)
ClientGetCallback
onSuccess
in interface ClientGetCallback
public void setSuccessForMigration(ClientContext context, long completionTime, Bucket data) throws ResumeFailedException
ResumeFailedException
public void sendPendingMessages(FCPConnectionOutputHandler handler, java.lang.String listRequestIdentifier, boolean includeData, boolean onlyData)
ClientRequest
sendPendingMessages
in class ClientRequest
public void onFailure(FetchException e, ClientGetter state)
ClientGetCallback
onFailure
in interface ClientGetCallback
public void requestWasRemoved(ClientContext context)
ClientRequest
requestWasRemoved
in class ClientRequest
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.protected ClientRequester getClientRequest()
getClientRequest
in class ClientRequest
protected void freeData()
ClientRequest
freeData
in class ClientRequest
public boolean hasSucceeded()
hasSucceeded
in class ClientRequest
public 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 ClientRequest
public double getTotalBlocks()
getTotalBlocks
in class ClientRequest
public double getMinBlocks()
getMinBlocks
in class ClientRequest
public double getFailedBlocks()
getFailedBlocks
in class ClientRequest
public double getFatalyFailedBlocks()
getFatalyFailedBlocks
in class ClientRequest
public double getFetchedBlocks()
getFetchedBlocks
in class ClientRequest
public InsertContext.CompatibilityMode[] getCompatibilityMode()
public boolean getDontCompress()
public byte[] getOverriddenSplitfileCryptoKey()
public java.lang.String getFailureReason(boolean longDescription)
getFailureReason
in class ClientRequest
public FetchException.FetchExceptionMode getFailureReasonCode()
public boolean isTotalFinalized()
ClientRequest
isTotalFinalized
in class ClientRequest
public Bucket getBucket()
Bucket
that contains the downloaded data.Bucket
, or null
if this
isn’t applicablepublic boolean canRestart()
canRestart
in class ClientRequest
public boolean restart(ClientContext context, boolean disableFilterData)
restart
in class ClientRequest
public boolean hasPermRedirect()
public boolean filterData()
public void getClientDetail(java.io.DataOutputStream dos, ChecksumChecker checker) throws java.io.IOException
PersistentClientCallback
getClientDetail
in interface PersistentClientCallback
getClientDetail
in class ClientRequest
java.io.IOException
public static ClientRequest restartFrom(java.io.DataInputStream dis, RequestIdentifier reqID, ClientContext context, ChecksumChecker checker) throws StorageFormatException, java.io.IOException, ResumeFailedException
StorageFormatException
java.io.IOException
ResumeFailedException
protected void innerResume(ClientContext context) throws ResumeFailedException
innerResume
in class ClientRequest
ResumeFailedException
public boolean fullyResumed()
ClientRequest
fullyResumed
in class ClientRequest