com.waveset.object
Class ResultRecord

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.object.ResultTable
          extended bycom.waveset.object.ResultRecord
All Implemented Interfaces:
javax.naming.Referenceable, XmlObject

public class ResultRecord
extends ResultTable

Structures information about the result of an individual operation performed as part of a larger bulk operation. Stored as the value of a ResultItem in a WavesetResult object.

These will be found in ResultItem objects whose type is "record" ( ResultItem.RECORD ).

Organizes "audit-trail" information in a WavesetResult.

Collects the following features of an individual operation:

timestamp
when the individual operation took place.
name
OPTIONAL: A name that identifies (or a label that describes) the target of the operation. For example, the native key of an extracted account, or the lighthouse user identity for which a resource account is being updated.
input
OPTIONAL: The input data (if any) to the operation.
output
OPTIONAL: The output data (if any) from the operation.
message
OPTIONAL: Any output or error message from the operation.

The ResultItem that contains this ResultRecord already stores the error level of the individual operation.

See Also:
// *

// * The ResultItem that contains this ResultRecord // * already stores the source of the result record. Note, this "source" is // * the "target" of the overall operation. // * @see ResultItem#getSource()


Field Summary
static java.lang.String code_id
           
static java.util.List DEFAULT_COLUMNS
          By default, this class displays the following columns: SEQUENCE TIMESTAMP LABEL STATUS MESSAGES INPUT OUTPUT To suppress a column, call setColumns() or removeColumn().
static java.lang.String EL_INPUT_DATA
          Our XML child element name.
static java.lang.String EL_OUTPUT_DATA
          Our XML child element name.
static java.lang.String INPUT
           
static java.lang.String LABEL
          A label describing the target of this individual operation.
static java.lang.String MESSAGES
           
static java.lang.String OUTPUT
           
static java.lang.String SEQUENCE
          The sequence number of this individual operation within the larger bulk operation.
static java.lang.String STATUS
           
static java.lang.String TIMESTAMP
          The time (in milliseconds) this individual operation occurred.
 
Fields inherited from class com.waveset.object.ResultTable
ATT_NAME, EL_COLUMNS, EL_ROWS, EL_TITLE, ELEMENT, ITEM_TYPE
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace
 
Constructor Summary
ResultRecord()
          Build an empty result record to be filled in later.
ResultRecord(org.w3c.dom.Element e)
          Build an error object by parsing its DOM representation.
 
Method Summary
 void addMessage(Message msg)
          Adds a message to the current list.
 void addMessage(java.lang.String msg)
           
 void addMessages(java.util.List msgs)
          Adds message objects to the current list.
 void clear()
          Reset any row values in this result record.
 java.lang.Object get(java.lang.String name)
           
 java.lang.String getInputData()
           
 java.lang.String getLabel()
           
 java.util.List getMessages()
           
 java.lang.String getOutputData()
           
 java.lang.Integer getSequence()
           
 ResultItem.Status getStatus()
           
 java.lang.Long getTimestamp()
           
 boolean isEmpty()
           
static void main(java.lang.String[] args)
           
protected  void parseXml(org.w3c.dom.Element e)
           
 void set(java.lang.String name, java.lang.Object value)
          Store a value associated with the specified name.
 void setInputData(java.lang.String s)
          Store string input data to this individual operation.
 void setLabel(java.lang.String label)
          Store a name identifying (or label describing) the target of this individual operation.
 void setMessages(java.util.List msgs)
          Replaces the current list of message objects.
 void setOutputData(java.lang.String s)
          Store string output data from this individual operation.
 void setSequence(int sequence)
          Set the sequence of this individual operation within the larger bulk operation.
 void setStatus(ResultItem.Status status)
          Stores a ResultItem.Status indicating whether the individual operation succeeded, had errors, or failed.
 void setStatus(Severity severity)
          Stores a ResultItem.Status indicating whether the individual operation succeeded, had errors, or failed.
 void setTimestamp(long timestamp)
          Set the time (in milliseconds) this individual operation occurred.
 void toXml(java.lang.StringBuffer b, int indent)
          Serialize into a buffer with optional indentation.
 
Methods inherited from class com.waveset.object.ResultTable
addColumn, addRow, getColumn, getColumn, getColumns, getElementName, getName, getNameMsg, getRow, getRows, removeColumn, setColumns, setName, setNameMsg, setRows
 
Methods inherited from class com.waveset.util.AbstractXmlObject
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

EL_INPUT_DATA

public static final java.lang.String EL_INPUT_DATA
Our XML child element name.

See Also:
Constant Field Values

EL_OUTPUT_DATA

public static final java.lang.String EL_OUTPUT_DATA
Our XML child element name.

See Also:
Constant Field Values

SEQUENCE

public static final java.lang.String SEQUENCE
The sequence number of this individual operation within the larger bulk operation. Values are expected to be unique and ordinal.

