- All Implemented Interfaces:
Serializable
- Since:
- 3.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfetch()Updates this resource, by fetching the current resource data from the server.An optionalURLpointing to a page which may explain why the suggested renewal window is what it is.getRandomProposal(TemporalAmount frequency) Returns a proposedInstantwhen the certificate related to thisRenewalInfoshould be renewed.Returns the endingInstantof the time window the CA recommends for certificate renewal.Returns the startingInstantof the time window the CA recommends for certificate renewal.booleanrenewalIsNotRequired(Instant instant) Checks if the givenInstantis before the suggested time window, so a certificate renewal is not required yet.booleanrenewalIsOverdue(Instant instant) Checks if the givenInstantis past the time window, and a certificate renewal is overdue.booleanrenewalIsRecommended(Instant instant) Checks if the givenInstantis within the suggested time window, and a certificate renewal is recommended.Methods inherited from class org.shredzone.acme4j.AcmeJsonResource
getJSON, getRetryAfter, invalidate, isValid, setJSON, setRetryAfterMethods inherited from class org.shredzone.acme4j.AcmeResource
finalize, getLocation, getLogin, getSession, rebind
-
Constructor Details
-
RenewalInfo
-
-
Method Details
-
getSuggestedWindowStart
Returns the startingInstantof the time window the CA recommends for certificate renewal. -
getSuggestedWindowEnd
Returns the endingInstantof the time window the CA recommends for certificate renewal. -
getExplanation
An optionalURLpointing to a page which may explain why the suggested renewal window is what it is. -
renewalIsNotRequired
Checks if the givenInstantis before the suggested time window, so a certificate renewal is not required yet. -
renewalIsRecommended
Checks if the givenInstantis within the suggested time window, and a certificate renewal is recommended.An
Instantis deemed to be within the time window if it is equal to, or aftergetSuggestedWindowStart(), and beforegetSuggestedWindowEnd(). -
renewalIsOverdue
Checks if the givenInstantis past the time window, and a certificate renewal is overdue.An
Instantis deemed to be past the time window if it is equal to, or aftergetSuggestedWindowEnd(). -
getRandomProposal
Returns a proposedInstantwhen the certificate related to thisRenewalInfoshould 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
Instantis guaranteed to be executed in time, considering the cron job intervals.This method uses
ThreadLocalRandomfor random numbers. It is sufficient for most cases, as only an "earliest"Instantis 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 benullif there is no cron job, and the renewal is going to be executed exactly at the givenInstant.- Returns:
- Random
Instantwhen 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.
-
fetch
Description copied from class:AcmeJsonResourceUpdates this resource, by fetching the current resource data from the server.- Overrides:
fetchin classAcmeJsonResource- Returns:
- An
Optionalestimation when the resource status will change. If you are polling for the resource to complete, you should wait for the given instant before trying again. Empty if the server did not return a "Retry-After" header. - Throws:
AcmeException- if the resource could not be fetched.
-