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, start
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
getRequestClient, onResume
protected 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.MalformedURLException
protected 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.MalformedURLException
public void onLostConnection(ClientContext context)
ClientRequest
onLostConnection
in class ClientRequest
public void onSuccess(BaseClientPutter state)
ClientPutCallback
onSuccess
in interface ClientPutCallback
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() (to obtain the Bucket).public void onFailure(InsertException e, BaseClientPutter state)
ClientPutCallback
onFailure
in interface ClientPutCallback
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() (to obtain the Bucket).public void onGeneratedURI(FreenetURI uri, BaseClientPutter state)
ClientPutCallback
onGeneratedURI
in interface ClientPutCallback
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 FreenetURI getGeneratedURI()
public void onGeneratedMetadata(Bucket metadata, BaseClientPutter state)
ClientPutCallback
onGeneratedMetadata
in interface ClientPutCallback
metadata
- 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)
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 abstract void onStopCompressing()
protected abstract void onStartCompressing()
public void onFetchable(BaseClientPutter putter)
ClientPutCallback
onFetchable
in interface ClientPutCallback
putter
- 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)
ClientRequest
sendPendingMessages
in class ClientRequest
protected abstract java.lang.String getTypeName()
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 boolean isTotalFinalized()
ClientRequest
isTotalFinalized
in class ClientRequest
public java.lang.String getFailureReason(boolean longDescription)
getFailureReason
in class ClientRequest
public PutFailedMessage getFailureMessage()
public void setVarsRestart()