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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect(URI serverUri, NetworkSettings networkSettings, HttpClient httpClient) Creates aConnectionfor communication with the ACME server.createChallenge(Login login, JSON data) Creates aChallengeinstance for the given challenge data.protected HttpConnectorcreateHttpConnector(NetworkSettings settings, HttpClient httpClient) Returns the provider's directory.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.shredzone.acme4j.provider.AcmeProvider
accepts, createHttpClient, getProposedEabMacAlgorithm, resolve
-
Constructor Details
-
AbstractAcmeProvider
public AbstractAcmeProvider()
-
-
Method Details
-
connect
Description copied from interface:AcmeProviderCreates aConnectionfor communication with the ACME server.- Specified by:
connectin interfaceAcmeProvider- Parameters:
serverUri- ServerURInetworkSettings-NetworkSettingsto be used for the connectionhttpClient-HttpClientto be used for HTTP requests- Returns:
Connectionthat was generated
-
directory
Description copied from interface:AcmeProviderReturns 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:
directoryin interfaceAcmeProvider- Parameters:
session-Sessionto be usedserverUri- ServerURI- Returns:
- Directory data, as JSON object, or
nullif the directory has not been changed since the last request. - Throws:
AcmeException
-
createChallenge
Creates aChallengeinstance for the given challenge data.This implementation handles the standard challenge types. For unknown types, generic
ChallengeorTokenChallengeinstances are created.Custom provider implementations may override this method to provide challenges that are proprietary to the provider.
- Specified by:
createChallengein interfaceAcmeProvider- Parameters:
login-Loginto bind the challenge todata- ChallengeJSONdata- Returns:
Challengeinstance, ornullif this provider is unable to generate a matchingChallengeinstance.
-
createHttpConnector
Creates aHttpConnectorwith the givenNetworkSettingsandHttpClient.Subclasses may override this method to configure the
HttpConnector.- Parameters:
settings- The network settings to usehttpClient- The HTTP client to use- Returns:
- A new
HttpConnectorinstance - Since:
- 4.0.0
-