Class VersionHook

  • All Implemented Interfaces:
    CommitHook

    public class VersionHook
    extends Object
    implements CommitHook
    This class gathers together editors related to handling version storage:
    1. VersionEditorProvider
      • VersionEditor - creates version history, handles checking-in, checking-out and restoring, prevents a checked-in node from being modified,
      • VersionStorageEditor - validates changes on the version storage,
    2. VersionableCollector - collects all existing versionable UUIDs, so assigned histories won't be removed in the next step,
    3. OrphanedVersionCleaner - removes all histories that are empty and have no longer a parent versionable node.
    • Constructor Detail

      • VersionHook

        public VersionHook()
    • Method Detail

      • processCommit

        @NotNull
        public @NotNull NodeState processCommit​(NodeState before,
                                                NodeState after,
                                                CommitInfo info)
                                         throws CommitFailedException
        Description copied from interface: CommitHook
        Validates and/or modifies the given content change before it gets persisted.
        Specified by:
        processCommit in interface CommitHook
        Parameters:
        before - content tree before the commit
        after - content tree prepared for the commit
        info - metadata associated with this commit
        Returns:
        content tree to be committed
        Throws:
        CommitFailedException - if the commit should be rejected