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

de.escalon.hypermedia.affordance.ActionDescriptor Maven / Gradle / Ivy

There is a newer version: 0.4.2
Show newest version
package de.escalon.hypermedia.affordance;

import de.escalon.hypermedia.action.Cardinality;

import java.util.Collection;
import java.util.Map;

/**
 * Represents a descriptor for a http method execution. Created by Dietrich on 17.05.2015.
 */
public interface ActionDescriptor {

    /**
     * Gets action name. Could be used as form name.
     *
     * @return name
     */
    String getActionName();

    /**
     * Gets method on uniform interface.
     *
     * @return method
     */
    String getHttpMethod();

    /**
     * Gets names of path variables, if URL has variables.
     *
     * @return names or empty collection
     */
    Collection getPathVariableNames();

    /**
     * Gets names of expected request headers, if any.
     *
     * @return names or empty collection
     */
    Collection getRequestHeaderNames();

    /**
     * Gets names of expected request parameters, if any.
     *
     * @return names or empty collection
     */
    Collection getRequestParamNames();

    /**
     * Gets action parameter by method parameter name.
     *
     * @param name
     * @return parameter
     */
    ActionInputParameter getActionInputParameter(String name);

    /**
     * Request body descriptor, if the action expects a complex request body.
     *
     * @return request body parameter
     */
    ActionInputParameter getRequestBody();

    /**
     * Does the action expect a complex request body?
     *
     * @return true if applicable
     */
    boolean hasRequestBody();

    /**
     * Gets well-defined semantic action type, e.g. http://schema.org/Action subtype.
     *
     * @return semantic action type
     */
    String getSemanticActionType();

    /**
     * Gets required parameters.
     *
     * @return required parameters, may be empty
     */
    Map getRequiredParameters();

    /**
     * Hints if the action response is a single object or a collection.
     *
     * @return cardinality
     */
    Cardinality getCardinality();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy