|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--org.vmguys.vmtools.ota.OtaUpdate
This class generates and applies OTA update requests. If given two pieces of OTA data, it will generate an update request that will show the differences between the data. If given a piece of OTA data and an update request, it will apply the update and return the modified data.
This class operates on JDOM trees, rather than XML documents. An application using this class should parse the input XML files to create the trees, or use the result tree to generate an XML document.
| Field Summary | |
static java.lang.String |
generatedVersion
|
protected boolean |
replace
The replace flag indicates the type of difference Element created by generateDiffs. |
static java.lang.String |
schemaLocation
The default schemaLocation value for OTA_UpdateRQ documents. |
static java.lang.String |
tagname
The element tag name for an OTA_UpdateRQ document. |
static java.lang.String |
xmlns
The default namespace for OTA documents. |
| Constructor Summary | |
OtaUpdate()
Constructs an object with replace set to false so
it will attempt to find the minimal differences between the trees and record
them in the update request. |
|
OtaUpdate(boolean replace)
Constructs an object with replace set to the specified value. |
|
| Method Summary | |
org.jdom.Element |
applyDiffs(org.jdom.Element original,
org.jdom.Element updateRequest)
Applies the update request to the original tree to recreate the modified tree. |
org.jdom.Element |
generateDiffs(org.jdom.Element original,
org.jdom.Element modified,
UniqueId id)
Returns the differences between the original tree and the modified tree as an OTA update request using the current setting of replace. |
org.jdom.Element |
generateDiffs(org.jdom.Element original,
org.jdom.Element modified,
UniqueId id,
boolean replace)
Returns the differences between the original tree and the modified tree as an OTA update request using the specified value of replace. |
boolean |
getReplace()
Gets the current value of replace. |
void |
setProgressReporter(ProgressReporter pr)
This method sets the progress reporter. |
void |
setReplace(boolean replace)
Sets replace to the specified value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String generatedVersion
public static final java.lang.String tagname
public static final java.lang.String xmlns
public static final java.lang.String schemaLocation
protected boolean replace
The replace flag indicates the type of difference Element created by generateDiffs.
Note: This is declared protected so the junit test programs can access it.
generateDiffs(Element, Element, UniqueId),
generateDiffs(Element, Element, UniqueId, boolean),
getReplace(),
setReplace(boolean)| Constructor Detail |
public OtaUpdate()
replace set to false so
it will attempt to find the minimal differences between the trees and record
them in the update request.replacepublic OtaUpdate(boolean replace)
replace set to the specified value.
If false, it will attempt to find the minimal differences between the trees and record
them in the update request. If true, it will generate an update request that
simply contains the modified version of the tree and a replace command.replace| Method Detail |
public void setReplace(boolean replace)
replace to the specified value.
If false, it will attempt to find the minimal differences between the trees and record
them in the update request. If true, it will generate an update request that
simply contains the modified version of the tree and a replace command.replacepublic boolean getReplace()
replace.replace
public org.jdom.Element generateDiffs(org.jdom.Element original,
org.jdom.Element modified,
UniqueId id)
throws org.jdom.JDOMException
Returns the differences between the original tree and the
modified tree as an OTA update request using the current
setting of replace.
The content of the output depends on the setting
of the replace field. If true, the update
message specifies the replace operation
and includes the modified tree as
the replacement. If false, the message specifies
combinations of insert and delete operations and
includes the minimal differences between the original
and modified Elements.
In either case, when this update request is applied against the original tree by applyDiffs, the result will be the modified tree.
applyDiffs(Element, Element),
replace
public org.jdom.Element generateDiffs(org.jdom.Element original,
org.jdom.Element modified,
UniqueId id,
boolean replace)
throws org.jdom.JDOMException
replace.
The content of the output depends on the setting
of the replace parameter. If true, the update
message specifies the replace operation
and includes the modified tree as
the replacement. If false, the message specifies
combinations of insert and delete operations and
includes the minimal differences between the original
and modified Elements.
In either case, when this update request is applied against the original tree by applyDiffs, the result will be the modified tree.
The setting of the replace parameter to this method does
not change the contents of the replace field in the object.
applyDiffs(Element, Element),
replace
public org.jdom.Element applyDiffs(org.jdom.Element original,
org.jdom.Element updateRequest)
throws org.jdom.JDOMException
generateDiffs(Element, Element, UniqueId),
generateDiffs(Element, Element, UniqueId, boolean)public void setProgressReporter(ProgressReporter pr)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||