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 java.lang.Object
implements DistributedDatabaseContact

Author:
parg

Constructor Summary
protected DDBaseContactImpl(DDBaseImpl _ddb, DHTPluginContact _contact)
           
 
Method Summary
 DistributedDatabaseValue call(DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseValue data, long timeout)
           
 java.util.Map<java.lang.String,java.lang.Object> exportToMap()
           
 java.net.InetSocketAddress getAddress()
           
protected  DHTPluginContact getContact()
           
 int getDHT()
           
 byte[] getID()
           
 java.lang.String getName()
           
 int getVersion()
           
 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(DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseKey key, DistributedDatabaseValue value, long timeout)
           
 
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 java.lang.String getName()
Specified by:
getName in interface DistributedDatabaseContact

getVersion

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

getAddress

public java.net.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 java.util.Map<java.lang.String,java.lang.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:

call

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

write

public void write(DistributedDatabaseProgressListener listener,
                  DistributedDatabaseTransferType type,
                  DistributedDatabaseKey key,
                  DistributedDatabaseValue value,
                  long timeout)
           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()