Interface AcmeProvider

All Known Implementing Classes:
AbstractAcmeProvider, GenericAcmeProvider

public interface AcmeProvider
An AcmeProvider provides methods to be used for communicating with the ACME server. Implementations handle individual features of each ACME server.

Provider implementations must be registered with Java's ServiceLoader.

  • Method Summary

    Modifier and Type Method Description
    boolean accepts​(java.net.URI serverUri)
    Checks if this provider accepts the given server URI.
    Connection connect​(java.net.URI serverUri)
    Creates a Connection for communication with the ACME server.
    Challenge createChallenge​(Login login, JSON data)
    Creates a Challenge instance for the given challenge data.
    JSON directory​(Session session, java.net.URI serverUri)
    Returns the provider's directory.
    java.net.URL resolve​(java.net.URI serverUri)
    Resolves the server URI and returns the matching directory URL.
  • Method Details

    • accepts

      boolean accepts​(java.net.URI serverUri)
      Checks if this provider accepts the given server URI.
      Parameters:
      serverUri - Server URI to test
      Returns:
      true if this provider accepts the server URI, false otherwise
    • resolve

      java.net.URL resolve​(java.net.URI serverUri)
      Resolves the server URI and returns the matching directory URL.
      Parameters:
      serverUri - Server URI
      Returns:
      Resolved directory URL
      Throws:
      java.lang.IllegalArgumentException - if the server URI is not accepted
    • connect

      Connection connect​(java.net.URI serverUri)
      Creates a Connection for communication with the ACME server.
      Parameters:
      serverUri - Server URI
      Returns:
      Connection that was generated
    • directory

      @Nullable JSON directory​(Session session, java.net.URI serverUri) throws AcmeException
      Returns the provider's directory. The structure must contain resource URLs, and may optionally contain metadata.

      The default implementation resolves the server URI and fetches the directory via HTTP request. Subclasses may override this method, e.g. if the directory is static.

      Parameters:
      session - Session to be used
      serverUri - Server URI
      Returns:
      Directory data, as JSON object, or null if the directory has not been changed since the last request.
      Throws:
      AcmeException
    • createChallenge

      @Nullable Challenge createChallenge​(Login login, JSON data)
      Creates a Challenge instance for the given challenge data.
      Parameters:
      login - Login to bind the challenge to
      data - Challenge JSON data
      Returns:
      Challenge instance, or null if this provider is unable to generate a matching Challenge instance.