com.aelitis.azureus.core.dht.router.impl
Class DHTRouterContactImpl

java.lang.Object
  extended by com.aelitis.azureus.core.dht.router.impl.DHTRouterContactImpl
All Implemented Interfaces:
DHTRouterContact

public class DHTRouterContactImpl
extends Object
implements DHTRouterContact

Author:
parg

Constructor Summary
protected DHTRouterContactImpl(byte[] _node_id, DHTRouterContactAttachment _attachment, boolean _has_been_alive)
           
 
Method Summary
 DHTRouterContactAttachment getAttachment()
           
protected  int getFailCount()
           
protected  long getFirstAliveTime()
           
protected  long getFirstFailOrLastAliveTime()
           
protected  long getFirstFailTime()
           
 byte[] getID()
           
protected  long getLastAddedTime()
           
protected  long getLastAliveTime()
           
protected  boolean getPingOutstanding()
           
 String getString()
           
protected  void getString(StringBuilder sb)
           
 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.
protected  boolean hasFailed()
           
 boolean isAlive()
          Whether or not the contact's last interaction was successful
 boolean 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.
 void setAlive()
           
protected  void setAttachment(DHTRouterContactAttachment _attachment)
           
 void setBucketEntry()
           
protected  boolean setFailed()
           
protected  void setLastAddedTime(long l)
           
protected  void setPingOutstanding(boolean b)
           
 void setReplacement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DHTRouterContactImpl

protected DHTRouterContactImpl(byte[] _node_id,
                               DHTRouterContactAttachment _attachment,
                               boolean _has_been_alive)
Method Detail

getID

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

getAttachment

public DHTRouterContactAttachment getAttachment()
Specified by:
getAttachment in interface DHTRouterContact

setAttachment

protected void setAttachment(DHTRouterContactAttachment _attachment)

setAlive

public void setAlive()

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 interface DHTRouterContact
Returns:

isAlive

public boolean isAlive()
Description copied from interface: DHTRouterContact
Whether or not the contact's last interaction was successful

Specified by:
isAlive in interface DHTRouterContact
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 interface DHTRouterContact
Returns:

getFailCount

protected int getFailCount()

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 interface DHTRouterContact
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

public String getString()
Specified by:
getString in interface DHTRouterContact

getString

protected void getString(StringBuilder sb)

isBucketEntry

public boolean isBucketEntry()
Description copied from interface: DHTRouterContact
Returns whether this router contact is in a bucket.

Specified by:
isBucketEntry in interface DHTRouterContact
Returns:
true if in a bucket, false otherwise

setBucketEntry

public void setBucketEntry()

isReplacement

public boolean isReplacement()
Description copied from interface: DHTRouterContact
Returns whether this router contact is a replacement.

Specified by:
isReplacement in interface DHTRouterContact
Returns:
true if a replacement, false otherwise

setReplacement

public void setReplacement()