Class CompositeHook

  • All Implemented Interfaces:
    CommitHook

    public class CompositeHook
    extends java.lang.Object
    implements CommitHook
    Composite commit hook. Maintains a list of component hooks and takes care of calling them in proper sequence.
    • Constructor Detail

      • CompositeHook

        public CompositeHook​(CommitHook... hooks)
    • Method Detail

      • compose

        public static CommitHook compose​(@NotNull
                                         @NotNull java.util.Collection<CommitHook> hooks)
      • 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