Class AbstractAcmeProvider

java.lang.Object
org.shredzone.acme4j.provider.AbstractAcmeProvider
All Implemented Interfaces:
AcmeProvider
Direct Known Subclasses:
GenericAcmeProvider

public abstract class AbstractAcmeProvider
extends java.lang.Object
implements AcmeProvider
Abstract implementation of AcmeProvider. It consists of a challenge registry and a standard HttpConnector.

Implementing classes must implement at least AcmeProvider.accepts(URI) and AcmeProvider.resolve(URI).

  • Constructor Details

  • Method Details

    • connect

      public Connection connect​(java.net.URI serverUri)
      Description copied from interface: AcmeProvider
      Creates a Connection for communication with the ACME server.
      Specified by:
      connect in interface AcmeProvider
      Parameters:
      serverUri - Server URI
      Returns:
      Connection that was generated
    • directory

      public JSON directory​(Session session, java.net.URI serverUri) throws AcmeException
      Description copied from interface: AcmeProvider
      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.

      Specified by:
      directory in interface AcmeProvider
      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

      public Challenge createChallenge​(Login login, JSON data)
      Creates a Challenge instance for the given challenge data.

      This implementation handles the standard challenge types. For unknown types, generic Challenge or TokenChallenge instances are created.

      Custom provider implementations may override this method to provide challenges that are unique to the provider.

      Specified by:
      createChallenge in interface AcmeProvider
      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.
    • createHttpConnector

      Creates a HttpConnector.

      Subclasses may override this method to configure the HttpConnector.