public class SimpleHealingQueue extends BaseClientPutter implements HealingQueue, PutCompletionCallback
blockSetFinalized, cancelled, client, creationTime, failedBlocks, fatallyFailedBlocks, latestFailure, latestSuccess, minSuccessBlocks, priorityClass, realTimeFlag, sentToNetwork, successfulBlocks, totalBlocks
Constructor and Description |
---|
SimpleHealingQueue(InsertContext context,
short prio,
int maxRunning) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(ClientContext context)
Cancel the request.
|
protected ClientBaseCallback |
getCallback() |
int |
getMinSuccessFetchBlocks() |
FreenetURI |
getURI()
Get the URI for the request or insert.
|
protected void |
innerNotifyClients(ClientContext context)
Notify clients, usually via a SplitfileProgressEvent, of the current progress.
|
void |
innerOnResume(ClientContext context)
Called by onResume() once and only once after restarting.
|
boolean |
innerQueue(Bucket data,
byte[] cryptoKey,
byte cryptoAlgorithm,
ClientContext context) |
protected void |
innerToNetwork(ClientContext context)
Notify clients that a request has gone to the network, for the first time, i.e.
|
boolean |
isFinished()
Is the request or insert completed (succeeded, failed, or
cancelled, which is a kind of failure)?
|
void |
onBlockSetFinished(ClientPutState state,
ClientContext context)
Called when the ClientPutState knows that it knows about
all the blocks it will need to put.
|
void |
onEncode(BaseClientKey usk,
ClientPutState state,
ClientContext context)
Called when we know the final URI of the state in question.
|
void |
onFailure(InsertException e,
ClientPutState state,
ClientContext context) |
void |
onFetchable(ClientPutState state)
Called when enough data has been inserted that the file can be
retrieved, even if not all data has been inserted yet.
|
void |
onMetadata(Bucket meta,
ClientPutState state,
ClientContext context)
Called as an alternative to onEncode, if a metadata length threshold
was specified.
|
void |
onMetadata(Metadata m,
ClientPutState state,
ClientContext context)
Only called if explicitly asked for, in which case, generally
the metadata won't be inserted.
|
void |
onSuccess(ClientPutState state,
ClientContext context) |
void |
onTransition(ClientGetState oldState,
ClientGetState newState,
ClientContext context) |
void |
onTransition(ClientPutState oldState,
ClientPutState newState,
ClientContext context) |
void |
queue(Bucket data,
byte[] cryptoKey,
byte cryptoAlgorithm,
ClientContext context)
Queue a Bucket of data to insert as a CHK.
|
dump
addBlock, addBlocks, addMustSucceedBlocks, addRedundantBlocksInsert, blockSetFinalized, cancel, clearCountersOnRestart, completedBlock, failedBlock, failedBlock, fatallyFailedBlock, getAll, getClient, getClientDetail, getClientDetail, getLatestFailure, getLatestSuccess, getPriorityClass, getSchedulerGroup, getTotalBlocks, hashCode, isCancelled, isCurrentState, notifyClients, onResume, onShutdown, persistent, realTimeFlag, resetBlocks, setPriorityClass, toNetwork
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
onResume
public SimpleHealingQueue(InsertContext context, short prio, int maxRunning)
public boolean innerQueue(Bucket data, byte[] cryptoKey, byte cryptoAlgorithm, ClientContext context)
public void queue(Bucket data, byte[] cryptoKey, byte cryptoAlgorithm, ClientContext context)
HealingQueue
queue
in interface HealingQueue
public FreenetURI getURI()
ClientRequester
getURI
in class ClientRequester
public boolean isFinished()
ClientRequester
isFinished
in class ClientRequester
protected void innerNotifyClients(ClientContext context)
ClientRequester
innerNotifyClients
in class ClientRequester
public void onSuccess(ClientPutState state, ClientContext context)
onSuccess
in interface PutCompletionCallback
public void onFailure(InsertException e, ClientPutState state, ClientContext context)
onFailure
in interface PutCompletionCallback
public void onEncode(BaseClientKey usk, ClientPutState state, ClientContext context)
PutCompletionCallback
onEncode
in interface PutCompletionCallback
public void onTransition(ClientPutState oldState, ClientPutState newState, ClientContext context)
onTransition
in interface PutCompletionCallback
onTransition
in class BaseClientPutter
public void onMetadata(Metadata m, ClientPutState state, ClientContext context)
PutCompletionCallback
onMetadata
in interface PutCompletionCallback
public void onBlockSetFinished(ClientPutState state, ClientContext context)
PutCompletionCallback
onBlockSetFinished
in interface PutCompletionCallback
public void onFetchable(ClientPutState state)
PutCompletionCallback
onFetchable
in interface PutCompletionCallback
public void onTransition(ClientGetState oldState, ClientGetState newState, ClientContext context)
onTransition
in class ClientRequester
protected void innerToNetwork(ClientContext context)
ClientRequester
innerToNetwork
in class ClientRequester
public void cancel(ClientContext context)
ClientRequester
cancel
in class ClientRequester
context
- The ClientContext object including essential but
non-persistent objects such as the schedulers.public int getMinSuccessFetchBlocks()
getMinSuccessFetchBlocks
in class BaseClientPutter
public void onMetadata(Bucket meta, ClientPutState state, ClientContext context)
PutCompletionCallback
onMetadata
in interface PutCompletionCallback
public void innerOnResume(ClientContext context)
ClientRequester
innerOnResume
in class ClientRequester
protected ClientBaseCallback getCallback()
getCallback
in class ClientRequester