Class ReadWriteVersionManager
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.version.ReadOnlyVersionManager
-
- org.apache.jackrabbit.oak.jcr.version.ReadWriteVersionManager
-
public class ReadWriteVersionManager extends ReadOnlyVersionManager
ReadWriteVersionManager...
-
-
Constructor Summary
Constructors Constructor Description ReadWriteVersionManager(@NotNull SessionDelegate sessionDelegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVersionLabel(@NotNull VersionStorage versionStorage, @NotNull String versionHistoryOakRelPath, @NotNull String versionIdentifier, @NotNull String oakVersionLabel, boolean moveLabel)@NotNull Treecheckin(@NotNull Tree versionable)Performs a checkin on a versionable tree and returns the tree that represents the created version.voidcheckout(@NotNull Root workspaceRoot, @NotNull String versionablePath)Performs a checkout on a versionable tree.protected @NotNull ReadOnlyNodeTypeManagergetNodeTypeManager()protected @NotNull TreegetVersionStorage()protected @NotNull RootgetWorkspaceRoot()/**protected voidrefresh()Called by the write methods to refresh the state of the possible session associated with this instance.voidremoveVersion(@NotNull VersionStorage versionStorage, @NotNull String versionHistoryOakRelPath, @NotNull String oakVersionName)voidremoveVersionLabel(@NotNull VersionStorage versionStorage, @NotNull String versionHistoryOakRelPath, @NotNull String oakVersionLabel)-
Methods inherited from class org.apache.jackrabbit.oak.plugins.version.ReadOnlyVersionManager
checkVersionable, getBaseVersion, getIdentifierManager, getInstance, getVersion, getVersionable, getVersionHistory, getVersionHistoryPath, isCheckedOut, isVersionable, isVersionStoreTree
-
-
-
-
Constructor Detail
-
ReadWriteVersionManager
public ReadWriteVersionManager(@NotNull @NotNull SessionDelegate sessionDelegate)
-
-
Method Detail
-
refresh
protected void refresh() throws RepositoryExceptionCalled by the write methods to refresh the state of the possible session associated with this instance. The default implementation of this method does nothing, but a subclass can use this callback to keep a session in sync with the persisted version changes.- Throws:
RepositoryException- if the session could not be refreshed
-
getVersionStorage
@NotNull protected @NotNull Tree getVersionStorage()
- Specified by:
getVersionStoragein classReadOnlyVersionManager- Returns:
- the read-only
Treefor the jcr:versionStorage node. The returnedTreeinstance must be up-to-date with theRootreturned byReadOnlyVersionManager.getWorkspaceRoot().
-
getWorkspaceRoot
@NotNull protected @NotNull Root getWorkspaceRoot()
Description copied from class:ReadOnlyVersionManager/**- Specified by:
getWorkspaceRootin classReadOnlyVersionManager- Returns:
- the
Rootof the workspace.
-
getNodeTypeManager
@NotNull protected @NotNull ReadOnlyNodeTypeManager getNodeTypeManager()
- Specified by:
getNodeTypeManagerin classReadOnlyVersionManager- Returns:
- the node type manager of this repository.
-
checkin
@NotNull public @NotNull Tree checkin(@NotNull @NotNull Tree versionable) throws RepositoryException, InvalidItemStateException, UnsupportedRepositoryOperationException
Performs a checkin on a versionable tree and returns the tree that represents the created version.- Parameters:
versionable- the versionable node to check in.- Returns:
- the created version.
- Throws:
InvalidItemStateException- if the current root has pending changes.UnsupportedRepositoryOperationException- if the versionable tree isn't actually versionable.RepositoryException- if an error occurs while checking the node type of the tree.
-
checkout
public void checkout(@NotNull @NotNull Root workspaceRoot, @NotNull @NotNull String versionablePath) throws UnsupportedRepositoryOperationException, InvalidItemStateException, RepositoryExceptionPerforms a checkout on a versionable tree.- Parameters:
workspaceRoot- a fresh workspace root without pending changes.versionablePath- the absolute path to the versionable node to check out.- Throws:
UnsupportedRepositoryOperationException- if the versionable tree isn't actually versionable.RepositoryException- if an error occurs while checking the node type of the tree.IllegalStateException- if the workspaceRoot has pending changes.IllegalArgumentException- if theversionablePathis not absolute.InvalidItemStateException
-
addVersionLabel
public void addVersionLabel(@NotNull @NotNull VersionStorage versionStorage, @NotNull @NotNull String versionHistoryOakRelPath, @NotNull @NotNull String versionIdentifier, @NotNull @NotNull String oakVersionLabel, boolean moveLabel) throws RepositoryException- Throws:
RepositoryException
-
removeVersionLabel
public void removeVersionLabel(@NotNull @NotNull VersionStorage versionStorage, @NotNull @NotNull String versionHistoryOakRelPath, @NotNull @NotNull String oakVersionLabel) throws RepositoryException- Throws:
RepositoryException
-
removeVersion
public void removeVersion(@NotNull @NotNull VersionStorage versionStorage, @NotNull @NotNull String versionHistoryOakRelPath, @NotNull @NotNull String oakVersionName) throws RepositoryException- Throws:
RepositoryException
-
-