com.hp.hpl.jena.joseki
Class HttpQuery

java.lang.Object
  extended bycom.hp.hpl.jena.joseki.HttpQuery
Direct Known Subclasses:
HttpFetch, QuerySPO

public class HttpQuery
extends java.lang.Object

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 in a particular langauge, such as RDQL. Normally, HTTP GET? is used for the query. If the queryStringLang is null or "", do a plain GET on the model. If the query string is large, then HTTP POST?query is used.

Version:
$Id: HttpQuery.java,v 1.13 2004/04/30 14:13:13 andy_seaborne Exp $
Author:
Andy Seaborne

Field Summary
static int urlLimit
          The definition of "large" queries
 
Constructor Summary
HttpQuery(java.lang.String urlString)
          Create a execution object for a whole model GET
HttpQuery(java.lang.String urlString, java.lang.String queryLang)
          Create a execution object for a query.
HttpQuery(java.net.URL url)
          Create a execution object for a whole model GET
HttpQuery(java.net.URL url, java.lang.String queryLang)
          Create a execution object for a query.
 
Method Summary
 void addParam(java.lang.String name)
          Add a parameter to operation (no value associated with the name)
 void addParam(java.lang.String name, java.lang.String value)
          Add a parameter to the operation
 com.hp.hpl.jena.rdf.model.Model exec()
          Execute the operation
 int getResponseCode()
          Return the results from the last execution
 java.lang.String getResponseMessage()
          Return the results from the last execution
 void setForcePOST()
          Force the use of HTTP POST for the query operation
 void setParam(java.lang.String name, java.lang.String value)
          Set a parameter to the operation
 java.lang.String toString()
           
 boolean usesPOST()
          Return whether this request will go by GET or POST
 
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(java.lang.String urlString)
Create a execution object for a whole model GET

Parameters:
urlString - The model

HttpQuery

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

Parameters:
url - The model

HttpQuery

public HttpQuery(java.net.URL url,
                 java.lang.String queryLang)
Create a execution object for a query.

Parameters:
url - The model
queryLang - The query language

HttpQuery

public HttpQuery(java.lang.String urlString,
                 java.lang.String queryLang)
Create a execution object for a query.

Parameters:
urlString - The model
queryLang - The query language
Method Detail

setParam

public void setParam(java.lang.String name,
                     java.lang.String value)
Set a parameter to the operation

Parameters:
name - Name of the parameter
value - Value - May be null to indicate none - the name still goes.

addParam

public void addParam(java.lang.String name,
                     java.lang.String value)
Add a parameter to the operation

Parameters:
name - Name of the parameter
value - Value - May be null to indicate none - the name still goes.

addParam

public void addParam(java.lang.String name)
Add a parameter to operation (no value associated with the name)

Parameters:
name - Name of the parameter

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


getResponseCode

public int getResponseCode()
Return the results from the last execution


getResponseMessage

public java.lang.String getResponseMessage()
Return the results from the last execution


exec

public com.hp.hpl.jena.rdf.model.Model exec()
                                     throws HttpException
Execute the operation

Returns:
Model The resulting model
Throws:
HttpException

toString

public java.lang.String toString()


Copyright © 2002, 2003, 2004 Hewlett-Packard Development Company, LP