Class RevisionContextWrapper

  • All Implemented Interfaces:
    RevisionContext

    public final class RevisionContextWrapper
    extends java.lang.Object
    implements RevisionContext
    Wraps an existing revision context and exposes a custom clusterId.
    • Constructor Detail

      • RevisionContextWrapper

        public RevisionContextWrapper​(RevisionContext context,
                                      int clusterId)
    • Method Detail

      • getBranches

        public org.apache.jackrabbit.oak.plugins.document.UnmergedBranches getBranches()
        Specified by:
        getBranches in interface RevisionContext
        Returns:
        the branches of the local DocumentMK instance, which are not yet merged.
      • getPendingModifications

        public org.apache.jackrabbit.oak.plugins.document.UnsavedModifications getPendingModifications()
        Specified by:
        getPendingModifications in interface RevisionContext
        Returns:
        the pending modifications.
      • getClusterId

        public int getClusterId()
        Specified by:
        getClusterId in interface RevisionContext
        Returns:
        the cluster id of the local DocumentMK instance.
      • newRevision

        @NotNull
        public @NotNull Revision newRevision()
        Specified by:
        newRevision in interface RevisionContext
        Returns:
        a new revision for the local document node store instance.
      • getClock

        @NotNull
        public @NotNull Clock getClock()
        Specified by:
        getClock in interface RevisionContext
        Returns:
        the clock in use when a new revision is created.
      • getCommitValue

        public java.lang.String getCommitValue​(@NotNull
                                               @NotNull Revision revision,
                                               @NotNull
                                               @NotNull NodeDocument nodeDocument)
        Description copied from interface: RevisionContext
        Retrieves the commit value for a given change. This method returns the following types of commit values:
        • "c" : the change revision is committed as is.
        • "c-rX-Y-Z" : the change revision is a branch commit merged in revision "rX-Y-Z".
        • "brX-Y-Z" : the change revision is a branch commit done at "rX-Y-Z" but not yet merged.
        • null : the change revision does not have an entry on the commit root document and is not committed.
        Specified by:
        getCommitValue in interface RevisionContext
        Parameters:
        revision - the revision a change was made.
        nodeDocument - the document where the change was made.
        Returns:
        the commit value or null if the change does not have a commit value (yet).