All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.shredzone.acme4j.challenge.Challenge Maven / Gradle / Ivy

/*
 * acme4j - Java ACME client
 *
 * Copyright (C) 2015 Richard "Shred" Körber
 *   http://acme4j.shredzone.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */
package org.shredzone.acme4j.challenge;

import java.io.Serializable;
import java.net.URI;
import java.util.Date;
import java.util.Map;

import org.shredzone.acme4j.Status;
import org.shredzone.acme4j.util.ClaimBuilder;

/**
 * A challenge.
 *
 * @author Richard "Shred" Körber
 */
public interface Challenge extends Serializable {

    /**
     * Returns the challenge type by name (e.g. "http-01").
     */
    String getType();

    /**
     * Returns the location {@link URI} of the challenge.
     */
    URI getLocation();

    /**
     * Returns the current status of the challenge.
     */
    Status getStatus();

    /**
     * Returns the validation date, if returned by the server.
     */
    Date getValidated();

    /**
     * Sets the challenge state by reading the given JSON map.
     *
     * @param map
     *            JSON map containing the challenge data
     */
    void unmarshall(Map map);

    /**
     * Exports the response state, as preparation for triggering the challenge.
     *
     * @param cb
     *            {@link ClaimBuilder} to copy the response to
     */
    void respond(ClaimBuilder cb);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy