Package com.biglybt.core.dht.db.impl
Class DHTDBImpl.adapterFacade
- java.lang.Object
-
- com.biglybt.core.dht.db.impl.DHTDBImpl.adapterFacade
-
- All Implemented Interfaces:
DHTStorageAdapter
- Enclosing class:
- DHTDBImpl
protected class DHTDBImpl.adapterFacade extends java.lang.Object implements DHTStorageAdapter
-
-
Field Summary
Fields Modifier and Type Field Description private DHTStorageAdapter
delegate
-
Constructor Summary
Constructors Modifier Constructor Description protected
adapterFacade(DHTStorageAdapter _delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[][]
createNewDiversification(java.lang.String description, DHTTransportContact cause, byte[] key, boolean put_operation, byte diversification_type, boolean exhaustive_get, int max_depth)
DHTStorageKeyStats
deserialiseStats(java.io.DataInputStream is)
DHTStorageBlock[]
getDirectKeyBlocks()
byte[][]
getExistingDiversification(byte[] key, boolean put_operation, boolean exhaustive_get, int max_depth)
DHTStorageBlock
getKeyBlockDetails(byte[] key)
int
getKeyCount()
byte[]
getKeyForKeyBlock(byte[] request)
int
getNetwork()
int
getNextValueVersions(int num)
int
getRemoteFreqDivCount()
int
getRemoteSizeDivCount()
byte[]
getStorageForKey(java.lang.String key)
boolean
isDiversified(byte[] key)
DHTStorageBlock
keyBlockRequest(DHTTransportContact direct_sender, byte[] request, byte[] signature)
DHTStorageKey
keyCreated(HashWrapper key, boolean local)
Create a new storage key for a given keyvoid
keyDeleted(DHTStorageKey adapter_key)
void
keyRead(DHTStorageKey adapter_key, DHTTransportContact contact)
void
setStorageForKey(java.lang.String key, byte[] data)
void
valueAdded(DHTStorageKey key, DHTTransportValue value)
void
valueDeleted(DHTStorageKey key, DHTTransportValue value)
void
valueUpdated(DHTStorageKey key, DHTTransportValue old_value, DHTTransportValue new_value)
-
-
-
Field Detail
-
delegate
private final DHTStorageAdapter delegate
-
-
Constructor Detail
-
adapterFacade
protected adapterFacade(DHTStorageAdapter _delegate)
-
-
Method Detail
-
getNetwork
public int getNetwork()
- Specified by:
getNetwork
in interfaceDHTStorageAdapter
-
keyCreated
public DHTStorageKey keyCreated(HashWrapper key, boolean local)
Description copied from interface:DHTStorageAdapter
Create a new storage key for a given key- Specified by:
keyCreated
in interfaceDHTStorageAdapter
- Returns:
- null if the key shouldn't be allocated (e.g.out of space)
-
keyDeleted
public void keyDeleted(DHTStorageKey adapter_key)
- Specified by:
keyDeleted
in interfaceDHTStorageAdapter
-
getKeyCount
public int getKeyCount()
- Specified by:
getKeyCount
in interfaceDHTStorageAdapter
-
keyRead
public void keyRead(DHTStorageKey adapter_key, DHTTransportContact contact)
- Specified by:
keyRead
in interfaceDHTStorageAdapter
-
deserialiseStats
public DHTStorageKeyStats deserialiseStats(java.io.DataInputStream is) throws java.io.IOException
- Specified by:
deserialiseStats
in interfaceDHTStorageAdapter
- Throws:
java.io.IOException
-
valueAdded
public void valueAdded(DHTStorageKey key, DHTTransportValue value)
- Specified by:
valueAdded
in interfaceDHTStorageAdapter
-
valueUpdated
public void valueUpdated(DHTStorageKey key, DHTTransportValue old_value, DHTTransportValue new_value)
- Specified by:
valueUpdated
in interfaceDHTStorageAdapter
-
valueDeleted
public void valueDeleted(DHTStorageKey key, DHTTransportValue value)
- Specified by:
valueDeleted
in interfaceDHTStorageAdapter
-
isDiversified
public boolean isDiversified(byte[] key)
- Specified by:
isDiversified
in interfaceDHTStorageAdapter
-
getExistingDiversification
public byte[][] getExistingDiversification(byte[] key, boolean put_operation, boolean exhaustive_get, int max_depth)
- Specified by:
getExistingDiversification
in interfaceDHTStorageAdapter
-
createNewDiversification
public byte[][] createNewDiversification(java.lang.String description, DHTTransportContact cause, byte[] key, boolean put_operation, byte diversification_type, boolean exhaustive_get, int max_depth)
- Specified by:
createNewDiversification
in interfaceDHTStorageAdapter
-
getNextValueVersions
public int getNextValueVersions(int num)
- Specified by:
getNextValueVersions
in interfaceDHTStorageAdapter
-
keyBlockRequest
public DHTStorageBlock keyBlockRequest(DHTTransportContact direct_sender, byte[] request, byte[] signature)
- Specified by:
keyBlockRequest
in interfaceDHTStorageAdapter
-
getKeyBlockDetails
public DHTStorageBlock getKeyBlockDetails(byte[] key)
- Specified by:
getKeyBlockDetails
in interfaceDHTStorageAdapter
-
getDirectKeyBlocks
public DHTStorageBlock[] getDirectKeyBlocks()
- Specified by:
getDirectKeyBlocks
in interfaceDHTStorageAdapter
-
getKeyForKeyBlock
public byte[] getKeyForKeyBlock(byte[] request)
- Specified by:
getKeyForKeyBlock
in interfaceDHTStorageAdapter
-
setStorageForKey
public void setStorageForKey(java.lang.String key, byte[] data)
- Specified by:
setStorageForKey
in interfaceDHTStorageAdapter
-
getStorageForKey
public byte[] getStorageForKey(java.lang.String key)
- Specified by:
getStorageForKey
in interfaceDHTStorageAdapter
-
getRemoteFreqDivCount
public int getRemoteFreqDivCount()
- Specified by:
getRemoteFreqDivCount
in interfaceDHTStorageAdapter
-
getRemoteSizeDivCount
public int getRemoteSizeDivCount()
- Specified by:
getRemoteSizeDivCount
in interfaceDHTStorageAdapter
-
-