org.openrdf.repository.http
Class HTTPTupleQuery

java.lang.Object
  extended by org.openrdf.query.impl.AbstractQuery
      extended by org.openrdf.repository.http.HTTPQuery
          extended by org.openrdf.repository.http.HTTPTupleQuery
All Implemented Interfaces:
Query, TupleQuery

public class HTTPTupleQuery
extends HTTPQuery
implements TupleQuery

TupleQuery specific to the HTTP protocol. Methods in this class may throw the specific StoreException subclasses UnautorizedException and NotAllowedException, the semantics of which are defined by the HTTP protocol.

Author:
Arjohn Kampman, Herko ter Horst, James Leigh
See Also:
UnauthorizedException, org.openrdf.http.protocol.NotAllowedException

Field Summary
protected  int limit
           
protected  int offset
           
 
Fields inherited from class org.openrdf.query.impl.AbstractQuery
bindings, dataset, includeInferred, maxQueryTime
 
Constructor Summary
HTTPTupleQuery(String qry, TupleQueryClient client)
           
 
Method Summary
 TupleResult evaluate()
           
<H extends TupleQueryResultHandler>
H
evaluate(H handler)
           
 int getLimit()
          Returns the maximum number of query resultcs.
 int getOffset()
          Returns the number of skipped results.
 void setLimit(int limit)
          Specifies the maximum results that a query is allowed to return.
 void setOffset(int offset)
          Specifies the numbers of results that should be omitted from the beginning of the query results.
 
Methods inherited from class org.openrdf.repository.http.HTTPQuery
prepareClient, toString
 
Methods inherited from class org.openrdf.query.impl.AbstractQuery
getBindings, getDataset, getIncludeInferred, getMaxQueryTime, removeBinding, setBinding, setDataset, setIncludeInferred, setMaxQueryTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openrdf.query.Query
getBindings, getDataset, getIncludeInferred, getMaxQueryTime, removeBinding, setBinding, setDataset, setIncludeInferred, setMaxQueryTime
 

Field Detail

offset

protected int offset

limit

protected int limit
Constructor Detail

HTTPTupleQuery

public HTTPTupleQuery(String qry,
                      TupleQueryClient client)
Method Detail

setOffset

public void setOffset(int offset)
Description copied from interface: TupleQuery
Specifies the numbers of results that should be omitted from the beginning of the query results.

Specified by:
setOffset in interface TupleQuery

getOffset

public int getOffset()
Description copied from interface: TupleQuery
Returns the number of skipped results.

Specified by:
getOffset in interface TupleQuery
Returns:
the numbers of results that should be omitted from the beginning of the query results.

setLimit

public void setLimit(int limit)
Description copied from interface: TupleQuery
Specifies the maximum results that a query is allowed to return. The query stop before it exceeds the result limit. Any consecutive requests to fetch query results will result in a null value.

Specified by:
setLimit in interface TupleQuery
Parameters:
limit - The maximum number of query results. A -1 value indicates an unlimited results (which is the default).

getLimit

public int getLimit()
Description copied from interface: TupleQuery
Returns the maximum number of query resultcs.

Specified by:
getLimit in interface TupleQuery
Returns:
The maximum number of query results. A -1 value indicates an unlimited results.
See Also:
TupleQuery.setLimit(int)

evaluate

public TupleResult evaluate()
                     throws StoreException
Specified by:
evaluate in interface Query
Specified by:
evaluate in interface TupleQuery
Throws:
StoreException

evaluate

public <H extends TupleQueryResultHandler> H evaluate(H handler)
                                           throws StoreException,
                                                  TupleQueryResultHandlerException
Specified by:
evaluate in interface TupleQuery
Throws:
StoreException
TupleQueryResultHandlerException


Copyright © 2001-2009 Aduna. All Rights Reserved.