Package com.biglybt.core.dht.router
Class DHTRouterContactWrapper
- java.lang.Object
-
- com.biglybt.core.dht.router.DHTRouterContactWrapper
-
- All Implemented Interfaces:
DHTRouterContact
public class DHTRouterContactWrapper extends java.lang.Object implements DHTRouterContact
-
-
Field Summary
Fields Modifier and Type Field Description private DHTRouterContact
delegate
-
Constructor Summary
Constructors Constructor Description DHTRouterContactWrapper(DHTRouterContact _contact)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DHTRouterContactAttachment
getAttachment()
protected DHTRouterContact
getDelegate()
byte[]
getID()
java.lang.String
getString()
long
getTimeAlive()
time between first establishing the contact was alive and now, assuming that its not failing.boolean
hasBeenAlive()
indicates whether or not a message has been received from, or an operation has successfully been made to, the contact.boolean
isAlive()
Whether or not the contact's last interaction was successfulboolean
isBucketEntry()
Returns whether this router contact is in a bucket.boolean
isFailing()
Whether or not the contact has failed once or more since last alive (if ever)boolean
isReplacement()
Returns whether this router contact is a replacement.
-
-
-
Field Detail
-
delegate
private final DHTRouterContact delegate
-
-
Constructor Detail
-
DHTRouterContactWrapper
public DHTRouterContactWrapper(DHTRouterContact _contact)
-
-
Method Detail
-
getDelegate
protected DHTRouterContact getDelegate()
-
getID
public byte[] getID()
- Specified by:
getID
in interfaceDHTRouterContact
-
getAttachment
public DHTRouterContactAttachment getAttachment()
- Specified by:
getAttachment
in interfaceDHTRouterContact
-
hasBeenAlive
public boolean hasBeenAlive()
Description copied from interface:DHTRouterContact
indicates whether or not a message has been received from, or an operation has successfully been made to, the contact.- Specified by:
hasBeenAlive
in interfaceDHTRouterContact
- Returns:
-
isFailing
public boolean isFailing()
Description copied from interface:DHTRouterContact
Whether or not the contact has failed once or more since last alive (if ever)- Specified by:
isFailing
in interfaceDHTRouterContact
- Returns:
-
isAlive
public boolean isAlive()
Description copied from interface:DHTRouterContact
Whether or not the contact's last interaction was successful- Specified by:
isAlive
in interfaceDHTRouterContact
- Returns:
-
getTimeAlive
public long getTimeAlive()
Description copied from interface:DHTRouterContact
time between first establishing the contact was alive and now, assuming that its not failing. 0 -> failing- Specified by:
getTimeAlive
in interfaceDHTRouterContact
- Returns:
-
getString
public java.lang.String getString()
- Specified by:
getString
in interfaceDHTRouterContact
-
isBucketEntry
public boolean isBucketEntry()
Description copied from interface:DHTRouterContact
Returns whether this router contact is in a bucket.- Specified by:
isBucketEntry
in interfaceDHTRouterContact
- Returns:
true
if in a bucket,false
otherwise
-
isReplacement
public boolean isReplacement()
Description copied from interface:DHTRouterContact
Returns whether this router contact is a replacement.- Specified by:
isReplacement
in interfaceDHTRouterContact
- Returns:
true
if a replacement,false
otherwise
-
-