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 void
addVersionLabel(@NotNull VersionStorage versionStorage, @NotNull String versionHistoryOakRelPath, @NotNull String versionIdentifier, @NotNull String oakVersionLabel, boolean moveLabel)
@NotNull Tree
checkin(@NotNull Tree versionable)
Performs a checkin on a versionable tree and returns the tree that represents the created version.void
checkout(@NotNull Root workspaceRoot, @NotNull String versionablePath)
Performs a checkout on a versionable tree.protected @NotNull ReadOnlyNodeTypeManager
getNodeTypeManager()
protected @NotNull Tree
getVersionStorage()
protected @NotNull Root
getWorkspaceRoot()
/**protected void
refresh()
Called by the write methods to refresh the state of the possible session associated with this instance.void
removeVersion(@NotNull VersionStorage versionStorage, @NotNull String versionHistoryOakRelPath, @NotNull String oakVersionName)
void
removeVersionLabel(@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 RepositoryException
Called 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:
getVersionStorage
in classReadOnlyVersionManager
- Returns:
- the read-only
Tree
for the jcr:versionStorage node. The returnedTree
instance must be up-to-date with theRoot
returned byReadOnlyVersionManager.getWorkspaceRoot()
.
-
getWorkspaceRoot
@NotNull protected @NotNull Root getWorkspaceRoot()
Description copied from class:ReadOnlyVersionManager
/**- Specified by:
getWorkspaceRoot
in classReadOnlyVersionManager
- Returns:
- the
Root
of the workspace.
-
getNodeTypeManager
@NotNull protected @NotNull ReadOnlyNodeTypeManager getNodeTypeManager()
- Specified by:
getNodeTypeManager
in 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, RepositoryException
Performs 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 theversionablePath
is 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
-
-