Interface StorageListener

  • All Known Implementing Classes:
    FetchAndAdd, Snark

    interface StorageListener
    Callback used when Storage changes.
    • Method Detail

      • storageCreateFile

        void storageCreateFile​(Storage storage,
                               String name,
                               long length)
        Called when the storage creates a new file of a given length.
      • storageAllocated

        void storageAllocated​(Storage storage,
                              long length)
        Called to indicate that length bytes have been allocated.
      • storageChecked

        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. When the piece hash matches the expected piece hash checked will be true, otherwise it will be false.
      • storageAllChecked

        void storageAllChecked​(Storage storage)
        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

        void storageCompleted​(Storage storage)
        Called the one time when the data is completely received and checked.
      • setWantedPieces

        void setWantedPieces​(Storage storage)
        Reset the peer's wanted pieces table Call after the storage double-check fails
      • addMessage

        void addMessage​(String message)