Class ExecHTTPBuilder<X,​Y>

    • Constructor Summary

      Constructors 
      Constructor Description
      ExecHTTPBuilder()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Y acceptHeader​(java.lang.String acceptHeader)  
      Y addDefaultGraphURI​(java.lang.String uri)  
      Y addNamedGraphURI​(java.lang.String uri)  
      X build()  
      Y context​(Context context)
      Set the Context.
      Y endpoint​(java.lang.String serviceURL)
      Set the URL of the query endpoint.
      Y httpClient​(java.net.http.HttpClient httpClient)  
      Y httpHeader​(java.lang.String headerName, java.lang.String headerValue)  
      Y httpHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)  
      Y param​(java.lang.String name)  
      Y param​(java.lang.String name, java.lang.String value)  
      Y params​(Params other)
      Merge in Params from another object.
      Y postQuery()
      Send the query request using POST with a Content-Type of as a "application/sparql-query"
      Y query​(java.lang.String queryStr)
      Set the query - the the string must be valid syntax.
      Y query​(java.lang.String queryStr, Syntax syntax)  
      Y query​(Query query)
      Set the query - this also sets the query string to agree with the query argument.
      Y queryString​(java.lang.String queryString)
      Set the query string - this also clears any Query already set.
      Y sendMode​(QuerySendMode mode)
      Choose how to send the query string over HTTP.
      Y set​(Symbol symbol, boolean value)  
      Y set​(Symbol symbol, java.lang.Object value)  
      Y substitution​(java.lang.String var, Node value)  
      Y substitution​(Var var, Node value)  
      Y substitution​(Binding binding)  
      Y timeout​(long timeout, java.util.concurrent.TimeUnit timeoutUnit)
      Set a timeout to the overall overall operation.
      Y urlGetLimit​(int urlLimit)
      Maximum length for a GET request URL, this includes the length of the service endpoint URL - longer than this and the request will use POST/Form.
      Y useGet()
      Send the query using HTTP GET and the HTTP URL query string regardless of length.
      Y useGetWithLimit()
      Send the query using HTTP GET and the HTTP URL query string, unless the request exceeds the urlGetLimit(int) (system default HttpEnv.urlLimit).
      • Methods inherited from class java.lang.Object

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

      • ExecHTTPBuilder

        public ExecHTTPBuilder()
    • Method Detail

      • endpoint

        public Y endpoint​(java.lang.String serviceURL)
        Set the URL of the query endpoint.
      • query

        public Y query​(Query query)
        Set the query - this also sets the query string to agree with the query argument.
      • query

        public Y query​(java.lang.String queryStr)
        Set the query - the the string must be valid syntax. Use queryString to pass in a query with other syntax (e.g. the remote end has SPARQL syntax extensions).
      • query

        public Y query​(java.lang.String queryStr,
                       Syntax syntax)
      • queryString

        public Y queryString​(java.lang.String queryString)
        Set the query string - this also clears any Query already set. The queryString is not interpreted and it may contain SPARQL syntax extensions supported by the target triple store.
      • addDefaultGraphURI

        public Y addDefaultGraphURI​(java.lang.String uri)
      • addNamedGraphURI

        public Y addNamedGraphURI​(java.lang.String uri)
      • httpClient

        public Y httpClient​(java.net.http.HttpClient httpClient)
      • sendMode

        public Y sendMode​(QuerySendMode mode)
        Choose how to send the query string over HTTP.

        The default is QuerySendMode.systemDefault which is QuerySendMode.asGetWithLimitBody – send by HTTP GET and a query string unless too long (see urlLimit), when it switch to POST and application/sparql-query".

        See Also:
        QuerySendMode
      • useGetWithLimit

        public Y useGetWithLimit()
        Send the query using HTTP GET and the HTTP URL query string, unless the request exceeds the urlGetLimit(int) (system default HttpEnv.urlLimit).

        If it exceeds the limit, switch to using a HTML form and POST request. By default, queries with a log URL are sent in an HTTP form with POST.

        This is the default setting.

        See Also:
        urlGetLimit(int), useGet(), postQuery()
      • useGet

        public Y useGet()
        Send the query using HTTP GET and the HTTP URL query string regardless of length. By default, queries with a long URL are sent in an HTTP POST.
      • postQuery

        public Y postQuery()
        Send the query request using POST with a Content-Type of as a "application/sparql-query"
      • urlGetLimit

        public Y urlGetLimit​(int urlLimit)
        Maximum length for a GET request URL, this includes the length of the service endpoint URL - longer than this and the request will use POST/Form.

        Long URLs can be silently truncated by intermediate systems and proxies. Use of the URL query string means that request are not cached.

        See also postQuery() to send the request using HTTP POST with the query in the POST body using Content-Type "application/sparql-query"

        See also sendMode to choose a specific "send" policy.

      • params

        public Y params​(Params other)
        Merge in Params from another object.
      • param

        public Y param​(java.lang.String name)
      • param

        public Y param​(java.lang.String name,
                       java.lang.String value)
      • substitution

        public Y substitution​(Binding binding)
      • substitution

        public Y substitution​(java.lang.String var,
                              Node value)
      • substitution

        public Y substitution​(Var var,
                              Node value)
      • acceptHeader

        public Y acceptHeader​(java.lang.String acceptHeader)
      • httpHeader

        public Y httpHeader​(java.lang.String headerName,
                            java.lang.String headerValue)
      • httpHeaders

        public Y httpHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)
      • context

        public Y context​(Context context)
        Set the Context. This defaults to the global settings of ARQ.getContext(). If there was a previous call of context the multiple contexts are merged.
      • set

        public Y set​(Symbol symbol,
                     java.lang.Object value)
      • set

        public Y set​(Symbol symbol,
                     boolean value)
      • timeout

        public Y timeout​(long timeout,
                         java.util.concurrent.TimeUnit timeoutUnit)
        Set a timeout to the overall overall operation. Time-to-connect can be set with a custom HttpClient - see HttpClient.Builder.connectTimeout(java.time.Duration).
      • build

        public final X build()