Class DDBaseImpl
java.lang.Object
com.biglybt.pifimpl.local.ddb.DDBaseImpl
- All Implemented Interfaces:
DistributedDatabase
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static AEMonitorprivate final Coreprivate static Map<DHTPluginInterface, DistributedDatabase> private DHTPluginInterfaceprivate final Stringprivate static booleanprivate static DDBaseImplprivate final DDBaseTTTorrentprivate Map<HashWrapper, DistributedDatabaseTransferHandler> Fields inherited from interface DistributedDatabase
DT_FREQUENCY, DT_NONE, DT_SIZE, OP_EXHAUSTIVE_READ, OP_NONE, OP_PRIORITY_HIGH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDDBaseImpl(Core _core) protectedDDBaseImpl(String _net, DHTPluginInterface _dht) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddTransferHandler(DistributedDatabaseTransferType type, DistributedDatabaseTransferHandler handler) protected DistributedDatabaseValuecall(DDBaseContactImpl contact, DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseValue value, long timeout) createValue(Object value) voiddelete(DistributedDatabaseListener listener, DistributedDatabaseKey key) voiddelete(DistributedDatabaseListener listener, DistributedDatabaseKey key, DistributedDatabaseContact[] targets) static List<DistributedDatabase> static List<DistributedDatabase> static List<DistributedDatabase> protected DHTPluginInterfacegetDHT()static DDBaseImplgetSingleton(Core core) getStandardTransferType(int standard_type) Get all locally held (direct+indirect) values for a keyprotected DHTPluginInterfacegrabDHT()importContact(InetSocketAddress address) importContact(InetSocketAddress address, byte version) importContact(InetSocketAddress address, byte version, int preferred_dht) importContact(Map<String, Object> map) booleanbooleanbooleanprotected booleanprotected voidvoidread(DistributedDatabaseListener listener, DistributedDatabaseKey key, long timeout) voidread(DistributedDatabaseListener listener, DistributedDatabaseKey key, long timeout, int options) protected DistributedDatabaseValueread(DDBaseContactImpl contact, DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseKey key, long timeout) voidreadKeyStats(DistributedDatabaseListener listener, DistributedDatabaseKey key, long timeout) voidprotected voidvoidwrite(DistributedDatabaseListener listener, DistributedDatabaseKey key, DistributedDatabaseValue value) voidwrite(DistributedDatabaseListener listener, DistributedDatabaseKey key, DistributedDatabaseValue[] values) protected voidwrite(DDBaseContactImpl contact, DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseKey key, DistributedDatabaseValue value, long timeout)
-
Field Details
-
singleton
-
class_mon
-
transfer_map
-
prefer_i2p
private static boolean prefer_i2p -
dht_pi_map
-
core
-
torrent_transfer
-
network
-
dht_use_accessor
-
listeners
-
-
Constructor Details
-
DDBaseImpl
-
DDBaseImpl
-
-
Method Details
-
getSingleton
-
getDDBs
-
getDDBs
-
getDDBs
-
getNetwork
- Specified by:
getNetworkin interfaceDistributedDatabase
-
getDHTPlugin
- Specified by:
getDHTPluginin interfaceDistributedDatabase
-
getTTTorrent
-
grabDHT
-
isAvailable
public boolean isAvailable()- Specified by:
isAvailablein interfaceDistributedDatabase
-
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfaceDistributedDatabase
-
isExtendedUseAllowed
public boolean isExtendedUseAllowed()- Specified by:
isExtendedUseAllowedin interfaceDistributedDatabase
-
isTorrentXferEnabled
protected boolean isTorrentXferEnabled() -
getLocalContact
- Specified by:
getLocalContactin interfaceDistributedDatabase
-
throwIfNotAvailable
- Throws:
DistributedDatabaseException
-
getDHT
- Throws:
DistributedDatabaseException
-
log
-
createKey
- Specified by:
createKeyin interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
createKey
public DistributedDatabaseKey createKey(Object key, String description) throws DistributedDatabaseException - Specified by:
createKeyin interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
createValue
- Specified by:
createValuein interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
importContact
public DistributedDatabaseContact importContact(InetSocketAddress address) throws DistributedDatabaseException - Specified by:
importContactin interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
importContact
public DistributedDatabaseContact importContact(InetSocketAddress address, byte version) throws DistributedDatabaseException - Specified by:
importContactin interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
importContact
public DistributedDatabaseContact importContact(InetSocketAddress address, byte version, int preferred_dht) throws DistributedDatabaseException - Specified by:
importContactin interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
importContact
public DistributedDatabaseContact importContact(Map<String, Object> map) throws DistributedDatabaseException- Specified by:
importContactin interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
write
public void write(DistributedDatabaseListener listener, DistributedDatabaseKey key, DistributedDatabaseValue value) throws DistributedDatabaseException - Specified by:
writein interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
write
public void write(DistributedDatabaseListener listener, DistributedDatabaseKey key, DistributedDatabaseValue[] values) throws DistributedDatabaseException - Specified by:
writein interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
read
public void read(DistributedDatabaseListener listener, DistributedDatabaseKey key, long timeout) throws DistributedDatabaseException - Specified by:
readin interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
read
public void read(DistributedDatabaseListener listener, DistributedDatabaseKey key, long timeout, int options) throws DistributedDatabaseException - Specified by:
readin interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
readKeyStats
public void readKeyStats(DistributedDatabaseListener listener, DistributedDatabaseKey key, long timeout) throws DistributedDatabaseException - Specified by:
readKeyStatsin interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
getValues
public List<DistributedDatabaseValue> getValues(DistributedDatabaseKey key) throws DistributedDatabaseException Description copied from interface:DistributedDatabaseGet all locally held (direct+indirect) values for a key- Specified by:
getValuesin interfaceDistributedDatabase- Parameters:
key-- Returns:
- Throws:
DistributedDatabaseException
-
delete
public void delete(DistributedDatabaseListener listener, DistributedDatabaseKey key) throws DistributedDatabaseException - Specified by:
deletein interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
delete
public void delete(DistributedDatabaseListener listener, DistributedDatabaseKey key, DistributedDatabaseContact[] targets) throws DistributedDatabaseException - Specified by:
deletein interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
addTransferHandler
public void addTransferHandler(DistributedDatabaseTransferType type, DistributedDatabaseTransferHandler handler) throws DistributedDatabaseException - Specified by:
addTransferHandlerin interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
getStandardTransferType
public DistributedDatabaseTransferType getStandardTransferType(int standard_type) throws DistributedDatabaseException - Specified by:
getStandardTransferTypein interfaceDistributedDatabase- Throws:
DistributedDatabaseException
-
read
protected DistributedDatabaseValue read(DDBaseContactImpl contact, DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseKey key, long timeout) throws DistributedDatabaseException - Throws:
DistributedDatabaseException
-
write
protected void write(DDBaseContactImpl contact, DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseKey key, DistributedDatabaseValue value, long timeout) throws DistributedDatabaseException - Throws:
DistributedDatabaseException
-
call
protected DistributedDatabaseValue call(DDBaseContactImpl contact, DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseValue value, long timeout) throws DistributedDatabaseException - Throws:
DistributedDatabaseException
-
addListener
- Specified by:
addListenerin interfaceDistributedDatabase
-
removeListener
- Specified by:
removeListenerin interfaceDistributedDatabase
-