Class ChangeSet
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.observation.ChangeSet
-
public final class ChangeSet extends Object
A ChangeSet is a collection of items that have been changed as part of a commit. A ChangeSet is immutable and built by a ChangeSetBuilder.Those items are parent paths, parent node names, parent node types and (child) properties. 'Changed' refers to any of add, remove, change (where applicable).
A ChangeSet is piggybacked on a CommitInfo in the CommitContext and can be used by (downstream) Observers for their convenience.
To limit memory usage, the ChangeSet has a limit on the number of items, each, that it collects. If one of those items reach the limit this is called an 'overflow' and the corresponding item type is marked as having 'overflown'. Downstream Observers should thus check if a particular item has overflown or not - this is indicated with null as the return value of the corresponding getters (while empty means: not overflown but nothing changed of that type).
Also, the ChangeSet carries a 'maxPathDepth' which is the depth of the path up until which paths have been collected. Thus any path that is longer than this 'maxPathDepth' will be cut off and only reported up to that max depth. Downstream Observers should thus inspect the 'maxPathDepth' and compare actual path depths with it in order to find out if any child paths have been cut off.
Naming: note that path, node name and node types all refer to the *parent* of a change. While properties naturally are leafs.
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMMIT_CONTEXT_OBSERVATION_CHANGESET
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
anyOverflow()
String
asString()
boolean
doesHitMaxPathDepth()
boolean
equals(Object o)
static ChangeSet
fromString(String json)
@Nullable Set<String>
getAllNodeTypes()
int
getMaxPrefilterPathDepth()
@Nullable Set<String>
getParentNodeNames()
@Nullable Set<String>
getParentNodeTypes()
@Nullable Set<String>
getParentPaths()
@Nullable Set<String>
getPropertyNames()
int
hashCode()
String
toString()
-
-
-
Field Detail
-
COMMIT_CONTEXT_OBSERVATION_CHANGESET
public static final String COMMIT_CONTEXT_OBSERVATION_CHANGESET
- See Also:
- Constant Field Values
-
-
Method Detail
-
doesHitMaxPathDepth
public boolean doesHitMaxPathDepth()
-
getMaxPrefilterPathDepth
public int getMaxPrefilterPathDepth()
-
anyOverflow
public boolean anyOverflow()
-
asString
public String asString()
-
-