java.lang.Object
org.shredzone.acme4j.AcmeResource
org.shredzone.acme4j.AcmeJsonResource
- Alle implementierten Schnittstellen:
Serializable
- Bekannte direkte Unterklassen:
Account
,Authorization
,Challenge
,Order
,RenewalInfo
An extension of
AcmeResource
that also contains the current state of a resource
as JSON document. If the current state is not present, this class takes care of
fetching it from the server if necessary.- Siehe auch:
-
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotected
AcmeJsonResource
(Login login, URL location) Create a newAcmeJsonResource
. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungfetch()
Updates this resource, by fetching the current resource data from the server.getJSON()
Returns the JSON representation of the resource data.Gets an estimation when the resource status will change.protected void
Invalidates the state of this resource.protected boolean
isValid()
Checks if this resource is valid.protected void
Sets the JSON representation of the resource data.protected void
setRetryAfter
(Instant retryAfter) Sets a Retry-After instant.void
update()
Veraltet.Von Klasse geerbte Methoden org.shredzone.acme4j.AcmeResource
finalize, getLocation, getLogin, getSession, rebind
-
Konstruktordetails
-
AcmeJsonResource
Create a newAcmeJsonResource
.
-
-
Methodendetails
-
getJSON
Returns the JSON representation of the resource data.If there is no data,
update()
is invoked to fetch it from the server.This method can be used to read proprietary data from the resources.
- Gibt zurück:
- Resource data, as
JSON
. - Löst aus:
AcmeLazyLoadingException
- if anAcmeException
occured while fetching the current state from the server.
-
setJSON
Sets the JSON representation of the resource data.- Parameter:
data
- NewJSON
data, must not benull
.
-
isValid
Checks if this resource is valid. -
invalidate
-
update
Veraltet.Usefetch()
instead. It returns the retry-after value asOptional
instead of throwing anAcmeRetryAfterException
. This method will be removed in a future version.Updates this resource, by fetching the current resource data from the server.Note: Prefer to use
fetch()
instead. It is working the same way, but returns the Retry-After instant instead of throwing an exception. This method will become deprecated in a future release.- Löst aus:
AcmeException
- if the resource could not be fetched.AcmeRetryAfterException
- the resource is still being processed, and the server returned an estimated date when the process will be completed. If you are polling for the resource to complete, you should wait for the date given inAcmeRetryAfterException.getRetryAfter()
. Note that the status of the resource is updated even if this exception was thrown.- Siehe auch:
-
fetch
Updates this resource, by fetching the current resource data from the server.- Gibt zurück:
- An
Optional
estimation when the resource status will change. If you are polling for the resource to complete, you should wait for the given instant before trying again. Empty if the server did not return a "Retry-After" header. - Löst aus:
AcmeException
- if the resource could not be fetched.- Seit:
- 3.2.0
- Siehe auch:
-
setRetryAfter
Sets a Retry-After instant.- Seit:
- 3.2.0
-
getRetryAfter
Gets an estimation when the resource status will change. If you are polling for the resource to complete, you should wait for the given instant before trying a status refresh.This instant was sent with the Retry-After header at the last update.
- Gibt zurück:
- Retry-after
Instant
, or empty if there was no such header. - Seit:
- 3.2.0
-
fetch()
instead.