Class HttpEndpoint

  • All Implemented Interfaces:
    Endpoint

    public class HttpEndpoint
    extends java.lang.Object
    implements Endpoint
    A remote endpoint in a HttpDeployment of a Vespa application, reachable over HTTP.
    Author:
    jonmv
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpEndpoint​(java.net.URI endpoint, ai.vespa.hosted.api.EndpointAuthenticator authenticator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.http.HttpRequest.Builder request​(java.lang.String path, java.util.Map<java.lang.String,​java.lang.String> properties)
      Creates a request against the endpoint, with the given path and properties.
      <T> java.net.http.HttpResponse<T> send​(java.net.http.HttpRequest.Builder request, java.net.http.HttpResponse.BodyHandler<T> handler)
      Sends the given request with required authentication.
      java.net.URI uri()
      Returns the URI of the endpoint, with scheme, host and port.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HttpEndpoint

        public HttpEndpoint​(java.net.URI endpoint,
                            ai.vespa.hosted.api.EndpointAuthenticator authenticator)
    • Method Detail

      • uri

        public java.net.URI uri()
        Description copied from interface: Endpoint
        Returns the URI of the endpoint, with scheme, host and port.
        Specified by:
        uri in interface Endpoint
      • send

        public <T> java.net.http.HttpResponse<T> send​(java.net.http.HttpRequest.Builder request,
                                                      java.net.http.HttpResponse.BodyHandler<T> handler)
        Description copied from interface: Endpoint
        Sends the given request with required authentication. See EndpointAuthenticator.authenticated(java.net.http.HttpRequest.Builder) and HttpClient.send(java.net.http.HttpRequest, java.net.http.HttpResponse.BodyHandler<T>).
        Specified by:
        send in interface Endpoint
      • request

        public java.net.http.HttpRequest.Builder request​(java.lang.String path,
                                                         java.util.Map<java.lang.String,​java.lang.String> properties)
        Description copied from interface: Endpoint
        Creates a request against the endpoint, with the given path and properties.
        Specified by:
        request in interface Endpoint