- Alle implementierten Schnittstellen:
Serializable
,PollableResource
- Bekannte direkte Unterklassen:
TokenChallenge
Subclasses must override acceptable(String)
so it only accepts its
own type. prepareResponse(JSONBuilder)
can be overridden to put all
required data to the challenge response.
- Siehe auch:
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
Von Schnittstelle geerbte Felder org.shredzone.acme4j.PollableResource
DEFAULT_RETRY_AFTER
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected boolean
acceptable
(String type) Checks if the type is acceptable to this challenge.getError()
Returns a reason why the challenge has failed in the past, if returned by the server.Returns the current status of the challenge.getType()
Returns the challenge type by name (e.g.Returns the validation date, if returned by the server.protected void
prepareResponse
(JSONBuilder response) Prepares the response message for triggering the challenge.protected void
Sets the JSON representation of the resource data.void
trigger()
Triggers thisChallenge
.waitForCompletion
(Duration timeout) Waits until the challenge is completed.Von Klasse geerbte Methoden org.shredzone.acme4j.AcmeJsonResource
fetch, getJSON, getRetryAfter, invalidate, isValid, setRetryAfter, update
Von Klasse geerbte Methoden org.shredzone.acme4j.AcmeResource
finalize, getLocation, getLogin, getSession, rebind
Von Klasse geerbte Methoden java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Von Schnittstelle geerbte Methoden org.shredzone.acme4j.PollableResource
fetch, waitForStatus
-
Felddetails
-
KEY_TYPE
- Siehe auch:
-
KEY_URL
- Siehe auch:
-
KEY_STATUS
- Siehe auch:
-
KEY_VALIDATED
- Siehe auch:
-
KEY_ERROR
- Siehe auch:
-
-
Konstruktordetails
-
Methodendetails
-
getType
Returns the challenge type by name (e.g. "http-01"). -
getStatus
Returns the current status of the challenge.Possible values are:
Status.PENDING
,Status.PROCESSING
,Status.VALID
,Status.INVALID
.A challenge is only completed when it reaches either status
Status.VALID
orStatus.INVALID
.- Angegeben von:
getStatus
in SchnittstellePollableResource
-
getValidated
Returns the validation date, if returned by the server. -
getError
Returns a reason why the challenge has failed in the past, if returned by the server. If there are multiple errors, they can be found inProblem.getSubProblems()
. -
prepareResponse
Prepares the response message for triggering the challenge. Subclasses can add fields to theJSONBuilder
as required by the challenge. Implementations of subclasses should make sure thatprepareResponse(JSONBuilder)
of the superclass is invoked.- Parameter:
response
-JSONBuilder
to write the response to
-
acceptable
Checks if the type is acceptable to this challenge. This generic class only checks if the type is not blank. Subclasses should instead check if the given type matches expected challenge type.- Parameter:
type
- Type to check- Gibt zurück:
true
if acceptable,false
if not
-
setJSON
Beschreibung aus Klasse kopiert:AcmeJsonResource
Sets the JSON representation of the resource data.- Setzt außer Kraft:
setJSON
in KlasseAcmeJsonResource
- Parameter:
json
- NewJSON
data, must not benull
.
-
trigger
Triggers thisChallenge
. The ACME server is requested to validate the response. Note that the validation is performed asynchronously by the ACME server.After a challenge is triggered, it changes to
Status.PENDING
. As soon as validation takes place, it changes toStatus.PROCESSING
. After validation the status changes toStatus.VALID
orStatus.INVALID
, depending on the outcome of the validation.If the challenge requires a resource to be set on your side (e.g. a DNS record or an HTTP file), it must be reachable from public before
trigger()
is invoked, and must not be taken down until the challenge has reachedStatus.VALID
orStatus.INVALID
.If this method is invoked a second time, the ACME server is requested to retry the validation. This can be useful if the client state has changed, for example after a firewall rule has been updated.
- Löst aus:
AcmeException
- Siehe auch:
-
waitForCompletion
Waits until the challenge is completed.Is is completed if it reaches either
Status.VALID
orStatus.INVALID
.This method is synchronous and blocks the current thread.
- Parameter:
timeout
- Timeout until a terminal status must have been reached- Gibt zurück:
- Status that was reached
- Löst aus:
AcmeException
InterruptedException
- Seit:
- 3.4.0
-