Class DHTRouterContactImpl
java.lang.Object
com.biglybt.core.dht.router.impl.DHTRouterContactImpl
- All Implemented Interfaces:
DHTRouterContact
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DHTRouterContactAttachmentprivate intprivate longprivate longprivate booleanprivate booleanprivate longprivate final byte[]private boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDHTRouterContactImpl(byte[] _node_id, DHTRouterContactAttachment _attachment, boolean _known_to_be_alive) -
Method Summary
Modifier and TypeMethodDescriptionprotected intprotected longprotected longprotected longbyte[]getID()protected longprotected longprotected booleanprotected voidlongtime between first establishing the contact was alive and now, assuming that its not failing.booleanindicates whether or not a message has been received from, or an operation has successfully been made to, the contact.protected booleanbooleanisAlive()Whether or not the contact's last interaction was successfulbooleanReturns whether this router contact is in a bucket.booleanWhether or not the contact has failed once or more since last alive (if ever)booleanReturns whether this router contact is a replacement.voidsetAlive()protected voidsetAttachment(DHTRouterContactAttachment _attachment) voidprotected booleanprotected voidsetLastAddedTime(long l) protected voidsetPingOutstanding(boolean b) void
-
Field Details
-
node_id
private final byte[] node_id -
attachment
-
has_been_alive
private boolean has_been_alive -
ping_outstanding
private boolean ping_outstanding -
fail_count
private int fail_count -
first_alive_time
private long first_alive_time -
first_fail_or_last_alive_time
private long first_fail_or_last_alive_time -
last_added_time
private long last_added_time -
is_bucket_entry
private boolean is_bucket_entry
-
-
Constructor Details
-
DHTRouterContactImpl
protected DHTRouterContactImpl(byte[] _node_id, DHTRouterContactAttachment _attachment, boolean _known_to_be_alive)
-
-
Method Details
-
getID
public byte[] getID()- Specified by:
getIDin interfaceDHTRouterContact
-
getAttachment
- Specified by:
getAttachmentin interfaceDHTRouterContact
-
setAttachment
-
setAlive
public void setAlive() -
hasBeenAlive
public boolean hasBeenAlive()Description copied from interface:DHTRouterContactindicates whether or not a message has been received from, or an operation has successfully been made to, the contact.- Specified by:
hasBeenAlivein interfaceDHTRouterContact- Returns:
-
isAlive
public boolean isAlive()Description copied from interface:DHTRouterContactWhether or not the contact's last interaction was successful- Specified by:
isAlivein interfaceDHTRouterContact- Returns:
-
isFailing
public boolean isFailing()Description copied from interface:DHTRouterContactWhether or not the contact has failed once or more since last alive (if ever)- Specified by:
isFailingin interfaceDHTRouterContact- Returns:
-
getFailCount
protected int getFailCount() -
getTimeAlive
public long getTimeAlive()Description copied from interface:DHTRouterContacttime between first establishing the contact was alive and now, assuming that its not failing. 0 -> failing- Specified by:
getTimeAlivein interfaceDHTRouterContact- Returns:
-
setFailed
protected boolean setFailed() -
hasFailed
protected boolean hasFailed() -
getFirstFailTime
protected long getFirstFailTime() -
getLastAliveTime
protected long getLastAliveTime() -
getFirstFailOrLastAliveTime
protected long getFirstFailOrLastAliveTime() -
getFirstAliveTime
protected long getFirstAliveTime() -
getLastAddedTime
protected long getLastAddedTime() -
setLastAddedTime
protected void setLastAddedTime(long l) -
setPingOutstanding
protected void setPingOutstanding(boolean b) -
getPingOutstanding
protected boolean getPingOutstanding() -
getString
- Specified by:
getStringin interfaceDHTRouterContact
-
getString
-
isBucketEntry
public boolean isBucketEntry()Description copied from interface:DHTRouterContactReturns whether this router contact is in a bucket.- Specified by:
isBucketEntryin interfaceDHTRouterContact- Returns:
trueif in a bucket,falseotherwise
-
setBucketEntry
public void setBucketEntry() -
isReplacement
public boolean isReplacement()Description copied from interface:DHTRouterContactReturns whether this router contact is a replacement.- Specified by:
isReplacementin interfaceDHTRouterContact- Returns:
trueif a replacement,falseotherwise
-
setReplacement
public void setReplacement()
-