org.elkoserver.objdb.store
Class QueryDesc

java.lang.Object
  extended by org.elkoserver.objdb.store.QueryDesc
All Implemented Interfaces:
Encodable

public class QueryDesc
extends Object
implements Encodable

Description of a query for an object.

See Also:
ObjectStore.queryObjects()

Constructor Summary
QueryDesc(JSONObject template, OptString collectionName, OptInteger maxResults)
          JSON-driven (and direct) constructor.
QueryDesc(JSONObject template, String collectionName, int maxResults)
          Direct constructor.
 
Method Summary
 String collectionName()
          Get the collection for this query.
 JSONLiteral encode(EncodeControl control)
          Encode this object for transmission or persistence.
 int maxResults()
          Get the result limit for this query.
 JSONObject template()
          Get the query template for the queried object(s).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryDesc

@JSONMethod(value={"template","coll","limit"})
public QueryDesc(JSONObject template,
                                 OptString collectionName,
                                 OptInteger maxResults)
JSON-driven (and direct) constructor.

Parameters:
template - Query template indicating the objects queried.
collectionName - Name of collection to query, or null to take the configured default.
maxResults - Maximum number of result objects to return, or 0 to indicate no fixed limit (the default if omitted).

QueryDesc

public QueryDesc(JSONObject template,
                 String collectionName,
                 int maxResults)
Direct constructor.

Parameters:
template - Query template indicating the objects queried.
collectionName - Name of collection to query, or null to take the configured default.
maxResults - Maximum number of result objects to return, or 0 to indicate no fixed limit.
Method Detail

encode

public JSONLiteral encode(EncodeControl control)
Encode this object for transmission or persistence.

Specified by:
encode in interface Encodable
Parameters:
control - Encode control determining what flavor of encoding should be done.
Returns:
a JSON literal representing this object.

template

public JSONObject template()
Get the query template for the queried object(s).

Returns:
the query template for the query.

collectionName

public String collectionName()
Get the collection for this query.

Returns:
the name of collection to query, or null to take the default.

maxResults

public int maxResults()
Get the result limit for this query.

Returns:
the maximum number of results for this query.