Review status documentation

pull/61/head
Richard Körber 2018-03-10 15:22:23 +01:00
parent 0f3678fcde
commit 44a036a858
No known key found for this signature in database
GPG Key ID: AAB9FD19C78AA3E0
5 changed files with 60 additions and 2 deletions

View File

@ -80,6 +80,9 @@ public class Account extends AcmeJsonResource {
/**
* Returns the current status of the account.
* <p>
* Possible values are: {@link Status#VALID}, {@link Status#DEACTIVATED},
* {@link Status#REVOKED}.
*/
public Status getStatus() {
return getJSON().get(KEY_STATUS).asStatusOrElse(Status.UNKNOWN);

View File

@ -60,9 +60,12 @@ public class Authorization extends AcmeJsonResource {
/**
* Gets the authorization status.
* <p>
* Possible values are: {@link Status#PENDING}, {@link Status#VALID},
* {@link Status#INVALID}, {@link Status#DEACTIVATED}, {@link Status#REVOKED}.
*/
public Status getStatus() {
return getJSON().get("status").asStatusOrElse(Status.PENDING);
return getJSON().get("status").asStatusOrElse(Status.UNKNOWN);
}
/**

View File

@ -40,6 +40,9 @@ public class Order extends AcmeJsonResource {
/**
* Returns the current status of the order.
* <p>
* Possible values are: {@link Status#PENDING}, {@link Status#READY},
* {@link Status#PROCESSING}, {@link Status#VALID}, {@link Status#INVALID}.
*/
public Status getStatus() {
return getJSON().get("status").asStatusOrElse(Status.UNKNOWN);

View File

@ -20,7 +20,53 @@ import java.util.Arrays;
*/
public enum Status {
PENDING, PROCESSING, VALID, INVALID, REVOKED, DEACTIVATED, UNKNOWN;
/**
* The server has created the resource, and is waiting for the client to process it.
*/
PENDING,
/**
* The {@link Order} is ready to be finalized. Invoke {@link Order#execute(byte[])}.
*/
READY,
/**
* The server is processing the resource. The client should invoke
* {@link AcmeJsonResource#update()} and re-check the status.
*/
PROCESSING,
/**
* The resource is valid and can be used as intended.
*/
VALID,
/**
* An error or authorization/validation failure has occured. The client should check
* for error messages.
*/
INVALID,
/**
* The {@link Authorization} has been revoked by the server.
*/
REVOKED,
/**
* The {@link Account} or {@link Authorization} has been deactivated by the client.
*/
DEACTIVATED,
/**
* The {@link Authorization} is expired.
*/
EXPIRED,
/**
* The server did not provide a status, or the provided status is not a specified ACME
* status.
*/
UNKNOWN;
/**
* Parses the string and returns a corresponding Status object.

View File

@ -68,6 +68,9 @@ public class Challenge extends AcmeJsonResource {
/**
* Returns the current status of the challenge.
* <p>
* Possible values are: {@link Status#PENDING}, {@link Status#PROCESSING},
* {@link Status#VALID}, {@link Status#INVALID}.
*/
public Status getStatus() {
return getJSON().get(KEY_STATUS).asStatusOrElse(Status.UNKNOWN);