Package org.klomp.snark
Interface StorageListener
- All Known Implementing Classes:
FetchAndAdd
,Snark
interface StorageListener
Callback used when Storage changes.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(String message) void
setWantedPieces
(Storage storage) Reset the peer's wanted pieces table Call after the storage double-check failsvoid
storageAllChecked
(Storage storage) Called when all pieces in the storage have been checked.void
storageAllocated
(Storage storage, long length) Called to indicate that length bytes have been allocated.void
storageChecked
(Storage storage, int num, boolean checked) Called when storage is being checked and the num piece of that total pieces has been checked.void
storageCompleted
(Storage storage) Called the one time when the data is completely received and checked.void
storageCreateFile
(Storage storage, String name, long length) Called when the storage creates a new file of a given length.
-
Method Details
-
storageCreateFile
Called when the storage creates a new file of a given length. -
storageAllocated
Called to indicate that length bytes have been allocated. -
storageChecked
Called when storage is being checked and the num piece of that total pieces has been checked. When the piece hash matches the expected piece hash checked will be true, otherwise it will be false. -
storageAllChecked
Called when all pieces in the storage have been checked. Does not mean that the storage is complete, just that the state of the storage is known. -
storageCompleted
Called the one time when the data is completely received and checked. -
setWantedPieces
Reset the peer's wanted pieces table Call after the storage double-check fails -
addMessage
-