mirror of https://github.com/shred/acme4j
Review status documentation
parent
0f3678fcde
commit
44a036a858
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue