Class ReadWriteVersionManager
java.lang.Object
org.apache.jackrabbit.oak.plugins.version.ReadOnlyVersionManager
org.apache.jackrabbit.oak.plugins.version.ReadWriteVersionManager
Extends the
ReadOnlyVersionManager with methods to modify the
version store.-
Constructor Summary
ConstructorsConstructorDescriptionReadWriteVersionManager(NodeBuilder versionStorageNode, NodeBuilder workspaceRoot) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckin(@NotNull NodeBuilder versionable) voidcheckout(NodeBuilder versionable) @NotNull NodeBuildergetOrCreateVersionHistory(@NotNull NodeBuilder versionable, @NotNull Map<String, Object> infoMap) Gets or creates the version history for the givenversionablenode.voidremoveVersionLabel(@NotNull String historyRelPath, @NotNull String label) Removes a version label from the jcr:versionLabels node of the referenced version history.voidrestore(@NotNull NodeBuilder versionable, @NotNull String versionUUID, @Nullable org.apache.jackrabbit.oak.plugins.version.VersionSelector selector) Methods inherited from class org.apache.jackrabbit.oak.plugins.version.ReadOnlyVersionManager
getBaseVersion, getInstance, getVersion, getVersionable, getVersionHistory, getVersionHistoryPath, isCheckedOut, isVersionStoreTree
-
Constructor Details
-
ReadWriteVersionManager
-
-
Method Details
-
getOrCreateVersionHistory
@NotNull public @NotNull NodeBuilder getOrCreateVersionHistory(@NotNull @NotNull NodeBuilder versionable, @NotNull @NotNull Map<String, Object> infoMap) Gets or creates the version history for the givenversionablenode.- Parameters:
versionable- the versionable node.infoMap- The additional information as provided byCommitInfo.getInfo()- Returns:
- the version history node.
- Throws:
IllegalArgumentException- if the given node does not have ajcr:uuidproperty.
-
checkout
-
checkin
- Throws:
CommitFailedException
-
restore
public void restore(@NotNull @NotNull NodeBuilder versionable, @NotNull @NotNull String versionUUID, @Nullable @Nullable org.apache.jackrabbit.oak.plugins.version.VersionSelector selector) throws CommitFailedException - Throws:
CommitFailedException
-
removeVersionLabel
public void removeVersionLabel(@NotNull @NotNull String historyRelPath, @NotNull @NotNull String label) throws CommitFailedException Removes a version label from the jcr:versionLabels node of the referenced version history.- Parameters:
historyRelPath- relative path from the jcr:versionStorage node to the version history node.label- the version label.- Throws:
CommitFailedException- if there is no such version history or if there is no label with the given name.
-