org.elkoserver.objdb.store
Class UpdateDesc

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

public class UpdateDesc
extends PutDesc

Description of a request to update to the object store.

See Also:
ObjectStore.updateObjects()

Constructor Summary
UpdateDesc(String ref, int version, String obj, OptString collectionName)
          JSON-driven constructor.
UpdateDesc(String ref, int version, String obj, String collectionName)
          Direct constructor.
 
Method Summary
 JSONLiteral encode(EncodeControl control)
          Encode this object for transmission or persistence.
 int version()
          Get the version number.
 
Methods inherited from class org.elkoserver.objdb.store.PutDesc
collectionName, isRequireNew, obj, ref
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateDesc

@JSONMethod(value={"ref","version","obj","coll"})
public UpdateDesc(String ref,
                                  int version,
                                  String obj,
                                  OptString collectionName)
JSON-driven constructor.

Parameters:
ref - Object reference of the object to write.
version - Object version being updated
obj - Object description.
collectionName - Name of collection to write to, or null to take the configured default.

UpdateDesc

public UpdateDesc(String ref,
                  int version,
                  String obj,
                  String collectionName)
Direct constructor.

Parameters:
ref - Object reference for the object.
version - Object version being updated
obj - Object description (a JSON string describing the object).
collectionName - Name of collection to write to, or null to take the configured default.
Method Detail

encode

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

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

version

public int version()
Get the version number.

Returns:
the version number of the version being updated.