public class Authorization extends AcmeResource
Modifier | Constructor and Description |
---|---|
protected |
Authorization(Session session,
URL location) |
Modifier and Type | Method and Description |
---|---|
static Authorization |
bind(Session session,
URL location)
Creates a new instance of
Authorization and binds it to the
Session . |
void |
deactivate()
Permanently deactivates the
Authorization . |
<T extends Challenge> |
findChallenge(String type)
Finds a single
Challenge of the given type. |
Collection<Challenge> |
findCombination(String... types)
Finds a combination of
Challenge types that the client supports. |
List<Challenge> |
getChallenges()
Gets a list of all challenges offered by the server.
|
List<List<Challenge>> |
getCombinations()
Gets all combinations of challenges supported by the server.
|
String |
getDomain()
Gets the domain name to be authorized.
|
Instant |
getExpires()
Gets the expiry date of the authorization, if set by the server.
|
Status |
getStatus()
Gets the authorization status.
|
protected void |
load()
Lazily updates the object's state when one of the getters is invoked.
|
protected void |
unmarshalAuthorization(JSON json)
Sets the properties according to the given JSON data.
|
void |
update()
Updates the
Authorization . |
getLocation, getSession, rebind, setLocation, setSession
protected Authorization(Session session, URL location)
public static Authorization bind(Session session, URL location)
Authorization
and binds it to the
Session
.session
- Session
to be usedlocation
- Location of the AuthorizationAuthorization
bound to the session and locationpublic Instant getExpires()
public List<Challenge> getChallenges()
public List<List<Challenge>> getCombinations()
public <T extends Challenge> T findChallenge(String type)
Challenge
of the given type. Responding to this
Challenge
is sufficient for authorization. This is a convenience call to
findCombination(String...)
.type
- Challenge name (e.g. "http-01")Challenge
matching that name, or null
if there is no such
challenge, or if the challenge alone is not sufficient for authorization.ClassCastException
- if the type does not match the expected Challenge class typepublic Collection<Challenge> findCombination(String... types)
Challenge
types that the client supports. The client
has to respond to all of the Challenge
s returned. However, this
method attempts to find the combination with the smallest number of
Challenge
s.types
- Challenge name or names (e.g. "http-01"), in no particular order.
Basically this is a collection of all challenge types supported by your
implementation.Challenge
combination, or an empty collection if the ACME
server does not support any of your challenges. The challenges are returned
in no particular order. The result may be a subset of the types you have
provided, if fewer challenges are actually required for a successful
validation.public void update() throws AcmeException
Authorization
. After invocation, the Authorization
reflects the current state at the ACME server.AcmeRetryAfterException
- the auhtorization is still being validated, and the server returned an
estimated date when the validation will be completed. If you are
polling for the authorization to complete, you should wait for the date
given in AcmeRetryAfterException.getRetryAfter()
. Note that the
authorization status is updated even if this exception was thrown.AcmeException
public void deactivate() throws AcmeException
Authorization
.AcmeException
protected void load()
protected void unmarshalAuthorization(JSON json)
json
- JSON dataCopyright © 2015–2019. All rights reserved.