See Also:
Constant Field Values

TIMESTAMP

public static final java.lang.String TIMESTAMP
The time (in milliseconds) this individual operation occurred.

See Also:
Constant Field Values

LABEL

public static final java.lang.String LABEL
A label describing the target of this individual operation. Generally expected to be unique within the bulk operation.

See Also:
Constant Field Values

STATUS

public static final java.lang.String STATUS
See Also:
Constant Field Values

MESSAGES

public static final java.lang.String MESSAGES
See Also:
Constant Field Values

INPUT

public static final java.lang.String INPUT
See Also:
Constant Field Values

OUTPUT

public static final java.lang.String OUTPUT
See Also:
Constant Field Values

DEFAULT_COLUMNS

public static final java.util.List DEFAULT_COLUMNS
By default, this class displays the following columns:
  1. SEQUENCE
  2. TIMESTAMP
  3. LABEL
  4. STATUS
  5. MESSAGES
  6. INPUT
  7. OUTPUT
To suppress a column, call setColumns() or removeColumn(). To add a column or change the order of columns, call setColumns().

Constructor Detail

ResultRecord

public ResultRecord()
Build an empty result record to be filled in later.


ResultRecord

public ResultRecord(org.w3c.dom.Element e)
             throws WavesetException
Build an error object by parsing its DOM representation.

Method Detail

getSequence

public java.lang.Integer getSequence()
Returns:
the sequence of this individual operation within the larger bulk operation.

setSequence

public void setSequence(int sequence)
Set the sequence of this individual operation within the larger bulk operation.

Values are expected to be unique and ordinal.


getTimestamp

public java.lang.Long getTimestamp()
Returns:
the time (in milliseconds) this individual operation occurred.

setTimestamp

public void setTimestamp(long timestamp)
Set the time (in milliseconds) this individual operation occurred.

It is not important whether this is the time the operation began or the time the operation ended. It is more important that the timestamp values are consistent, so that comparison is meaningful. As much as possible, timestamp values should reflect a common time source. For example, if accounts are being created on several resources, it would be best if the timestamp were that of the server, rather than that of the resource.


getLabel

public java.lang.String getLabel()
Returns:
a name identifying (or label describing) the target of this individual operation.

setLabel

public void setLabel(java.lang.String label)
Store a name identifying (or label describing) the target of this individual operation.


getInputData

public java.lang.String getInputData()
Returns:
string input data to this individual operation.

setInputData

public void setInputData(java.lang.String s)
Store string input data to this individual operation.


getOutputData

public java.lang.String getOutputData()
Returns:
string output data from this individual operation.

setOutputData

public void setOutputData(java.lang.String s)
Store string output data from this individual operation.


getStatus

public ResultItem.Status getStatus()
Returns:
a ResultItem.Status indicating whether the individual operation succeeded, had errors, or failed.

setStatus

public void setStatus(ResultItem.Status status)
Stores a ResultItem.Status indicating whether the individual operation succeeded, had errors, or failed.


setStatus

public void setStatus(Severity severity)
Stores a ResultItem.Status indicating whether the individual operation succeeded, had errors, or failed.

Parameters:
severity - - error message severity mapped to a status.

getMessages

public java.util.List getMessages()
Returns:
a list of Message objects, each holding the information necessary to format the message for any locale. Normally there is just one message, but in some cases a WavesetException object may contain more than one message.

addMessage

public void addMessage(Message msg)
Adds a message to the current list.


setMessages

public void setMessages(java.util.List msgs)
Replaces the current list of message objects.


addMessages

public void addMessages(java.util.List msgs)
Adds message objects to the current list.


addMessage

public void addMessage(java.lang.String msg)

get

public java.lang.Object get(java.lang.String name)
                     throws InvalidArgument
Parameters:
name - - may not match any name in DEFAULT_COLUMNS.

Use this to retrieve values for any custom (i.e., non-default) column.

Returns:
any value associated with the specified name.
Throws:
InvalidArgument

set

public void set(java.lang.String name,
                java.lang.Object value)
         throws InvalidArgument
Store a value associated with the specified name.

Parameters:
name - - may not match any name in DEFAULT_COLUMNS.

Use this to store values for any custom (i.e., non-default) column.

Throws:
InvalidArgument

clear

public void clear()
Reset any row values in this result record.


isEmpty

public boolean isEmpty()

toXml

public void toXml(java.lang.StringBuffer b,
                  int indent)
Description copied from class: AbstractXmlObject
Serialize into a buffer with optional indentation. This must be implemented by the subclass.

Specified by:
toXml in interface XmlObject
Overrides:
toXml in class ResultTable

parseXml

protected void parseXml(org.w3c.dom.Element e)
                 throws WavesetException
Overrides:
parseXml in class ResultTable
Throws:
WavesetException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception