java.lang.Object
org.shredzone.acme4j.provider.AbstractAcmeProvider
- All Implemented Interfaces:
AcmeProvider
- Direct Known Subclasses:
GenericAcmeProvider
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionconnect
(URI serverUri, NetworkSettings networkSettings) Creates aConnection
for communication with the ACME server.createChallenge
(Login login, JSON data) Creates aChallenge
instance for the given challenge data.protected HttpConnector
createHttpConnector
(NetworkSettings settings) Creates aHttpConnector
.Returns the provider's directory.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.shredzone.acme4j.provider.AcmeProvider
accepts, resolve
-
Constructor Details
-
AbstractAcmeProvider
public AbstractAcmeProvider()
-
-
Method Details
-
connect
Description copied from interface:AcmeProvider
Creates aConnection
for communication with the ACME server.- Specified by:
connect
in interfaceAcmeProvider
- Parameters:
serverUri
- ServerURI
networkSettings
-NetworkSettings
to be used for the connection- Returns:
Connection
that was generated
-
directory
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 interfaceAcmeProvider
- Parameters:
session
-Session
to be usedserverUri
- ServerURI
- Returns:
- Directory data, as JSON object, or
null
if the directory has not been changed since the last request. - Throws:
AcmeException
-
createChallenge
Creates aChallenge
instance for the given challenge data.This implementation handles the standard challenge types. For unknown types, generic
Challenge
orTokenChallenge
instances are created.Custom provider implementations may override this method to provide challenges that are proprietary to the provider.
- Specified by:
createChallenge
in interfaceAcmeProvider
- Parameters:
login
-Login
to bind the challenge todata
- ChallengeJSON
data- Returns:
Challenge
instance, ornull
if this provider is unable to generate a matchingChallenge
instance.
-
createHttpConnector
Creates aHttpConnector
.Subclasses may override this method to configure the
HttpConnector
.
-