com.aelitis.azureus.core.dht.db
Interface DHTDB

All Known Implementing Classes:
DHTDBImpl

public interface DHTDB

Author:
parg

Method Summary
 void destroy()
           
 DHTDBLookupResult get(DHTTransportContact reader, HashWrapper key, int max_values, short flags, boolean external_request)
           
 DHTDBValue get(HashWrapper key)
          Internal lookup for locally originated values
 List<DHTDBValue> getAllValues(HashWrapper key)
           
 DHTDBValue getAnyValue(HashWrapper key)
          Returns a value for the given key (local or remote) if found
 DHTStorageBlock[] getDirectKeyBlocks()
           
 DHTStorageBlock getKeyBlockDetails(byte[] key)
           
 Iterator<HashWrapper> getKeys()
          Returns an iterator over HashWrapper values denoting the snapshot of keys Thus by the time a key is used the entry may no longer exist
 DHTDBStats getStats()
           
 boolean hasKey(HashWrapper key)
           
 boolean isEmpty()
           
 boolean isKeyBlocked(byte[] key)
           
 DHTStorageBlock keyBlockRequest(DHTTransportContact direct_sender, byte[] request, byte[] signature)
           
 void print(boolean full)
           
 DHTTransportQueryStoreReply queryStore(DHTTransportContact originating_contact, int header_len, List<Object[]> keys)
           
 DHTDBValue remove(DHTTransportContact sender, HashWrapper key)
          Local remove - returns a value suitable for putting in the DHT
 void setControl(DHTControl control)
           
 void setSleeping(boolean asleep)
           
 void setSuspended(boolean susp)
           
 byte store(DHTTransportContact sender, HashWrapper key, DHTTransportValue[] values)
          Remote store
 DHTDBValue store(HashWrapper key, byte[] value, short flags, byte life_hours, byte replication_control)
          Local store
 

Method Detail

setControl

void setControl(DHTControl control)

store

DHTDBValue store(HashWrapper key,
                 byte[] value,
                 short flags,
                 byte life_hours,
                 byte replication_control)
Local store

Parameters:
key -
value -
flags -
Returns:

store

byte store(DHTTransportContact sender,
           HashWrapper key,
           DHTTransportValue[] values)
Remote store

Parameters:
sender -
key -
values -
Returns:
diversification state

queryStore

DHTTransportQueryStoreReply queryStore(DHTTransportContact originating_contact,
                                       int header_len,
                                       List<Object[]> keys)

get

DHTDBValue get(HashWrapper key)
Internal lookup for locally originated values

Parameters:
key -
Returns:

getAnyValue

DHTDBValue getAnyValue(HashWrapper key)
Returns a value for the given key (local or remote) if found

Parameters:
key -
Returns:

getAllValues

List<DHTDBValue> getAllValues(HashWrapper key)

hasKey

boolean hasKey(HashWrapper key)

get

DHTDBLookupResult get(DHTTransportContact reader,
                      HashWrapper key,
                      int max_values,
                      short flags,
                      boolean external_request)

remove

DHTDBValue remove(DHTTransportContact sender,
                  HashWrapper key)
Local remove - returns a value suitable for putting in the DHT

Parameters:
sender -
key -
Returns:

keyBlockRequest

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

getKeyBlockDetails

DHTStorageBlock getKeyBlockDetails(byte[] key)

isKeyBlocked

boolean isKeyBlocked(byte[] key)

getDirectKeyBlocks

DHTStorageBlock[] getDirectKeyBlocks()

isEmpty

boolean isEmpty()

getKeys

Iterator<HashWrapper> getKeys()
Returns an iterator over HashWrapper values denoting the snapshot of keys Thus by the time a key is used the entry may no longer exist

Returns:

getStats

DHTDBStats getStats()

setSleeping

void setSleeping(boolean asleep)

setSuspended

void setSuspended(boolean susp)

destroy

void destroy()

print

void print(boolean full)