Package com.biglybt.pifimpl.local.ddb
Class DDBaseContactImpl
- java.lang.Object
-
- com.biglybt.pifimpl.local.ddb.DDBaseContactImpl
-
- All Implemented Interfaces:
DistributedDatabaseContact
public class DDBaseContactImpl extends java.lang.Object implements DistributedDatabaseContact
-
-
Field Summary
Fields Modifier and Type Field Description private DHTPluginContact
contact
private DDBaseImpl
ddb
-
Constructor Summary
Constructors Modifier Constructor Description protected
DDBaseContactImpl(DDBaseImpl _ddb, DHTPluginContact _contact)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
byte[]
getID()
java.lang.String
getName()
int
getNetwork()
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)
-
-
-
Field Detail
-
ddb
private DDBaseImpl ddb
-
contact
private DHTPluginContact contact
-
-
Constructor Detail
-
DDBaseContactImpl
protected DDBaseContactImpl(DDBaseImpl _ddb, DHTPluginContact _contact)
-
-
Method Detail
-
getID
public byte[] getID()
- Specified by:
getID
in interfaceDistributedDatabaseContact
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceDistributedDatabaseContact
-
getVersion
public int getVersion()
- Specified by:
getVersion
in interfaceDistributedDatabaseContact
-
getAddress
public java.net.InetSocketAddress getAddress()
- Specified by:
getAddress
in interfaceDistributedDatabaseContact
-
getNetwork
public int getNetwork()
- Specified by:
getNetwork
in interfaceDistributedDatabaseContact
-
isAlive
public boolean isAlive(long timeout)
- Specified by:
isAlive
in interfaceDistributedDatabaseContact
-
isAlive
public void isAlive(long timeout, DistributedDatabaseListener listener)
- Specified by:
isAlive
in interfaceDistributedDatabaseContact
-
isOrHasBeenLocal
public boolean isOrHasBeenLocal()
- Specified by:
isOrHasBeenLocal
in interfaceDistributedDatabaseContact
-
exportToMap
public java.util.Map<java.lang.String,java.lang.Object> exportToMap()
- Specified by:
exportToMap
in interfaceDistributedDatabaseContact
-
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 interfaceDistributedDatabaseContact
- Returns:
-
call
public DistributedDatabaseValue call(DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseValue data, long timeout) throws DistributedDatabaseException
- Specified by:
call
in interfaceDistributedDatabaseContact
- Throws:
DistributedDatabaseException
-
write
public void write(DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseKey key, DistributedDatabaseValue value, long timeout) throws DistributedDatabaseException
- Specified by:
write
in interfaceDistributedDatabaseContact
- Throws:
DistributedDatabaseException
-
read
public DistributedDatabaseValue read(DistributedDatabaseProgressListener listener, DistributedDatabaseTransferType type, DistributedDatabaseKey key, long timeout) throws DistributedDatabaseException
- Specified by:
read
in interfaceDistributedDatabaseContact
- Throws:
DistributedDatabaseException
-
getContact
protected DHTPluginContact getContact()
-
-