Class DiffObserver
java.lang.Object
org.apache.jackrabbit.oak.spi.commit.DiffObserver
- All Implemented Interfaces:
Observer
Abstract base class for observers that use a content diff to determine
what changed between two consecutive observed states of the repository.
Subclasses just need to provide the diff handler by implementing the
getRootDiff(NodeState, NodeState, CommitInfo) method.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcontentChanged(@NotNull NodeState root, @NotNull CommitInfo info) Observes a content change.protected abstract NodeStateDiffgetRootDiff(@NotNull NodeState before, @NotNull NodeState after, @NotNull CommitInfo info) Returns the diff handler to be used for the given content change.
-
Constructor Details
-
DiffObserver
public DiffObserver()
-
-
Method Details
-
getRootDiff
protected abstract NodeStateDiff getRootDiff(@NotNull @NotNull NodeState before, @NotNull @NotNull NodeState after, @NotNull @NotNull CommitInfo info) Returns the diff handler to be used for the given content change.- Parameters:
before- state of the repository before this changesafter- state of the repository after this changesinfo- local commit information, ornullif not available- Returns:
- diff handler for this change
-
contentChanged
public final void contentChanged(@NotNull @NotNull NodeState root, @NotNull @NotNull CommitInfo info) Description copied from interface:ObserverObserves a content change. See theObserverclass javadocs and relevant repository and observer registration details for more information on when and how this method gets called.- Specified by:
contentChangedin interfaceObserver- Parameters:
root- root state of the repositoryinfo- commit information
-