Interface PollableResource

All Known Implementing Classes:
Authorization, Challenge, Dns01Challenge, Http01Challenge, Order, TlsAlpn01Challenge, TokenChallenge

public interface PollableResource
Marks an ACME Resource with a pollable status.

The resource provides a status, and a method for updating the internal cache to read the current status from the server.

Since:
3.4.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Duration
    Default delay between status polls if there is no Retry-After header.
  • Method Summary

    Modifier and Type
    Method
    Description
    Fetches the current status from the server.
    Returns the current status of the resource.
    default Status
    waitForStatus(Set<Status> statusSet, Duration timeout)
    Waits until a terminal status has been reached, by polling until one of the given status or the given timeout has been reached.
  • Field Details

    • DEFAULT_RETRY_AFTER

      Default delay between status polls if there is no Retry-After header.
  • Method Details

    • getStatus

      Returns the current status of the resource.
    • fetch

      Fetches the current status from the server.
      Returns:
      Retry-After time, if given by the CA, otherwise empty.
      Throws:
      AcmeException
    • waitForStatus

      default Status waitForStatus(Set<Status> statusSet, Duration timeout) throws AcmeException, InterruptedException
      Waits until a terminal status has been reached, by polling until one of the given status or the given timeout has been reached. This call honors the Retry-After header if set by the CA.

      This method is synchronous and blocks the current thread.

      If the resource is already in a terminal status, the method returns immediately.

      Parameters:
      statusSet - Set of Status that are accepted as terminal
      timeout - Timeout until a terminal status must have been reached
      Returns:
      Status that was reached
      Throws:
      AcmeException
      InterruptedException