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

net.nemerosa.ontrack.client.OTHttpClient Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.client;

import net.nemerosa.ontrack.common.Document;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.impl.client.CloseableHttpClient;

import java.net.URL;

public interface OTHttpClient {

    URL getUrl();

    /**
     * Gets the URL for a relative path
     *
     * @param path       Relative path
     * @param parameters Parameter for the relative path parameters (if any)
     * @return Absolute URL
     */
    String getUrl(String path, Object... parameters);

     T get(ResponseParser responseParser, String path, Object... parameters);

     T delete(ResponseParser responseParser, String path, Object... parameters);

     T post(ResponseParser responseParser, HttpEntity data, String path, Object... parameters);

     T put(ResponseParser responseParser, HttpEntity data, String path, Object... parameters);

     T upload(ResponseParser responseParser, String name, Document file, String fileName, String path, Object... parameters);

    /**
     * Downloads a document
     */
    Document download(String path, Object... parameters);

     T request(HttpRequestBase request, final ResponseParser responseParser);

    /**
     * Underlying HTTP client
     */
    CloseableHttpClient getHttpClient();

    /**
     * HTTP host
     */
    HttpHost getHttpHost();

    /**
     * HTTP call context
     */
    HttpClientContext getHttpClientContext();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy