org.gudy.azureus2.pluginsimpl.local.ddb
Class DDBaseContactImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.ddb.DDBaseContactImpl
All Implemented Interfaces:
DistributedDatabaseContact

public class DDBaseContactImpl
extends Object
implements DistributedDatabaseContact

Author:
parg

Constructor Summary
protected DDBaseContactImpl(DDBaseImpl _ddb, DHTPluginContact _contact)
           
 
Method Summary
 Map<String,Object> exportToMap()
           
 InetSocketAddress getAddress()
           
protected  DHTPluginContact getContact()
           
 int getDHT()
           
 byte[] getID()
           
 String getName()
           
 boolean isAlive(long timeout)
           
 void isAlive(long timeout, DistributedDatabaseListener listener)
           
 boolean isOrHasBeenLocal()
           
 boolean openTunnel()
          Tries to open a NAT tunnel to the contact.
 DistributedDatabaseValue read(DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseKey key, long timeout)
           
 void write(DistributedDatabaseTransferType type, DistributedDatabaseKey key, DistributedDatabaseValue data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DDBaseContactImpl

protected DDBaseContactImpl(DDBaseImpl _ddb,
                            DHTPluginContact _contact)
Method Detail

getID

public byte[] getID()
Specified by:
getID in interface DistributedDatabaseContact

getName

public String getName()
Specified by:
getName in interface DistributedDatabaseContact

getAddress

public InetSocketAddress getAddress()
Specified by:
getAddress in interface DistributedDatabaseContact

getDHT

public int getDHT()
Specified by:
getDHT in interface DistributedDatabaseContact

isAlive

public boolean isAlive(long timeout)
Specified by:
isAlive in interface DistributedDatabaseContact

isAlive

public void isAlive(long timeout,
                    DistributedDatabaseListener listener)
Specified by:
isAlive in interface DistributedDatabaseContact

isOrHasBeenLocal

public boolean isOrHasBeenLocal()
Specified by:
isOrHasBeenLocal in interface DistributedDatabaseContact

exportToMap

public Map<String,Object> exportToMap()
Specified by:
exportToMap in interface DistributedDatabaseContact

openTunnel

public boolean openTunnel()
Description copied from interface: DistributedDatabaseContact
Tries to open a NAT tunnel to the contact. Should only be used if direct contact fails

Specified by:
openTunnel in interface DistributedDatabaseContact
Returns:

write

public void write(DistributedDatabaseTransferType type,
                  DistributedDatabaseKey key,
                  DistributedDatabaseValue data)
           throws DistributedDatabaseException
Specified by:
write in interface DistributedDatabaseContact
Throws:
DistributedDatabaseException

read

public DistributedDatabaseValue read(DistributedDatabaseProgressListener listener,
                                     DistributedDatabaseTransferType type,
                                     DistributedDatabaseKey key,
                                     long timeout)
                              throws DistributedDatabaseException
Specified by:
read in interface DistributedDatabaseContact
Throws:
DistributedDatabaseException

getContact

protected DHTPluginContact getContact()