Class TimeLimitedBase

    • Field Detail

      • renewable

        public boolean renewable
      • leaseDurationSecs

        public long leaseDurationSecs
    • Constructor Detail

      • TimeLimitedBase

        public TimeLimitedBase​(boolean renewable,
                               long leaseDurationSecs)
    • Method Detail

      • isExpired

        public boolean isExpired()
      • shouldExtend

        public boolean shouldExtend​(Duration gracePeriod)
      • getExpireInstant

        public Instant getExpireInstant()
      • getExpiredDate

        public Date getExpiredDate()
      • expiresSoon

        public boolean expiresSoon​(Duration gracePeriod)
        true if the lease is smaller than the grace period. as long as we are far away fro the ttl, lease durations will be a constant value (e.g. 3600 secs). if we are less than 'lease duration' away from ttl, lease durations will start to reduce to not go over the ttl.
        Parameters:
        gracePeriod -
        Returns:
      • leaseDurationSanityCheck

        public void leaseDurationSanityCheck​(String nickname,
                                             Duration gracePeriod)