org.elkoserver.objdb.store
Class RequestDesc

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

public class RequestDesc
extends Object
implements Encodable

Description of a request for an object.

See Also:
ObjectStore.getObjects()

Constructor Summary
RequestDesc(String ref, OptString collectionName, OptBoolean contents)
          JSON-driven constructor.
RequestDesc(String ref, String collectionName, boolean contents)
          Direct constructor.
 
Method Summary
 String collectionName()
          Get the name of the collection being queried, or null if it's to be the default.
 boolean contents()
          Get the value of the contents flag.
 JSONLiteral encode(EncodeControl control)
          Encode this object for transmission or persistence.
 String ref()
          Get the reference string of the requested object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestDesc

@JSONMethod(value={"ref","coll","contents"})
public RequestDesc(String ref,
                                   OptString collectionName,
                                   OptBoolean contents)
JSON-driven constructor.

Parameters:
ref - Reference string identifying the object requested.
collectionName - Name of collection to get from, or null to take the configured default.
contents - If true, retrieve the referenced object and any objects it contains; if false (the default if omitted), only retrieve the referenced object itself.

RequestDesc

public RequestDesc(String ref,
                   String collectionName,
                   boolean contents)
Direct constructor.

Parameters:
ref - Reference string identifying the object requested.
collectionName - Name of collection to get from, or null to take the configured default.
contents - If true, retrieve the referenced object and any objects it contains; if false, only retrieve the referenced object itself.
Method Detail

collectionName

public String collectionName()
Get the name of the collection being queried, or null if it's to be the default.

Returns:
the value of this request's collection name.

contents

public boolean contents()
Get the value of the contents flag.

Returns:
the value of this request's contents flag.

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.

ref

public String ref()
Get the reference string of the requested object.

Returns:
the reference string of the requested object.