- All Implemented Interfaces:
ChangeSummary
Purpose:A change summary is used to record changes to DataObjects.
Responsibilities:
- Track changes to DataObjects that are within the scope of this ChangeSummary (based on the root object of the Changesummary).
- Track if those DataObjects are created, modified or deleted.
- Return the values at the time that ChangeSummary logging was turned on for DataObjects in scope.
This class is implemented as a Memento (283) [GOF - Gamma, Helm, Johnson, Vlissides] Design Pattern.
(Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later.)
The class also realizes some aspects of the Command (233) Pattern - the undo-able operation part (from the first change).
(Encapsulate a request as an object, thereby letting you parameterize clients with different requests,
queue or log requests, and support undo-able operations.)
-
Nested Class Summary
Nested classes/interfaces inherited from interface commonj.sdo.ChangeSummary
ChangeSummary.Setting -
Constructor Summary
ConstructorsConstructorDescriptionSDOChangeSummary(SDODataGraph dataGraph, HelperContext aContext) SDOChangeSummary(SDODataObject dataObject, HelperContext aContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the List ofchangesand turns change logging on.voidAn implementation that requires logging may throw an UnsupportedOperationException.Returns a list consisting of all thedata objectsthat have been changed whilelogging.INTERNAL: Return all created objectsINTERNAL:Returns thedata graphassociated with this change summary or null.INTERNAL:INTERNAL: Return all deleted objectsINTERNAL: Return all modified objectsINTERNAL:getOldContainer(DataObject dataObject) INTERNAL:getOldContainmentProperty(DataObject dataObject) Returns the value of thecontainment propertydata object property at the point when loggingbegan.getOldSequence(DataObject dataObject) INTERNAL: Return a map of original sequences keyed on DataObject (cached values).getOldValue(DataObject dataObject, Property property) getOldValues(DataObject dataObject) INTERNAL:INTERNAL: Return a map of original sequences keyed on DataObject.INTERNAL: Return the map of original ValueStores keyed ongetPropertyInternal(DataObject dataObject, Property property) INTERNAL:INTERNAL:Returns the ChangeSummary root DataObject - the object from which changes are tracked.getUnsetOCProperties(DataObject dataObject) INTERNAL: Return a List containing all open content properties that were unsetINTERNAL: Return the entire HashMap of lists of open content properties that were unset keyed on dataObjectgetUnsetProps(DataObject dataObject) INTERNAL:booleanisCreated(DataObject dataObject) Returns whether or not the specified data object was created whilelogging.booleanisDeleted(DataObject dataObject) Returns whether or not the specified data object was deleted whilelogging.booleanisDirty(DataObject dataObject) INTERNAL: Return whether thedataObjecthas been modified.booleanisDirty(ListWrapper aListWrapper) INTERNAL: Return whether theaListWrapperhas been modified.booleanisDirty(SDOSequence aSequence) INTERNAL: Return whether theaSequencehas been modified.booleanIndicates whether change logging is on (true) or off (false).booleanINTERNAL: Return the logging state during mapping operationsbooleanisModified(DataObject dataObject) Returns whether or not the specified data object was updated whilelogging.voidINTERNAL: Turn both logging flags on.voidremoveUnsetOCProperty(DataObject dataObject, Property ocKey) INTERNAL: Delete an open content property from the list of unset oc properties keyed on dataObjectvoidINTERNAL: Turn both logging flags back on.voidsetCreated(DataObject anObject, boolean created) INTERNAL: Set flag created value.voidsetCreatedXPaths(List createdXPathsList) INTERNAL:booleansetDeleted(DataObject anObject, boolean deleted) INTERNAL: Set flag modified value.voidsetDeletedXPaths(List deletedXPathsList) INTERNAL: The deletedXPaths field is picked up reflectively during marshal/unmarshal operations.voidsetHelperContext(HelperContext helperContext) INTERNAL: Set the helperContext if the default SDOChangeSummary constructor was usedvoidsetLogging(boolean logging) INTERNAL: Used by CopyHelper to set logging when creating a copy of a changesummaryvoidsetModifiedDoms(List modifiedDomsList) INTERNAL:voidsetOldContainer(SDODataObject aKey, DataObject aValue) INTERNAL:voidsetOldContainmentProperty(SDODataObject aKey, Property aValue) INTERNAL:voidsetOldSequence(SDODataObject aKey, Sequence aValue) INTERNAL:voidsetPropertyInternal(DataObject dataObject, Property property, Object value) INTERNAL:voidsetRootDataObject(DataObject dataObject) INTERNAL: Set the root DataObject for this ChangeSummary.voidsetUnsetOCProperty(DataObject dataObject, Property ocKey) INTERNAL: Add an open content property that has been unset to the list keyed on dataObjecttoString()INTERNAL: Return the string representation of the receiver.voidThis method is intended for use by service implementations only.voidunsetPropertyInternal(DataObject dataObject, Property property) INTERNAL:booleanwasSet(DataObject dataObject, Property property) INTERNAL:
-
Constructor Details
-
SDOChangeSummary
public SDOChangeSummary() -
SDOChangeSummary
-
SDOChangeSummary
-
-
Method Details
-
isLogging
public boolean isLogging()Indicates whether change logging is on (true) or off (false).- Specified by:
isLoggingin interfaceChangeSummary- Returns:
trueif change logging is on.- See Also:
-
setCreated
INTERNAL: Set flag created value.- Parameters:
created- flag created's new value.
-
setDeleted
INTERNAL: Set flag modified value.- Parameters:
deleted- flag modified's new value.
-
setOldContainer
INTERNAL:- Parameters:
aKey-aValue- void
-
getOldContainers
INTERNAL:- Returns:
-
setOldContainmentProperty
INTERNAL:- Parameters:
aKey- DataObjectaValue- Property void
-
setOldSequence
INTERNAL:- Parameters:
aKey- DataObjectaValue- Property void
-
getDataGraph
Returns thedata graphassociated with this change summary or null.- Specified by:
getDataGraphin interfaceChangeSummary- Returns:
- the data graph.
- See Also:
-
getChangedDataObjects
Returns a list consisting of all thedata objectsthat have been changed whilelogging.The
newandmodifiedobjects in the List are references to objects associated with this ChangeSummary. Thedeletedobjects in the List are references to objects at the time that event logging was enabled;Each changed object must have exactly one of the following methods return true:
isCreated,isDeleted, orisModified.- Specified by:
getChangedDataObjectsin interfaceChangeSummary- Returns:
- a list of changed data objects.
- See Also:
-
getModified
INTERNAL: Return all modified objects- Returns:
- Set
-
getDeleted
INTERNAL: Return all deleted objects- Returns:
- Set
-
getCreated
INTERNAL: Return all created objects- Returns:
- Set
-
isCreated
Returns whether or not the specified data object was created whilelogging. Any object that was added to the scope but was not in the scope when logging began, will be considered created.- Specified by:
isCreatedin interfaceChangeSummary- Parameters:
dataObject- the data object in question.- Returns:
trueif the specified data object was created.- See Also:
-
isDeleted
Returns whether or not the specified data object was deleted whilelogging. Any object that is not in scope but was in scope when logging began will be considered deleted.- Specified by:
isDeletedin interfaceChangeSummary- Parameters:
dataObject- the data object in question.- Returns:
trueif the specified data object was deleted.- See Also:
-
isModified
Returns whether or not the specified data object was updated whilelogging. An object that was contained in the scope when logging began and remains in the scope when logging ends will be considered potentially modified.An object considered modified must have at least one old value setting.
- Specified by:
isModifiedin interfaceChangeSummary- Parameters:
dataObject- the data object in question.- Returns:
trueif the specified data object was modified.- See Also:
-
getOldValues
Returns a list ofsettingsthat represent the property values of the givendataObjectat the point when loggingbegan.In the case of a
deletedobject, the List will include settings for all the Properties.An old value setting indicates the value at the point logging begins. A setting is only produced for
modifiedobjects if either the old value differs from the current value or if the isSet differs from the current value.No settings are produced for
createdobjects.- Specified by:
getOldValuesin interfaceChangeSummary- Parameters:
dataObject- the object in question.- Returns:
- a list of settings.
- See Also:
-
getUnsetProps
INTERNAL:- Parameters:
dataObject-- Returns:
-
getUnsetOCPropertiesMap
INTERNAL: Return the entire HashMap of lists of open content properties that were unset keyed on dataObject- Returns:
-
getUnsetOCProperties
INTERNAL: Return a List containing all open content properties that were unset- Parameters:
dataObject-- Returns:
-
setUnsetOCProperty
INTERNAL: Add an open content property that has been unset to the list keyed on dataObject- Parameters:
dataObject-ocKey-
-
removeUnsetOCProperty
INTERNAL: Delete an open content property from the list of unset oc properties keyed on dataObject- Parameters:
dataObject-ocKey-
-
beginLogging
public void beginLogging()Clears the List ofchangesand turns change logging on. No operation occurs if logging is already on.- Specified by:
beginLoggingin interfaceChangeSummary- See Also:
-
resumeLogging
public void resumeLogging()INTERNAL: Turn both logging flags back on. -
endLogging
public void endLogging()An implementation that requires logging may throw an UnsupportedOperationException. Turns change logging off. No operation occurs if logging is already off.- Specified by:
endLoggingin interfaceChangeSummary- See Also:
-
pauseLogging
public void pauseLogging()INTERNAL: Turn both logging flags on. -
getRootObject
Returns the ChangeSummary root DataObject - the object from which changes are tracked. When a DataGraph is used, this is the same as getDataGraph().getRootObject().- Specified by:
getRootObjectin interfaceChangeSummary- Returns:
- the ChangeSummary root DataObject
-
getOldValue
Returns asettingfor the specified property representing the property value of the givendataObjectat the point when loggingbegan.Returns null if the property was not modified and has not been
deleted.- Specified by:
getOldValuein interfaceChangeSummary- Parameters:
dataObject- the object in question.property- the property of the object.- Returns:
- the Setting for the specified property.
- See Also:
-
getOldContainer
- Specified by:
getOldContainerin interfaceChangeSummary- Parameters:
dataObject- the object in question.- Returns:
- the old container data object.
-
getOldContainmentProperty
Returns the value of thecontainment propertydata object property at the point when loggingbegan.- Specified by:
getOldContainmentPropertyin interfaceChangeSummary- Parameters:
dataObject- the object in question.- Returns:
- the old containment property.
-
getOldSequence
- Specified by:
getOldSequencein interfaceChangeSummary- Parameters:
dataObject- the object in question.- Returns:
- the old containment property.
-
undoChanges
public void undoChanges()This method is intended for use by service implementations only. Undoes all changes in the log to restore the tree of DataObjects to its original state when logging began. isLogging() is unchanged. The log is cleared.- Specified by:
undoChangesin interfaceChangeSummary- See Also:
-
setRootDataObject
INTERNAL: Set the root DataObject for this ChangeSummary.- Parameters:
dataObject- the root of DataObject tree this ChangeSummary belongs to
-
setLogging
public void setLogging(boolean logging) INTERNAL: Used by CopyHelper to set logging when creating a copy of a changesummary- Parameters:
logging- logging status
-
setHelperContext
INTERNAL: Set the helperContext if the default SDOChangeSummary constructor was used- Parameters:
helperContext-
-
setCreatedXPaths
INTERNAL:- Parameters:
createdXPathsList-
-
getCreatedXPaths
INTERNAL:- Returns:
-
isLoggingMapping
public boolean isLoggingMapping()INTERNAL: Return the logging state during mapping operations- Returns:
- logging state
-
setModifiedDoms
INTERNAL:- Parameters:
modifiedDomsList-
-
getModifiedDoms
INTERNAL:- Returns:
-
setDeletedXPaths
INTERNAL: The deletedXPaths field is picked up reflectively during marshal/unmarshal operations.- Parameters:
deletedXPathsList-
-
getOldContainmentProperty
-
getOldContainer
-
wasSet
INTERNAL:- Parameters:
dataObject-property-- Returns:
-
getPropertyInternal
INTERNAL:- Parameters:
dataObject-property-- Returns:
-
setPropertyInternal
INTERNAL:- Parameters:
dataObject-property-value-
-
getOriginalValueStores
INTERNAL: Return the map of original ValueStores keyed on- Returns:
-
isDirty
INTERNAL: Return whether thedataObjecthas been modified.- Parameters:
dataObject-- Returns:
-
isDirty
INTERNAL: Return whether theaListWrapperhas been modified.- Parameters:
aListWrapper-- Returns:
-
isDirty
INTERNAL: Return whether theaSequencehas been modified.- Parameters:
aSequence-- Returns:
-
unsetPropertyInternal
INTERNAL:- Parameters:
dataObject-property-
-
getOriginalElements
INTERNAL:- Returns:
- Map of original elements, key and value are both listwrappers
-
getDeepCopies
INTERNAL:- Returns:
- Map of deep copies of DataObjects key is original dataobject
-
getReverseDeletedMap
INTERNAL:- Returns:
- Map of deep copies of DataObjects key is copy of dataobject
-
getOriginalSequences
INTERNAL: Return a map of original sequences keyed on DataObject.- Returns:
- Map of old Sequences
-
getOldSequences
INTERNAL: Return a map of original sequences keyed on DataObject (cached values).- Returns:
- Map of old Sequences that have deep copies of all DataObjects
-
toString
INTERNAL: Return the string representation of the receiver.
-