org.apache.jackrabbit.oak.jcr.version
Class ReadWriteVersionManager
java.lang.Object
org.apache.jackrabbit.oak.plugins.version.ReadOnlyVersionManager
org.apache.jackrabbit.oak.jcr.version.ReadWriteVersionManager
public class ReadWriteVersionManager
- extends org.apache.jackrabbit.oak.plugins.version.ReadOnlyVersionManager
ReadWriteVersionManager
...
Method Summary |
void |
addVersionLabel(VersionStorage versionStorage,
String versionHistoryOakRelPath,
String versionOakName,
String oakVersionLabel,
boolean moveLabel)
|
org.apache.jackrabbit.oak.api.Tree |
checkin(org.apache.jackrabbit.oak.api.Tree versionable)
Performs a checkin on a versionable tree and returns the tree that
represents the created version. |
void |
checkout(org.apache.jackrabbit.oak.api.Root workspaceRoot,
String versionablePath)
Performs a checkout on a versionable tree. |
protected org.apache.jackrabbit.oak.plugins.nodetype.ReadOnlyNodeTypeManager |
getNodeTypeManager()
|
protected org.apache.jackrabbit.oak.api.Tree |
getVersionStorage()
|
protected org.apache.jackrabbit.oak.api.Root |
getWorkspaceRoot()
|
protected void |
refresh()
Called by the write methods to refresh the state of the possible
session associated with this instance. |
void |
removeVersion(VersionStorage versionStorage,
String versionHistoryOakRelPath,
String oakVersionName)
|
void |
removeVersionLabel(VersionStorage versionStorage,
String versionHistoryOakRelPath,
String oakVersionLabel)
|
Methods inherited from class org.apache.jackrabbit.oak.plugins.version.ReadOnlyVersionManager |
checkVersionable, getBaseVersion, getIdentifierManager, getVersionHistory, getVersionHistoryPath, isCheckedOut, isVersionable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReadWriteVersionManager
public ReadWriteVersionManager(@Nonnull
SessionDelegate sessionDelegate)
refresh
protected void refresh()
throws javax.jcr.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:
javax.jcr.RepositoryException
- if the session could not be refreshed
getVersionStorage
@Nonnull
protected org.apache.jackrabbit.oak.api.Tree getVersionStorage()
- Specified by:
getVersionStorage
in class org.apache.jackrabbit.oak.plugins.version.ReadOnlyVersionManager
getWorkspaceRoot
@Nonnull
protected org.apache.jackrabbit.oak.api.Root getWorkspaceRoot()
- Specified by:
getWorkspaceRoot
in class org.apache.jackrabbit.oak.plugins.version.ReadOnlyVersionManager
getNodeTypeManager
@Nonnull
protected org.apache.jackrabbit.oak.plugins.nodetype.ReadOnlyNodeTypeManager getNodeTypeManager()
- Specified by:
getNodeTypeManager
in class org.apache.jackrabbit.oak.plugins.version.ReadOnlyVersionManager
checkin
@Nonnull
public org.apache.jackrabbit.oak.api.Tree checkin(@Nonnull
org.apache.jackrabbit.oak.api.Tree versionable)
throws javax.jcr.RepositoryException,
javax.jcr.InvalidItemStateException,
javax.jcr.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:
javax.jcr.InvalidItemStateException
- if the current root has pending
changes.
javax.jcr.UnsupportedRepositoryOperationException
- if the versionable tree isn't actually
versionable.
javax.jcr.RepositoryException
- if an error occurs while checking the
node type of the tree.
checkout
public void checkout(@Nonnull
org.apache.jackrabbit.oak.api.Root workspaceRoot,
@Nonnull
String versionablePath)
throws javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.InvalidItemStateException,
javax.jcr.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:
javax.jcr.UnsupportedRepositoryOperationException
- if the versionable tree isn't actually
versionable.
javax.jcr.RepositoryException
- if an error occurs while checking the
node type of the tree.
IllegalStateException
- if the workspaceRoot has pending changes.
IllegalArgumentException
- if the versionablePath
is
not absolute.
javax.jcr.InvalidItemStateException
addVersionLabel
public void addVersionLabel(@Nonnull
VersionStorage versionStorage,
@Nonnull
String versionHistoryOakRelPath,
@Nonnull
String versionOakName,
@Nonnull
String oakVersionLabel,
boolean moveLabel)
throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
removeVersionLabel
public void removeVersionLabel(@Nonnull
VersionStorage versionStorage,
@Nonnull
String versionHistoryOakRelPath,
@Nonnull
String oakVersionLabel)
throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
removeVersion
public void removeVersion(@Nonnull
VersionStorage versionStorage,
@Nonnull
String versionHistoryOakRelPath,
@Nonnull
String oakVersionName)
throws javax.jcr.RepositoryException
- Throws:
javax.jcr.RepositoryException
Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.