summaryrefslogtreecommitdiffstats
path: root/tenant-cd/src/main/java/ai/vespa/hosted/cd/Endpoint.java
blob: dbbb969efe2a3a94abe8ac9fe3018e9fc99dc881 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package ai.vespa.hosted.cd;

import ai.vespa.hosted.cd.metric.Metrics;

import java.net.URI;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

/**
 * An endpoint in a Vespa application {@link Deployment}, which allows document and metrics retrieval.
 *
 * The endpoint translates {@link Query}s to {@link Search}s, and {@link Selection}s to {@link Visit}s.
 * It also supplies {@link Metrics}.
 *
 * @author jonmv
 */
public interface Endpoint {

    URI uri();

    <T> HttpResponse<T> send(HttpRequest.Builder request, HttpResponse.BodyHandler<T> handler);

    Search search(Query query);

    Visit visit(Selection selection);

    Metrics metrics();

}