public interface SplitFileFetcherStorageCallback
Modifier and Type | Method and Description |
---|---|
void |
clearCooldown()
Called when the fetcher may have exited cooldown early.
|
void |
fail(FetchException fetchException)
Called when the fetch failed, e.g.
|
void |
failOnDiskError(ChecksumFailedException e)
Called when the splitfile storage layer receives unrecoverable data corruption.
|
void |
failOnDiskError(java.io.IOException e)
Called when the splitfile storage layer receives an unrecoverable disk I/O error.
|
HasKeyListener |
getHasKeyListener()
Can be null.
|
short |
getPriorityClass()
Get the priority class of the request.
|
KeySalter |
getSalter() |
BaseSendableGet |
getSendableGet()
Can be null.
|
void |
maybeAddToBinaryBlob(ClientCHKBlock decodedBlock)
Called whenever we successfully download, decode or encode a block and it matches the
expected key.
|
void |
onClosed()
Called when the storage layer has finished, the higher level code has finished, and the
storage has been freed, i.e.
|
void |
onFailedBlock()
Called when the splitfile fetcher gives up on a block.
|
void |
onFetchedBlock() |
void |
onResume(int succeededBlocks,
int failedBlocks,
ClientMetadata mimeType,
long finalSize) |
void |
onSplitfileCompatibilityMode(InsertContext.CompatibilityMode min,
InsertContext.CompatibilityMode max,
byte[] customSplitfileKey,
boolean compressed,
boolean bottomLayer,
boolean definitiveAnyway)
Called during construction, when we know the settings for the splitfile.
|
void |
onSuccess()
Called when the splitfile has been successfully downloaded and decoded.
|
void |
queueHeal(byte[] data,
byte[] cryptoKey,
byte cryptoAlgorithm)
Queue a block to be healed.
|
void |
reduceCooldown(long wakeupTime)
Called when the wakeup time reduces but it is still not fetchable.
|
void |
restartedAfterDataCorruption()
Called when we recover from disk corruption, and have to re-download some blocks that we
had already downloaded but which were corrupted on disk.
|
void |
setSplitfileBlocks(int requiredBlocks,
int remainingBlocks)
Called during construction to tell other layers how many blocks to expect.
|
boolean |
wantBinaryBlob()
Do we want maybeAddToBinaryBlob() to be called?? LOCKING: Should not take any locks.
|
void onSuccess()
short getPriorityClass()
void failOnDiskError(java.io.IOException e)
void failOnDiskError(ChecksumFailedException e)
void setSplitfileBlocks(int requiredBlocks, int remainingBlocks)
requiredBlocks
- The number of blocks that must be fetched to complete the download.remainingBlocks
- The total number of blocks minus requiredBlocks.void onSplitfileCompatibilityMode(InsertContext.CompatibilityMode min, InsertContext.CompatibilityMode max, byte[] customSplitfileKey, boolean compressed, boolean bottomLayer, boolean definitiveAnyway)
min
- The lowest CompatibilityMode that appears to be valid based on what we've fetched so far.max
- The highest CompatibilityMode that appears to be valid based on what we've fetched so far.customSplitfileKey
- The fixed byte[] encryption key used on insert. On anything recent, we generate a single key, randomly for an SSK,
or based on the content for a CHK, and use it for everything. This saves metadata space and improves security for SSKs.compressed
- Whether the content is compressed. If false, the dontCompress option was used.bottomLayer
- Whether this report originates at the bottom layer of the splitfile pyramid. I.e. the actual file, not the file containing
the metadata to fetch the file (this can recurse for several levels!)definitiveAnyway
- Whether this report is definitive even though it's not from the bottom layer. This is true of recent splitfiles,
where we store all the data in the top key.void queueHeal(byte[] data, byte[] cryptoKey, byte cryptoAlgorithm)
void onClosed()
void onFetchedBlock()
void onFailedBlock()
void onResume(int succeededBlocks, int failedBlocks, ClientMetadata mimeType, long finalSize)
void fail(FetchException fetchException)
void maybeAddToBinaryBlob(ClientCHKBlock decodedBlock)
boolean wantBinaryBlob()
BaseSendableGet getSendableGet()
void restartedAfterDataCorruption()
void clearCooldown()
void reduceCooldown(long wakeupTime)
HasKeyListener getHasKeyListener()
KeySalter getSalter()