public class CoreChangeSummary extends Object implements PlasmaChangeSummary, Serializable
ChangeSummary.Setting| Constructor and Description |
|---|
CoreChangeSummary(PlasmaDataGraph dataGraph) |
| Modifier and Type | Method and Description |
|---|---|
void |
beginLogging()
Clears the List of
changes and turns change logging on. |
void |
clear(DataObject dataObject)
Removes all change information for the given data object
within this change summary.
|
void |
created(DataObject dataObject)
Register the given data object as a created object
within this change summary.
|
void |
deleted(DataObject dataObject)
Register the given data object as a deleted object
within this change summary.
|
void |
endLogging()
An implementation that requires logging may throw an UnsupportedOperationException.
|
List<DataObject> |
getChangedDataObjects()
Returns a list consisting of all the
data objects that
have been changed while logging. |
DataGraph |
getDataGraph()
Returns the
data graph associated with this change summary or null. |
DataObject |
getOldContainer(DataObject dataObject)
|
Property |
getOldContainmentProperty(DataObject dataObject)
Returns the value of the
containment property data object property
at the point when logging began. |
Sequence |
getOldSequence(DataObject dataObject)
|
ChangeSummary.Setting |
getOldValue(DataObject dataObject,
Property property)
Returns a
setting for the specified property
representing the property value of the given dataObject
at the point when logging began. |
List<ChangeSummary.Setting> |
getOldValues(DataObject dataObject)
Returns a list of
settings
that represent the property values of the given dataObject
at the point when logging began. |
int |
getPathDepth(DataObject dataObject)
Returns the path depth within the data graph for the given
data object.
|
DataObject |
getRootObject()
Returns the ChangeSummary root DataObject - the object from which
changes are tracked.
|
boolean |
isCreated(DataObject dataObject)
Returns whether or not the specified data object was created while
logging. |
boolean |
isDeleted(DataObject dataObject)
Returns whether or not the specified data object was deleted while
logging. |
boolean |
isLogging()
Indicates whether change logging is on (
true) or off (false). |
boolean |
isModified(DataObject dataObject)
Returns whether or not the specified data object was updated while
logging. |
void |
modified(DataObject dataObject,
Property property,
Object value)
Register the given data object as a modified object
within this change summary for the given property.
|
String |
toString() |
void |
undoChanges()
This method is intended for use by service implementations only.
|
public CoreChangeSummary(PlasmaDataGraph dataGraph)
public void created(DataObject dataObject)
PlasmaChangeSummarycreated in interface PlasmaChangeSummarydataObject - the created data objectpublic void deleted(DataObject dataObject)
PlasmaChangeSummarydeleted in interface PlasmaChangeSummarydataObject - the deleted data objectpublic void modified(DataObject dataObject, Property property, Object value)
PlasmaChangeSummarymodified in interface PlasmaChangeSummarydataObject - the modified data objectproperty - the modified propertyvalue - the previous value for the given propertypublic void clear(DataObject dataObject)
PlasmaChangeSummaryclear in interface PlasmaChangeSummarydataObject - the data objectpublic void beginLogging()
changes and turns change logging on.
No operation occurs if logging is already on.beginLogging in interface ChangeSummaryendLogging(),
isLogging()public void endLogging()
endLogging in interface ChangeSummarybeginLogging(),
isLogging()public List<DataObject> getChangedDataObjects()
data objects that
have been changed while logging.
The new and modified objects in the
List are references to objects
associated with this ChangeSummary.
The deleted objects 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, or
isModified.
getChangedDataObjects in interface ChangeSummaryisCreated(DataObject),
isDeleted(DataObject),
isModified(DataObject)public DataGraph getDataGraph()
data graph associated with this change summary or null.getDataGraph in interface ChangeSummaryDataGraph.getChangeSummary()public DataObject getOldContainer(DataObject dataObject)
getOldContainer in interface ChangeSummarydataObject - the object in question.public Property getOldContainmentProperty(DataObject dataObject)
containment property data object property
at the point when logging began.getOldContainmentProperty in interface ChangeSummarydataObject - the object in question.public Sequence getOldSequence(DataObject dataObject)
getOldSequence in interface ChangeSummarydataObject - the object in question.public ChangeSummary.Setting getOldValue(DataObject dataObject, Property property)
setting for the specified property
representing the property value of the given dataObject
at the point when logging began.
Returns null if the property was not modified and
has not been deleted.
getOldValue in interface ChangeSummarydataObject - the object in question.property - the property of the object.getChangedDataObjects()public List<ChangeSummary.Setting> getOldValues(DataObject dataObject)
settings
that represent the property values of the given dataObject
at the point when logging began.
In the case of a deleted object,
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
modified objects if
either the old value differs from the current value or
if the isSet differs from the current value.
No settings are produced for created objects.
getOldValues in interface ChangeSummarydataObject - the object in question.getChangedDataObjects()public DataObject getRootObject()
getRootObject in interface ChangeSummarypublic boolean isCreated(DataObject dataObject)
logging.
Any object that was added to the scope
but was not in the scope when logging began,
will be considered created.isCreated in interface ChangeSummarydataObject - the data object in question.true if the specified data object was created.getChangedDataObjects()public boolean isModified(DataObject dataObject)
logging.
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.
isModified in interface ChangeSummarydataObject - the data object in question.true if the specified data object was modified.getChangedDataObjects()public boolean isDeleted(DataObject dataObject)
logging.
Any object that is not in scope but was in scope when logging began
will be considered deleted.isDeleted in interface ChangeSummarydataObject - the data object in question.true if the specified data object was deleted.getChangedDataObjects()public int getPathDepth(DataObject dataObject)
PlasmaChangeSummarygetPathDepth in interface PlasmaChangeSummarydataObject - the data objectpublic boolean isLogging()
true) or off (false).isLogging in interface ChangeSummarytrue if change logging is on.beginLogging(),
endLogging()public void undoChanges()
undoChanges in interface ChangeSummarybeginLogging(),
endLogging(),
isLogging()Copyright © 2017. All rights reserved.