| java.lang.Object org.cougaar.lib.aggagent.session.UpdateDelta
UpdateDelta | public class UpdateDelta (Code) | | The UpdateDelta class represents the communication strategy used for
transfering data between the society agents and an aggregation agent.
The typical usage of this class is as a container for ResultSetDataAtoms,
which are loaded into the UpdateDelta by a society agent. The delta is
then transfered as XML to the aggregation agent, where it is reconstituted
and applied to the appropriate result set.
An alternate usage is as a container for more generic XmlTransferable
objects such as queries and result sets. Though such an UpdateDelta cannot
(at this time) be reconstituted automatically, this strategy is used in
communications between UI clients and the aggregation agent.
An UpdateDelta can be used in either of two modes: increment or
replacement. The former reflects the familiar behavior of the
IncrementalSubscription class (with "added", "changed", and "removed"
lists), while the latter produces a new result set in its entirety. The
mode may be set at any time without losing data, but a good practice is to
set the mode once before any content elements are added.
|
Constructor Summary | |
public | UpdateDelta(String agent, String query, String key) Create a new UpdateDelta, presumably for transport to a remote location.
The three String identifiers indicate which COUGAAR agent, query, and
local session are associated with this UpdateDelta. | public | UpdateDelta(Element root) Create an UpdateDelta from XML representation. |
UpdateDelta | public UpdateDelta(String agent, String query, String key)(Code) | | Create a new UpdateDelta, presumably for transport to a remote location.
The three String identifiers indicate which COUGAAR agent, query, and
local session are associated with this UpdateDelta. Content must be
added before this delta will be useful.
Note: The setReplacement() method must be called before content can
safely be added. The boolean argument tells whether to create added,
changed, and removed lists, or simply a replacement list.
|
UpdateDelta | public UpdateDelta(Element root)(Code) | | Create an UpdateDelta from XML representation. Presumably, this is
received from a remote location, complete with identifiers and content
data elements.
|
clearContents | public void clearContents()(Code) | | |
getReplacementList | public List getReplacementList()(Code) | | |
isErrorReport | public boolean isErrorReport()(Code) | | |
isReplacement | public boolean isReplacement()(Code) | | |
setReplacement | public void setReplacement(boolean b)(Code) | | Set the "replacement mode" true or false. If true, the UpdateDelta
contains three lists of data elements after the fashion of an
IncrementalSubscription; i.e., added, changed, and removed elements. If
false, the UpdateDelta contains a single list which should be interpreted
as a replacement for all previously collected data elements. This
distinction is only meaningful for persistent queries.
|
toXml | public String toXml()(Code) | | Convert this UpdateDelta to an XML format. Depending on whether this is
a replacement or not, this will, respectively, produce a list of elements
intended to replace an existing result set or a list of modifications to
be applied to an existing result set. Data elements must implement the
XmlTransferable interface.
|
|
|