org.elkoserver.objdb.store
Class ResultDesc

java.lang.Object
  extended by org.elkoserver.objdb.store.ResultDesc
All Implemented Interfaces:
Encodable
Direct Known Subclasses:
UpdateResultDesc

public class ResultDesc
extends Object
implements Encodable

Description of the result status of an object store operation.

See Also:
ObjectStore.putObjects(), ObjectStore.removeObjects(), RequestResultHandler

Constructor Summary
ResultDesc(String ref, OptString failure)
          JSON-driven constructor.
ResultDesc(String ref, String failure)
          Direct constructor.
 
Method Summary
 JSONLiteral encode(EncodeControl control)
          Encode this object for transmission or persistence.
 String failure()
          Get the error message string.
 String ref()
          Get the subject object's reference string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultDesc

@JSONMethod(value={"ref","failure"})
public ResultDesc(String ref,
                                  OptString failure)
JSON-driven constructor.

Parameters:
ref - Object reference of the object acted upon.
failure - Optional error message.

ResultDesc

public ResultDesc(String ref,
                  String failure)
Direct constructor.

Parameters:
ref - Object reference of the object that was the subject of the operation.
failure - Error message string, or null if the operation was successful.
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.

failure

public String failure()
Get the error message string.

Returns:
the error message string, or null if there is none (i.e., if this represents a success result).

ref

public String ref()
Get the subject object's reference string.

Returns:
the object reference string of the subject object.