- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.shredzone.acme4j.exception.AcmeException
-
- org.shredzone.acme4j.exception.AcmeServerException
-
- org.shredzone.acme4j.exception.AcmeRateLimitedException
-
- All Implemented Interfaces:
Serializable
public class AcmeRateLimitedException extends AcmeServerException
A rate limit was exceeded. If provided by the server, it also includes the earliest time at which a new attempt will be accepted, and a reference to a document that further explains the rate limit that was exceeded.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AcmeRateLimitedException(Problem problem, Instant retryAfter, Collection<URL> documents)
Creates a newAcmeRateLimitedException
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<URL>
getDocuments()
Collection of URLs pointing to documents about the rate limit that was hit.Optional<Instant>
getRetryAfter()
Returns the instant of time the request is expected to succeed again.-
Methods inherited from class org.shredzone.acme4j.exception.AcmeServerException
getProblem, getType
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
AcmeRateLimitedException
public AcmeRateLimitedException(Problem problem, @Nullable Instant retryAfter, @Nullable Collection<URL> documents)
Creates a newAcmeRateLimitedException
.- Parameters:
problem
-Problem
that caused the exceptionretryAfter
- The instant of time that the request is expected to succeed again, may benull
if not knowndocuments
- URLs pointing to documents about the rate limit that was hit, may benull
if not known
-
-
Method Detail
-
getRetryAfter
public Optional<Instant> getRetryAfter()
Returns the instant of time the request is expected to succeed again. Empty if this moment is not known.
-
getDocuments
public Collection<URL> getDocuments()
Collection of URLs pointing to documents about the rate limit that was hit. Empty if the server did not provide such URLs.
-
-