Class DHTRouterContactImpl

    • Field Detail

      • node_id

        private final byte[] node_id
      • 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 Detail

      • DHTRouterContactImpl

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

      • 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

        protected void getString​(java.lang.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()