public abstract class ClientRequest
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ClientRequest.Persistence |
Modifier and Type | Field and Description |
---|---|
protected PersistentRequestClient |
client
Client
|
protected java.lang.String |
clientName
If the request isn't on the global queue, what is the client's name?
|
protected java.lang.String |
clientToken
Client token (string to feed back to the client on a Persistent* when he does a
ListPersistentRequests).
|
protected long |
completionTime
Timestamp : completion time
|
protected boolean |
finished
Has the request finished?
|
protected boolean |
global
Is the request on the global queue?
|
protected java.lang.String |
identifier
Unique request identifier
|
protected RequestClient |
lowLevelClient |
protected FCPConnectionHandler |
origHandler
Original FCPConnectionHandler.
|
protected ClientRequest.Persistence |
persistence
Persistence type
|
protected short |
priorityClass
Priority class
|
protected boolean |
realTime
Is the request scheduled as "real-time" (as opposed to bulk)?
|
protected boolean |
started |
protected long |
startupTime
Timestamp : startup time
|
protected FreenetURI |
uri
URI to fetch, or target URI to insert to
|
protected int |
verbosity
Verbosity level.
|
Modifier | Constructor and Description |
---|---|
protected |
ClientRequest() |
protected |
ClientRequest(java.io.DataInputStream dis,
RequestIdentifier reqID,
ClientContext context) |
|
ClientRequest(FreenetURI uri2,
java.lang.String identifier2,
int verbosity2,
java.lang.String charset,
FCPConnectionHandler handler,
PersistentRequestClient client,
short priorityClass2,
ClientRequest.Persistence persistenceType2,
boolean realTime,
java.lang.String clientToken2,
boolean global) |
|
ClientRequest(FreenetURI uri2,
java.lang.String identifier2,
int verbosity2,
java.lang.String charset,
FCPConnectionHandler handler,
short priorityClass2,
ClientRequest.Persistence persistenceType2,
boolean realTime,
java.lang.String clientToken2,
boolean global) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(ClientContext context) |
abstract boolean |
canRestart() |
void |
dropped(ClientContext context)
Completed request dropped off the end without being acknowledged
|
protected void |
finish()
Request completed.
|
protected abstract void |
freeData()
Free cached data bucket(s)
|
abstract 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).
|
PersistentRequestClient |
getClient() |
void |
getClientDetail(java.io.DataOutputStream dos,
ChecksumChecker checker) |
protected abstract ClientRequester |
getClientRequest() |
abstract double |
getFailedBlocks() |
abstract java.lang.String |
getFailureReason(boolean longDescription) |
abstract double |
getFatalyFailedBlocks() |
abstract double |
getFetchedBlocks() |
java.lang.String |
getIdentifier()
Get identifier string for request
|
long |
getLastActivity()
Deprecated.
Use
ClientRequester.getLatestSuccess() instead. You can use
getClientRequest() to obtain the ClientRequester. |
abstract double |
getMinBlocks() |
short |
getPriority()
Return the priority class
|
RequestClient |
getRequestClient() |
RequestIdentifier |
getRequestIdentifier()
Get the RequestIdentifier.
|
abstract double |
getSuccessFraction() |
abstract double |
getTotalBlocks() |
boolean |
hasFinished() |
int |
hashCode() |
abstract boolean |
hasSucceeded() |
protected abstract void |
innerResume(ClientContext context) |
protected boolean |
isGlobalQueue() |
boolean |
isPersistent()
Is the request persistent? False = we can drop the request if we lose the connection
|
boolean |
isPersistentForever() |
boolean |
isStarted() |
abstract boolean |
isTotalFinalized()
Has the total number of blocks to insert been determined yet?
|
void |
modifyRequest(java.lang.String newClientToken,
short newPriorityClass,
FCPServer server)
Called after a ModifyPersistentRequest.
|
abstract void |
onLostConnection(ClientContext context)
Lost connection
|
void |
onResume(ClientContext context)
Called just after serializing in the request.
|
void |
onShutdown(ClientContext context)
Called just before the final write when the node is shutting down.
|
void |
requestWasRemoved(ClientContext context)
Called after a RemovePersistentRequest.
|
abstract boolean |
restart(ClientContext context,
boolean disableFilterData) |
void |
restartAsync(FCPServer server,
boolean disableFilterData) |
static ClientRequest |
restartFrom(java.io.DataInputStream dis,
RequestIdentifier reqID,
ClientContext context,
ChecksumChecker checker) |
abstract void |
sendPendingMessages(FCPConnectionOutputHandler handler,
java.lang.String listRequestIdentifier,
boolean includeData,
boolean onlyData)
Send any pending messages for a persistent request e.g.
|
abstract void |
start(ClientContext context)
Start the request, if it has not already been started.
|
protected FreenetURI uri
protected final java.lang.String identifier
protected final int verbosity
protected final transient FCPConnectionHandler origHandler
protected final boolean global
protected final java.lang.String clientName
protected transient PersistentRequestClient client
protected short priorityClass
protected final boolean realTime
protected final ClientRequest.Persistence persistence
protected boolean finished
protected java.lang.String clientToken
protected final long startupTime
protected long completionTime
protected transient RequestClient lowLevelClient
protected boolean started
public ClientRequest(FreenetURI uri2, java.lang.String identifier2, int verbosity2, java.lang.String charset, FCPConnectionHandler handler, PersistentRequestClient client, short priorityClass2, ClientRequest.Persistence persistenceType2, boolean realTime, java.lang.String clientToken2, boolean global)
public ClientRequest(FreenetURI uri2, java.lang.String identifier2, int verbosity2, java.lang.String charset, FCPConnectionHandler handler, short priorityClass2, ClientRequest.Persistence persistenceType2, boolean realTime, java.lang.String clientToken2, boolean global)
protected ClientRequest()
protected ClientRequest(java.io.DataInputStream dis, RequestIdentifier reqID, ClientContext context) throws java.io.IOException, StorageFormatException
java.io.IOException
StorageFormatException
public int hashCode()
hashCode
in class java.lang.Object
public abstract void onLostConnection(ClientContext context)
public abstract void sendPendingMessages(FCPConnectionOutputHandler handler, java.lang.String listRequestIdentifier, boolean includeData, boolean onlyData)
public void cancel(ClientContext context)
public boolean isPersistentForever()
public boolean isPersistent()
public boolean hasFinished()
public java.lang.String getIdentifier()
protected abstract ClientRequester getClientRequest()
public void dropped(ClientContext context)
public short getPriority()
protected abstract void freeData()
protected void finish()
public abstract double getSuccessFraction()
public abstract double getTotalBlocks()
public abstract double getMinBlocks()
public abstract double getFetchedBlocks()
public abstract double getFailedBlocks()
public abstract double getFatalyFailedBlocks()
public abstract java.lang.String getFailureReason(boolean longDescription)
public abstract boolean isTotalFinalized()
public abstract void start(ClientContext context)
public boolean isStarted()
public abstract boolean hasSucceeded()
@Deprecated public long getLastActivity()
ClientRequester.getLatestSuccess()
instead. You can use
getClientRequest()
to obtain the ClientRequester.0
if there is
no known last activity.0
public abstract boolean canRestart()
public abstract boolean restart(ClientContext context, boolean disableFilterData) throws PersistenceDisabledException
PersistenceDisabledException
public void modifyRequest(java.lang.String newClientToken, short newPriorityClass, FCPServer server)
public void restartAsync(FCPServer server, boolean disableFilterData) throws PersistenceDisabledException
PersistenceDisabledException
public void requestWasRemoved(ClientContext context)
protected boolean isGlobalQueue()
public PersistentRequestClient getClient()
public void getClientDetail(java.io.DataOutputStream dos, ChecksumChecker checker) throws java.io.IOException
java.io.IOException
public final void onResume(ClientContext context) throws ResumeFailedException
context
- Contains all the important system utilities.ResumeFailedException
protected abstract void innerResume(ClientContext context) throws ResumeFailedException
ResumeFailedException
public RequestClient getRequestClient()
public RequestIdentifier getRequestIdentifier()
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
public abstract boolean fullyResumed()
public void onShutdown(ClientContext context)