- All Implemented Interfaces:
Serializable
- Since:
- 3.0.0
- See Also:
- 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.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfetch()
Updates this resource, by fetching the current resource data from the server.An optionalURL
pointing to a page which may explain why the suggested renewal window is what it is.getRandomProposal
(TemporalAmount frequency) Returns a proposedInstant
when the certificate related to thisRenewalInfo
should be renewed.Returns the endingInstant
of the time window the CA recommends for certificate renewal.Returns the startingInstant
of the time window the CA recommends for certificate renewal.boolean
renewalIsNotRequired
(Instant instant) Checks if the givenInstant
is before the suggested time window, so a certificate renewal is not required yet.boolean
renewalIsOverdue
(Instant instant) Checks if the givenInstant
is past the time window, and a certificate renewal is overdue.boolean
renewalIsRecommended
(Instant instant) Checks if the givenInstant
is within the suggested time window, and a certificate renewal is recommended.Methods inherited from class org.shredzone.acme4j.AcmeJsonResource
getJSON, getRetryAfter, invalidate, isValid, setJSON, setRetryAfter, update
Methods inherited from class org.shredzone.acme4j.AcmeResource
getLocation, getLogin, getSession, rebind
-
Constructor Details
-
RenewalInfo
-
-
Method Details
-
getSuggestedWindowStart
Returns the startingInstant
of the time window the CA recommends for certificate renewal. -
getSuggestedWindowEnd
Returns the endingInstant
of the time window the CA recommends for certificate renewal. -
getExplanation
An optionalURL
pointing to a page which may explain why the suggested renewal window is what it is. -
renewalIsNotRequired
Checks if the givenInstant
is before the suggested time window, so a certificate renewal is not required yet. -
renewalIsRecommended
Checks if the givenInstant
is within the suggested time window, and a certificate renewal is recommended.An
Instant
is deemed to be within the time window if it is equal to, or aftergetSuggestedWindowStart()
, and beforegetSuggestedWindowEnd()
. -
renewalIsOverdue
Checks if the givenInstant
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 aftergetSuggestedWindowEnd()
. -
getRandomProposal
Returns a proposedInstant
when the certificate related to thisRenewalInfo
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 benull
if there is no cron job, and the renewal is going to be executed exactly at the givenInstant
.- 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.
-
fetch
Description copied from class:AcmeJsonResource
Updates this resource, by fetching the current resource data from the server.- Overrides:
fetch
in classAcmeJsonResource
- Returns:
- An
Optional
estimation 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.- See Also:
-