com.aelitis.azureus.core.dht
Interface DHTStorageAdapter

All Known Implementing Classes:
DHTDBImpl.adapterFacade, DHTPluginStorageManager

public interface DHTStorageAdapter

Author:
parg

Method Summary
 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 key
 void 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)
           
 

Method Detail

getNetwork

int getNetwork()

keyCreated

DHTStorageKey keyCreated(HashWrapper key,
                         boolean local)
Create a new storage key for a given key

Returns:
null if the key shouldn't be allocated (e.g.out of space)

keyDeleted

void keyDeleted(DHTStorageKey adapter_key)

keyRead

void keyRead(DHTStorageKey adapter_key,
             DHTTransportContact contact)

deserialiseStats

DHTStorageKeyStats deserialiseStats(java.io.DataInputStream is)
                                    throws java.io.IOException
Throws:
java.io.IOException

valueAdded

void valueAdded(DHTStorageKey key,
                DHTTransportValue value)

valueUpdated

void valueUpdated(DHTStorageKey key,
                  DHTTransportValue old_value,
                  DHTTransportValue new_value)

valueDeleted

void valueDeleted(DHTStorageKey key,
                  DHTTransportValue value)

isDiversified

boolean isDiversified(byte[] key)

getExistingDiversification

byte[][] getExistingDiversification(byte[] key,
                                    boolean put_operation,
                                    boolean exhaustive_get,
                                    int max_depth)

createNewDiversification

byte[][] createNewDiversification(java.lang.String description,
                                  DHTTransportContact cause,
                                  byte[] key,
                                  boolean put_operation,
                                  byte diversification_type,
                                  boolean exhaustive_get,
                                  int max_depth)

getNextValueVersions

int getNextValueVersions(int num)

keyBlockRequest

DHTStorageBlock keyBlockRequest(DHTTransportContact direct_sender,
                                byte[] request,
                                byte[] signature)

getKeyBlockDetails

DHTStorageBlock getKeyBlockDetails(byte[] key)

getDirectKeyBlocks

DHTStorageBlock[] getDirectKeyBlocks()

getKeyForKeyBlock

byte[] getKeyForKeyBlock(byte[] request)

setStorageForKey

void setStorageForKey(java.lang.String key,
                      byte[] data)

getStorageForKey

byte[] getStorageForKey(java.lang.String key)

getRemoteFreqDivCount

int getRemoteFreqDivCount()

getRemoteSizeDivCount

int getRemoteSizeDivCount()

getKeyCount

int getKeyCount()