Package com.biglybt.pifimpl.local.ddb
Class DDBaseTTTorrent
- java.lang.Object
-
- com.biglybt.pifimpl.local.ddb.DDBaseTTTorrent
-
- All Implemented Interfaces:
DistributedDatabaseTransferHandler
,DistributedDatabaseTransferType
public class DDBaseTTTorrent extends java.lang.Object implements DistributedDatabaseTransferType, DistributedDatabaseTransferHandler
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
crypto_available
private boolean
crypto_tested
private static byte
CRYPTO_VERSION
private java.util.Map
data_cache
private DDBaseImpl
ddb
private java.util.List
external_downloads
private TorrentAttribute
ta_sha1
private static boolean
TRACE
-
Fields inherited from interface com.biglybt.pif.ddb.DistributedDatabaseTransferType
ST_TORRENT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DDBaseTTTorrent(DDBaseImpl _ddb)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDownload(Download download)
protected byte[]
decrypt(byte[] hash, byte[] data)
protected byte[]
doCrypt(int mode, byte[] hash, byte[] data, int data_offset)
protected byte[]
encrypt(byte[] hash, byte[] data)
DistributedDatabaseValue
read(DistributedDatabaseContact contact, DistributedDatabaseTransferType type, DistributedDatabaseKey key)
protected DistributedDatabaseValue
read(DDBaseContactImpl contact, DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseKey key, long timeout)
void
removeDownload(Download download)
protected boolean
testCrypto()
DistributedDatabaseValue
write(DistributedDatabaseContact contact, DistributedDatabaseTransferType type, DistributedDatabaseKey key, DistributedDatabaseValue value)
-
-
-
Field Detail
-
TRACE
private static final boolean TRACE
- See Also:
- Constant Field Values
-
CRYPTO_VERSION
private static final byte CRYPTO_VERSION
- See Also:
- Constant Field Values
-
ddb
private DDBaseImpl ddb
-
ta_sha1
private TorrentAttribute ta_sha1
-
crypto_tested
private boolean crypto_tested
-
crypto_available
private boolean crypto_available
-
external_downloads
private java.util.List external_downloads
-
data_cache
private java.util.Map data_cache
-
-
Constructor Detail
-
DDBaseTTTorrent
protected DDBaseTTTorrent(DDBaseImpl _ddb)
-
-
Method Detail
-
addDownload
public void addDownload(Download download)
-
removeDownload
public void removeDownload(Download download)
-
read
public DistributedDatabaseValue read(DistributedDatabaseContact contact, DistributedDatabaseTransferType type, DistributedDatabaseKey key) throws DistributedDatabaseException
- Specified by:
read
in interfaceDistributedDatabaseTransferHandler
- Throws:
DistributedDatabaseException
-
write
public DistributedDatabaseValue write(DistributedDatabaseContact contact, DistributedDatabaseTransferType type, DistributedDatabaseKey key, DistributedDatabaseValue value) throws DistributedDatabaseException
- Specified by:
write
in interfaceDistributedDatabaseTransferHandler
- Throws:
DistributedDatabaseException
-
read
protected DistributedDatabaseValue read(DDBaseContactImpl contact, DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseKey key, long timeout) throws DistributedDatabaseException
- Throws:
DistributedDatabaseException
-
encrypt
protected byte[] encrypt(byte[] hash, byte[] data)
-
decrypt
protected byte[] decrypt(byte[] hash, byte[] data)
-
doCrypt
protected byte[] doCrypt(int mode, byte[] hash, byte[] data, int data_offset)
-
testCrypto
protected boolean testCrypto()
-
-