Deprecate update() and AcmeRetryAfterException

This commit is contained in:
Richard Körber
2024-08-18 11:42:50 +02:00
parent 05d826d83e
commit 171ee474c0
3 changed files with 8 additions and 0 deletions

View File

@@ -123,7 +123,11 @@ public abstract class AcmeJsonResource extends AcmeResource {
* {@link AcmeRetryAfterException#getRetryAfter()}. Note that the status of
* the resource is updated even if this exception was thrown.
* @see #fetch()
* @deprecated Use {@link #fetch()} instead. It returns the retry-after value as
* {@link Optional} instead of throwing an {@link AcmeRetryAfterException}. This
* method will be removed in a future version.
*/
@Deprecated
public void update() throws AcmeException {
var retryAfter = fetch();
if (retryAfter.isPresent()) {

View File

@@ -25,7 +25,10 @@ import org.shredzone.acme4j.AcmeJsonResource;
* Note: Prefer to use {@link AcmeJsonResource#fetch()}. Invoking
* {@link AcmeJsonResource#update()} and catching this exception is unnecessary
* complicated and a legacy from acme4j v2 which will disappear in a future release.
*
* @deprecated Will be removed in a future version.
*/
@Deprecated
public class AcmeRetryAfterException extends AcmeException {
private static final long serialVersionUID = 4461979121063649905L;