public abstract class ClientPutBase extends ClientRequest implements ClientPutCallback, ClientEventListener
| Modifier and Type | Class and Description |
|---|---|
static class |
ClientPutBase.UploadFrom |
ClientRequest.Persistence| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
FILE_HASH |
protected FreenetURI |
generatedURI
URI generated for the insert.
|
protected FCPMessage |
progressMessage |
protected FreenetURI |
publicURI |
protected PutFailedMessage |
putFailedMessage
If the request failed, how did it fail? PutFailedMessage is the most
convenient way to store this (InsertException has a stack trace!).
|
static java.lang.String |
SALT |
protected boolean |
succeeded
Has the request succeeded?
|
client, clientName, clientToken, completionTime, finished, global, identifier, lowLevelClient, origHandler, persistence, priorityClass, realTime, started, startupTime, uri, verbosity| Modifier | Constructor and Description |
|---|---|
protected |
ClientPutBase() |
|
ClientPutBase(FreenetURI uri,
java.lang.String identifier,
int verbosity,
java.lang.String charset,
FCPConnectionHandler handler,
PersistentRequestClient client,
short priorityClass,
ClientRequest.Persistence persistence,
java.lang.String clientToken,
boolean global,
boolean getCHKOnly,
boolean dontCompress,
int maxRetries,
boolean earlyEncode,
boolean canWriteClientCache,
boolean forkOnCacheable,
boolean localRequestOnly,
int extraInsertsSingleBlock,
int extraInsertsSplitfileHeader,
boolean realTimeFlag,
java.lang.String compressorDescriptor,
InsertContext.CompatibilityMode compatMode,
boolean ignoreUSKDatehints,
NodeClientCore core) |
|
ClientPutBase(FreenetURI uri,
java.lang.String identifier,
int verbosity,
java.lang.String charset,
FCPConnectionHandler handler,
short priorityClass,
ClientRequest.Persistence persistence,
java.lang.String clientToken,
boolean global,
boolean getCHKOnly,
boolean dontCompress,
boolean localRequestOnly,
int maxRetries,
boolean earlyEncode,
boolean canWriteClientCache,
boolean forkOnCacheable,
java.lang.String compressorDescriptor,
int extraInsertsSingleBlock,
int extraInsertsSplitfileHeader,
boolean realTimeFlag,
InsertContext.CompatibilityMode compatibilityMode,
boolean ignoreUSKDatehints,
FCPServer server) |
| Modifier and Type | Method and Description |
|---|---|
double |
getFailedBlocks() |
PutFailedMessage |
getFailureMessage() |
java.lang.String |
getFailureReason(boolean longDescription) |
double |
getFatalyFailedBlocks() |
double |
getFetchedBlocks() |
FreenetURI |
getGeneratedURI() |
double |
getMinBlocks() |
double |
getSuccessFraction() |
double |
getTotalBlocks() |
protected abstract java.lang.String |
getTypeName() |
boolean |
isTotalFinalized()
Has the total number of blocks to insert been determined yet?
|
void |
onFailure(InsertException e,
BaseClientPutter state)
Called on failed/canceled insert.
|
void |
onFetchable(BaseClientPutter putter)
Called when the inserted data is fetchable (just a hint, don't rely on this).
|
void |
onGeneratedMetadata(Bucket metadata,
BaseClientPutter state)
Called when we are returning metadata rather than a URI.
|
void |
onGeneratedURI(FreenetURI uri,
BaseClientPutter state)
Called when URI is known (e.g.
|
void |
onLostConnection(ClientContext context)
Lost connection
|
protected abstract void |
onStartCompressing() |
protected abstract void |
onStopCompressing() |
void |
onSuccess(BaseClientPutter state)
Called on successful insert.
|
protected abstract FCPMessage |
persistentTagMessage() |
void |
receive(ClientEvent ce,
ClientContext context)
Hears an event.
|
void |
requestWasRemoved(ClientContext context)
Called after a RemovePersistentRequest.
|
void |
sendPendingMessages(FCPConnectionOutputHandler handler,
java.lang.String listRequestIdentifier,
boolean includeData,
boolean onlyData)
Send any pending messages for a persistent request e.g.
|
void |
setVarsRestart() |
cancel, canRestart, dropped, finish, freeData, fullyResumed, getClient, getClientDetail, getClientRequest, getIdentifier, getLastActivity, getPriority, getRequestClient, getRequestIdentifier, hasFinished, hashCode, hasSucceeded, innerResume, isGlobalQueue, isPersistent, isPersistentForever, isStarted, modifyRequest, onResume, onShutdown, restart, restartAsync, restartFrom, startclone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetRequestClient, onResumeprotected boolean succeeded
protected PutFailedMessage putFailedMessage
protected FreenetURI generatedURI
protected transient FCPMessage progressMessage
protected final FreenetURI publicURI
public static final java.lang.String SALT
public static final java.lang.String FILE_HASH
public ClientPutBase(FreenetURI uri, java.lang.String identifier, int verbosity, java.lang.String charset, FCPConnectionHandler handler, short priorityClass, ClientRequest.Persistence persistence, java.lang.String clientToken, boolean global, boolean getCHKOnly, boolean dontCompress, boolean localRequestOnly, int maxRetries, boolean earlyEncode, boolean canWriteClientCache, boolean forkOnCacheable, java.lang.String compressorDescriptor, int extraInsertsSingleBlock, int extraInsertsSplitfileHeader, boolean realTimeFlag, InsertContext.CompatibilityMode compatibilityMode, boolean ignoreUSKDatehints, FCPServer server) throws java.net.MalformedURLException
java.net.MalformedURLExceptionprotected ClientPutBase()
public ClientPutBase(FreenetURI uri, java.lang.String identifier, int verbosity, java.lang.String charset, FCPConnectionHandler handler, PersistentRequestClient client, short priorityClass, ClientRequest.Persistence persistence, java.lang.String clientToken, boolean global, boolean getCHKOnly, boolean dontCompress, int maxRetries, boolean earlyEncode, boolean canWriteClientCache, boolean forkOnCacheable, boolean localRequestOnly, int extraInsertsSingleBlock, int extraInsertsSplitfileHeader, boolean realTimeFlag, java.lang.String compressorDescriptor, InsertContext.CompatibilityMode compatMode, boolean ignoreUSKDatehints, NodeClientCore core) throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic void onLostConnection(ClientContext context)
ClientRequestonLostConnection in class ClientRequestpublic void onSuccess(BaseClientPutter state)
ClientPutCallbackonSuccess in interface ClientPutCallbackstate - The original BaseClientPutter object which was returned by the .insert() method which
started this insert. Can be casted to the return type of that .insert() (to obtain the Bucket).public void onFailure(InsertException e, BaseClientPutter state)
ClientPutCallbackonFailure in interface ClientPutCallbackstate - The original BaseClientPutter object which was returned by the .insert() method which
started this insert. Can be casted to the return type of that .insert() (to obtain the Bucket).public void onGeneratedURI(FreenetURI uri, BaseClientPutter state)
ClientPutCallbackonGeneratedURI in interface ClientPutCallbackstate - The original BaseClientPutter object which was returned by the .insert() method which
started this insert. Can be casted to the return type of that .insert().public FreenetURI getGeneratedURI()
public void onGeneratedMetadata(Bucket metadata, BaseClientPutter state)
ClientPutCallbackonGeneratedMetadata in interface ClientPutCallbackmetadata - Bucket containing the metadata. Persistent if the insert
is persistent. Recipient may keep it, but must eventually free it. The
caller will not free it.state - The original BaseClientPutter object which was returned by the .insert() method which
started this insert. Can be casted to the return type of that .insert().public 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 abstract void onStopCompressing()
protected abstract void onStartCompressing()
public void onFetchable(BaseClientPutter putter)
ClientPutCallbackonFetchable in interface ClientPutCallbackputter - The original BaseClientPutter object which was returned by the .insert() method which
started this insert. Can be casted to the return type of that .insert().protected abstract FCPMessage persistentTagMessage()
public void sendPendingMessages(FCPConnectionOutputHandler handler, java.lang.String listRequestIdentifier, boolean includeData, boolean onlyData)
ClientRequestsendPendingMessages in class ClientRequestprotected abstract java.lang.String getTypeName()
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 boolean isTotalFinalized()
ClientRequestisTotalFinalized in class ClientRequestpublic java.lang.String getFailureReason(boolean longDescription)
getFailureReason in class ClientRequestpublic PutFailedMessage getFailureMessage()
public void setVarsRestart()