com.hp.hpl.jena.sparql.engine.http
Class HttpQuery

java.lang.Object
  extended by com.hp.hpl.jena.sparql.engine.http.Params
      extended by com.hp.hpl.jena.sparql.engine.http.HttpQuery

public class HttpQuery
extends Params

Create an execution object for performing a query on a model over HTTP. This is the main protocol engine for HTTP query. There are higher level classes for doing a query and presenting the results in an API fashion. If the query string is large, then HTTP POST is used.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.hp.hpl.jena.sparql.engine.http.Params
Params.Pair
 
Field Summary
static int urlLimit
          The definition of "large" queries
 
Constructor Summary
HttpQuery(String serviceURL)
          Create a execution object for a whole model GET
HttpQuery(URL url)
          Create a execution object for a whole model GET
 
Method Summary
 InputStream exec()
          Execute the operation
 HttpURLConnection getConnection()
           
 void setAccept(String contentType)
          Set the content type (Accept header) for the results
 void setBasicAuthentication(String user, char[] password)
           
 void setForcePOST()
          Force the use of HTTP POST for the query operation
 String toString()
           
 boolean usesPOST()
          Return whether this request will go by GET or POST
 
Methods inherited from class com.hp.hpl.jena.sparql.engine.http.Params
addParam, addParam, containsParam, count, getValue, getValues, httpString, merge, names, pairs, remove
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

urlLimit

public static int urlLimit
The definition of "large" queries

Constructor Detail

HttpQuery

public HttpQuery(String serviceURL)
Create a execution object for a whole model GET

Parameters:
serviceURL - The model

HttpQuery

public HttpQuery(URL url)
Create a execution object for a whole model GET

Parameters:
url - The model
Method Detail

getConnection

public HttpURLConnection getConnection()

setAccept

public void setAccept(String contentType)
Set the content type (Accept header) for the results


setBasicAuthentication

public void setBasicAuthentication(String user,
                                   char[] password)

usesPOST

public boolean usesPOST()
Return whether this request will go by GET or POST

Returns:
boolean

setForcePOST

public void setForcePOST()
Force the use of HTTP POST for the query operation


exec

public InputStream exec()
                 throws QueryExceptionHTTP
Execute the operation

Returns:
Model The resulting model
Throws:
QueryExceptionHTTP

toString

public String toString()
Overrides:
toString in class Object


Licenced under the Apache License, Version 2.0