Class RevisionContextWrapper
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.document.RevisionContextWrapper
-
- All Implemented Interfaces:
RevisionContext
public final class RevisionContextWrapper extends Object implements RevisionContext
Wraps an existing revision context and exposes a customclusterId
.
-
-
Constructor Summary
Constructors Constructor Description RevisionContextWrapper(RevisionContext context, int clusterId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.jackrabbit.oak.plugins.document.UnmergedBranches
getBranches()
@NotNull Clock
getClock()
int
getClusterId()
String
getCommitValue(@NotNull Revision revision, @NotNull NodeDocument nodeDocument)
Retrieves the commit value for a given change.@NotNull RevisionVector
getHeadRevision()
org.apache.jackrabbit.oak.plugins.document.UnsavedModifications
getPendingModifications()
@NotNull Revision
newRevision()
-
-
-
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 interfaceRevisionContext
- 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 interfaceRevisionContext
- Returns:
- the pending modifications.
-
getClusterId
public int getClusterId()
- Specified by:
getClusterId
in interfaceRevisionContext
- Returns:
- the cluster id of the local DocumentMK instance.
-
getHeadRevision
@NotNull public @NotNull RevisionVector getHeadRevision()
- Specified by:
getHeadRevision
in interfaceRevisionContext
- Returns:
- the current head revision.
-
newRevision
@NotNull public @NotNull Revision newRevision()
- Specified by:
newRevision
in interfaceRevisionContext
- Returns:
- a new revision for the local document node store instance.
-
getClock
@NotNull public @NotNull Clock getClock()
- Specified by:
getClock
in interfaceRevisionContext
- Returns:
- the clock in use when a new revision is created.
-
getCommitValue
public 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 interfaceRevisionContext
- 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).
-
-