net.tomp2p.storage
Interface Digest

All Known Implementing Classes:
Storage, StorageDisk, StorageMemory, TrackerStorage

public interface Digest

The storage stores Number480, which is separated in 3 Number160. The first Number160 is the location key, the second is the domain key, and the third is the content key. A digest can be calculated over all content keys for a specific location and domain. The digest can also be calculated over a selected range of content keys for a specific location and domain.

Author:
Thomas Bocek

Method Summary
 DigestInfo digest(Number320 key)
          Calculates a digest over a specific location and domain.
 DigestInfo digest(Number320 key, Collection<Number160> contentKeys)
          Calculates a digest over a specific location and domain.
 

Method Detail

digest

DigestInfo digest(Number320 key)
Calculates a digest over a specific location and domain. It will return those content keys that are stored.

Parameters:
key - The location and domain key
Returns:
A list of all hashes for the content keys. To return a predictable amount (important for routing), the hashes can be xored.

digest

DigestInfo digest(Number320 key,
                  Collection<Number160> contentKeys)
Calculates a digest over a specific location and domain. It will return those content keys that are stored. Those keys that are not stored are ignored

Parameters:
key - The location and domain key
contentKeys - The content keys to look for. Those keys that are not found are ignored.
Returns:
A list of all hashes for the content keys. To return a predictable amount (important for routing), the hashes can be xored.


Copyright © 2012. All Rights Reserved.