Class RenewalInfo

  • All Implemented Interfaces:
    Serializable

    public class RenewalInfo
    extends AcmeJsonResource
    Renewal Information of a certificate.
    Since:
    3.0.0
    See Also:
    Serialized Form
    Draft:
    This class is currently based on an RFC draft. It may be changed or removed without notice to reflect future changes to the draft. SemVer rules do not apply here.
    • Method Detail

      • getExplanation

        public Optional<URLgetExplanation()
        An optional URL pointing to a page which may explain why the suggested renewal window is what it is.
      • renewalIsNotRequired

        public boolean renewalIsNotRequired​(Instant instant)
        Checks if the given Instant is before the suggested time window, so a certificate renewal is not required yet.
        Parameters:
        instant - Instant to check
        Returns:
        true if the Instant is before the time window, false otherwise.
      • renewalIsOverdue

        public boolean renewalIsOverdue​(Instant instant)
        Checks if the given Instant is past the time window, and a certificate renewal is overdue.

        An Instant is deemed to be past the time window if it is equal to, or after getSuggestedWindowEnd().

        Parameters:
        instant - Instant to check
        Returns:
        true if the Instant is past the time window, false otherwise.
      • getRandomProposal

        public Optional<InstantgetRandomProposal​(@Nullable
                                                   TemporalAmount frequency)
        Returns a proposed Instant when the certificate related to this RenewalInfo should be renewed.

        This method is useful for setting alarms for renewal cron jobs. As a parameter, the frequency of the cron job is set. The resulting Instant is guaranteed to be executed in time, considering the cron job intervals.

        This method uses ThreadLocalRandom for random numbers. It is sufficient for most cases, as only an "earliest" Instant is returned, but the actual renewal process also depends on cron job execution times and other factors like system load.

        The result is empty if it is impossible to renew the certificate in time, under the given circumstances. This is either because the time window already ended in the past, or because the cron job would not be executed before the ending of the time window. In this case, it is recommended to renew the certificate immediately.

        Parameters:
        frequency - Frequency of the cron job executing the certificate renewals. May be null if there is no cron job, and the renewal is going to be executed exactly at the given Instant.
        Returns:
        Random Instant when the certificate should be renewed. This instant might be slightly in the past. In this case, start the renewal process at the next possible regular moment.