java.lang.Object
org.shredzone.acme4j.AcmeResource
org.shredzone.acme4j.AcmeJsonResource
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Account
,Authorization
,Challenge
,Order
An ACME resource that stores its state in a JSON structure.
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
AcmeJsonResource
(Login login, URL location) Create a newAcmeJsonResource
. -
Method Summary
Modifier and TypeMethodDescriptiongetJSON()
Returns the JSON representation of the resource data.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.void
update()
Updates this resource, by fetching the current resource data from the server.Methods inherited from class org.shredzone.acme4j.AcmeResource
getLocation, getLogin, getSession, rebind
-
Constructor Details
-
AcmeJsonResource
Create a newAcmeJsonResource
.
-
-
Method Details
-
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.
- Returns:
- Resource data, as
JSON
.
-
setJSON
Sets the JSON representation of the resource data.- Parameters:
data
- NewJSON
data, must not benull
.
-
isValid
Checks if this resource is valid. -
invalidate
-
update
Updates this resource, by fetching the current resource data from the server.- Throws:
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.
-