public interface Observer
An observer is informed about content changes by calling the
contentChanged(NodeState, CommitInfo) method. The frequency and
granularity of these callbacks is not specified. However, each observer is
always guaranteed to see a linear sequence of changes. In other words the
method will not be called concurrently from multiple threads and successive
calls represent a linear sequence of repository states, i.e. the root
state passed to a call is guaranteed to represent a repository state
that is not newer than the root state passed to the next call. The observer
is expected to keep track of the previously observed state if it wants to
use a content diff to determine what exactly changed between two states.
For local changes repository passes in a
CommitInfo instance which
was used as part of commit and make it available to observers along with the
committed content changes. In such cases, i.e. when the commit info argument is
null, the reported content change is guaranteed to contain
only changes from that specific commit (and the applied commit
hooks). Note that it is possible for a repository to report commit
information for only some commits but not others.
It should also be noted that two observers may not necessarily see the same sequence of content changes. It is also possible for an observer to be notified when no actual content changes have happened therefore passing the same root state to subsequent calls.
A specific implementation or deployment may offer more guarantees about when and how observers are notified of content changes. See the relevant documentation for more details about such cases.
void contentChanged(@Nonnull NodeState root, @Nonnull CommitInfo info)
Observerclass javadocs and relevant repository and observer registration details for more information on when and how this method gets called.
root- root state of the repository
info- commit information
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.