public abstract class ReadOnlyVersionManager
extends java.lang.Object
ReadOnlyVersionManager
provides implementations for read-only
version operations modeled after the ones available in VersionManager
.Constructor and Description |
---|
ReadOnlyVersionManager() |
Modifier and Type | Method and Description |
---|---|
@Nullable Tree |
getBaseVersion(@NotNull Tree versionable)
Returns the tree representing the base version of the given versionable
tree or
null if none exists yet. |
static @NotNull ReadOnlyVersionManager |
getInstance(Root root,
NamePathMapper namePathMapper)
Return a new instance of
ReadOnlyVersionManager that reads version
information from the tree at VersionConstants.VERSION_STORE_PATH . |
@Nullable Tree |
getVersion(@NotNull java.lang.String uuid)
Returns the version tree with the given uuid.
|
@Nullable Tree |
getVersionable(@NotNull Tree versionTree,
@NotNull java.lang.String workspaceName)
Tries to retrieve the tree corresponding to specified
versionTree
outside of the version storage based on versionable path information
stored with the version history. |
@Nullable Tree |
getVersionHistory(@NotNull Tree versionable)
Returns the tree representing the version history of the given
versionable tree or
null if none exists yet. |
@NotNull java.lang.String |
getVersionHistoryPath(@NotNull java.lang.String uuid)
Returns the path of the version history for the given
uuid . |
boolean |
isCheckedOut(@NotNull Tree tree)
Returns
true if the tree is checked out; otherwise
false . |
static boolean |
isVersionStoreTree(@NotNull Tree tree)
Returns
true if the specified tree has VersionConstants.REP_VERSIONSTORAGE
defines as primary node type i.e. |
@NotNull public static @NotNull ReadOnlyVersionManager getInstance(Root root, NamePathMapper namePathMapper)
ReadOnlyVersionManager
that reads version
information from the tree at VersionConstants.VERSION_STORE_PATH
.root
- The root to read version information from.namePathMapper
- The NamePathMapper
to use.ReadOnlyVersionManager
.public boolean isCheckedOut(@NotNull @NotNull Tree tree)
true
if the tree is checked out; otherwise
false
. The root node is always considered checked out.tree
- the tree to check.@Nullable public @Nullable Tree getVersionHistory(@NotNull @NotNull Tree versionable) throws UnsupportedRepositoryOperationException, RepositoryException
null
if none exists yet.versionable
- the versionable tree.null
if none exists yet.UnsupportedRepositoryOperationException
- if the versionable tree is not actually
versionable.RepositoryException
- if an error occurs while checking the node
type of the tree.@Nullable public @Nullable Tree getVersion(@NotNull @NotNull java.lang.String uuid)
uuid
- the uuid of the version tree.null
if there is none.@NotNull public @NotNull java.lang.String getVersionHistoryPath(@NotNull @NotNull java.lang.String uuid)
uuid
.
The returned path is relative to the version storage tree as returned
by getVersionStorage()
.uuid
- the uuid of the versionable node@Nullable public @Nullable Tree getBaseVersion(@NotNull @NotNull Tree versionable) throws UnsupportedRepositoryOperationException, RepositoryException
null
if none exists yet. This is the case when a
versionable node is created, but is not yet saved.versionable
- the versionable tree.null
.UnsupportedRepositoryOperationException
- if the versionable tree is not actually
versionable.RepositoryException
- if an error occurs while checking the node
type of the tree.public static boolean isVersionStoreTree(@NotNull @NotNull Tree tree)
true
if the specified tree has VersionConstants.REP_VERSIONSTORAGE
defines as primary node type i.e. is part of the intermediate version storage
structure that contains the version histories and the versions.tree
- The tree to be tested.true
if the target node has VersionConstants.REP_VERSIONSTORAGE
defines as primary node type; false
otherwise.@Nullable public @Nullable Tree getVersionable(@NotNull @NotNull Tree versionTree, @NotNull @NotNull java.lang.String workspaceName)
versionTree
outside of the version storage based on versionable path information
stored with the version history. The following cases are distinguished:
null
is returned.null
will be returned.versionTree
- The tree from within the version storage for which
that versionable correspondent should be retrieved.workspaceName
- The name of the workspace for which the target should be retrieved.null
if the
versionable path property for the specified workspace is missing or if
the given tree is not located within the tree structure defined by a version history.VersionConstants.MIX_REP_VERSIONABLE_PATHS
Copyright © 2010 - 2020 Adobe. All Rights Reserved