public abstract class CascadeWorker<T extends DBObject>
extends java.lang.Object
| Constructor and Description |
|---|
CascadeWorker(DBObjectProvider pro) |
| Modifier and Type | Method and Description |
|---|---|
protected CascadeAction |
cascadeDelete(DBObjectID removed, DBObject referer, T obj)
Cascade deletes the given removed object.
|
CascadeAction |
cascadeDelete(DBObject removed, T obj)
Cascade deletes the given removed object.
|
protected CascadeAction |
cascadePropertyChange(Difference objDiff, java.lang.String propName, java.lang.Object oldValue, java.lang.Object newValue, T obj)
Process the given difference from a dependent object that is being updated.
|
CascadeAction |
cascadeUpdate(Difference objDiff, T obj)
Cascades the given object difference to an object this CascadeWorker is responsible for.
|
java.util.Set<java.lang.String> |
getCascadeProperties()
Gets the property names that (if changed on any object) could require cascade work to be done by this processor.
|
protected java.util.logging.Logger |
getLogger() |
protected DBObjectProvider |
getProvider() |
protected CascadeAction |
removeReference(DBObjectID removed, DBObject referer, PropertyInfo info)
This method is called when a reference is found to a deleted object.
|
public CascadeWorker(DBObjectProvider pro)
protected final DBObjectProvider getProvider()
protected final java.util.logging.Logger getLogger()
public CascadeAction cascadeDelete(DBObject removed, T obj)
removed - the object that we are cascading the delete ofobj - the object to cascade toprotected final CascadeAction cascadeDelete(DBObjectID removed, DBObject referer, T obj)
removed - the object that we are cascading the delete ofreferer - the object to cascade toobj - the top level object that owns the referer (could be the referer)protected CascadeAction removeReference(DBObjectID removed, DBObject referer, PropertyInfo info)
Note: this method will only be called if a property is found on this object (not its children) to the deleted object.
removed - the id of the deleted objectreferer - the object that has a reference to the deleted objectinfo - the PropertyInfo for the property that is the referencepublic CascadeAction cascadeUpdate(Difference objDiff, T obj)
objDiff - the changes to cascadeobj - a single object that this worker is responsible for cascading to.protected CascadeAction cascadePropertyChange(Difference objDiff, java.lang.String propName, java.lang.Object oldValue, java.lang.Object newValue, T obj)
objDiff - the full difference for the updated objectpropName - the name of the changed property we are cascadingoldValue - the old property valuenewValue - the new property valueobj - the object to cascade the change topublic java.util.Set<java.lang.String> getCascadeProperties()