Package org.apache.jackrabbit.core
Class VersionManagerImpl
-
- All Implemented Interfaces:
VersionManager
public class VersionManagerImpl extends VersionManagerImplConfig implements VersionManager
Implementation of theVersionManager
.This class implements the JCR Version Manager interface but most of the operations are performed in the super classes. this is only cosmetic to avoid huge source files.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jackrabbit.core.version.VersionManagerImplBase
VersionManagerImplBase.WriteOperation
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.core.version.VersionManagerImplBase
context, currentActivity, hierMgr, ntReg, session, stateMgr, vMgr
-
-
Constructor Summary
Constructors Constructor Description VersionManagerImpl(SessionContext context, UpdatableItemStateManager stateMgr, HierarchyManager hierMgr)
Creates a new version manager
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelMerge(String absPath, Version version)
Version
checkin(String absPath)
Wrapper aroundcheckin(String, Calendar)
.Version
checkin(String absPath, Calendar created)
Creates a new version of the node at the given path.void
checkout(String absPath)
Version
checkpoint(String absPath)
Node
createActivity(String title)
Node
createConfiguration(String absPath)
void
doneMerge(String absPath, Version version)
Node
getActivity()
Version
getBaseVersion(String absPath)
VersionHistory
getVersionHistory(String absPath)
boolean
isCheckedOut(String absPath)
Wrapper aroundNode.isCheckedOut()
.NodeIterator
merge(String absPath, String srcWorkspace, boolean bestEffort)
Wrapper aroundmerge(String, String, boolean, boolean)
.NodeIterator
merge(String absPath, String srcWorkspaceName, boolean bestEffort, boolean isShallow)
NodeIterator
merge(Node activityNode)
void
removeActivity(Node node)
void
restore(String absPath, String versionName, boolean removeExisting)
void
restore(String absPath, Version version, boolean removeExisting)
void
restore(Version[] versions, boolean removeExisting)
void
restore(Version version, boolean removeExisting)
Wrapper aroundrestore(Version[], boolean)
.protected void
restore(NodeImpl node, Version version, boolean removeExisting)
Same asrestore(String, String, boolean)
but to ensure backward compatibility for Node.restore(Version, boolean).void
restoreByLabel(String absPath, String versionLabel, boolean removeExisting)
Node
setActivity(Node activity)
void
update(NodeImpl node, String srcWorkspaceName)
Does an update.-
Methods inherited from class org.apache.jackrabbit.core.version.VersionManagerImplConfig
createConfiguration, restore
-
Methods inherited from class org.apache.jackrabbit.core.version.VersionManagerImplMerge
finishMerge, merge, merge
-
Methods inherited from class org.apache.jackrabbit.core.version.VersionManagerImplRestore
internalRestore, internalRestore, internalRestoreFrozen, restore, restore, restore, restoreByLabel
-
Methods inherited from class org.apache.jackrabbit.core.version.VersionManagerImplBase
acquireReadLock, acquireWriteLock, checkModify, checkModify, checkoutCheckin, checkVersionable, getBaseVersion, getBaseVersionId, getNodeStateEx, getVersion, getVersionHistory, isCheckedOut, safeGetJCRPath, startWriteOperation
-
-
-
-
Constructor Detail
-
VersionManagerImpl
public VersionManagerImpl(SessionContext context, UpdatableItemStateManager stateMgr, HierarchyManager hierMgr)
Creates a new version manager- Parameters:
context
- component context of the current sessionstateMgr
- the underlying state managerhierMgr
- local hierarchy manager
-
-
Method Detail
-
checkin
public Version checkin(String absPath) throws RepositoryException
Wrapper aroundcheckin(String, Calendar)
.- Specified by:
checkin
in interfaceVersionManager
- Throws:
RepositoryException
-
checkin
public Version checkin(String absPath, Calendar created) throws RepositoryException
Creates a new version of the node at the given path.- Parameters:
absPath
- node pathcreated
- create time of the new version, ornull
for the current time- Returns:
- new version
- Throws:
RepositoryException
- if the version can not be created
-
checkout
public void checkout(String absPath) throws RepositoryException
- Specified by:
checkout
in interfaceVersionManager
- Throws:
RepositoryException
-
checkpoint
public Version checkpoint(String absPath) throws RepositoryException
- Specified by:
checkpoint
in interfaceVersionManager
- Throws:
RepositoryException
-
isCheckedOut
public boolean isCheckedOut(String absPath) throws RepositoryException
Wrapper aroundNode.isCheckedOut()
.- Specified by:
isCheckedOut
in interfaceVersionManager
- Throws:
RepositoryException
-
getVersionHistory
public VersionHistory getVersionHistory(String absPath) throws RepositoryException
- Specified by:
getVersionHistory
in interfaceVersionManager
- Throws:
RepositoryException
-
getBaseVersion
public Version getBaseVersion(String absPath) throws RepositoryException
- Specified by:
getBaseVersion
in interfaceVersionManager
- Throws:
RepositoryException
-
restore
public void restore(Version version, boolean removeExisting) throws RepositoryException
Wrapper aroundrestore(Version[], boolean)
.- Specified by:
restore
in interfaceVersionManager
- Throws:
RepositoryException
-
restore
public void restore(Version[] versions, boolean removeExisting) throws RepositoryException
- Specified by:
restore
in interfaceVersionManager
- Throws:
RepositoryException
-
restore
public void restore(String absPath, String versionName, boolean removeExisting) throws RepositoryException
- Specified by:
restore
in interfaceVersionManager
- Throws:
RepositoryException
-
restore
public void restore(String absPath, Version version, boolean removeExisting) throws RepositoryException
- Specified by:
restore
in interfaceVersionManager
- Throws:
RepositoryException
-
restore
protected void restore(NodeImpl node, Version version, boolean removeExisting) throws RepositoryException
Same asrestore(String, String, boolean)
but to ensure backward compatibility for Node.restore(Version, boolean).- Parameters:
node
- the node to restoreversion
- the version to restoreremoveExisting
- the remove existing flag- Throws:
RepositoryException
- if an error occurs
-
restoreByLabel
public void restoreByLabel(String absPath, String versionLabel, boolean removeExisting) throws RepositoryException
- Specified by:
restoreByLabel
in interfaceVersionManager
- Throws:
RepositoryException
-
update
public void update(NodeImpl node, String srcWorkspaceName) throws RepositoryException
Does an update.- Parameters:
node
- the node to updatesrcWorkspaceName
- the source workspace name- Throws:
RepositoryException
- if an error occurs- See Also:
Node.update(String)
-
merge
public NodeIterator merge(String absPath, String srcWorkspace, boolean bestEffort) throws RepositoryException
Wrapper aroundmerge(String, String, boolean, boolean)
.- Specified by:
merge
in interfaceVersionManager
- Throws:
RepositoryException
-
merge
public NodeIterator merge(String absPath, String srcWorkspaceName, boolean bestEffort, boolean isShallow) throws RepositoryException
- Specified by:
merge
in interfaceVersionManager
- Throws:
RepositoryException
-
doneMerge
public void doneMerge(String absPath, Version version) throws RepositoryException
- Specified by:
doneMerge
in interfaceVersionManager
- Throws:
RepositoryException
-
cancelMerge
public void cancelMerge(String absPath, Version version) throws RepositoryException
- Specified by:
cancelMerge
in interfaceVersionManager
- Throws:
RepositoryException
-
createConfiguration
public Node createConfiguration(String absPath) throws RepositoryException
- Specified by:
createConfiguration
in interfaceVersionManager
- Throws:
RepositoryException
-
setActivity
public Node setActivity(Node activity) throws RepositoryException
- Specified by:
setActivity
in interfaceVersionManager
- Throws:
RepositoryException
-
getActivity
public Node getActivity() throws RepositoryException
- Specified by:
getActivity
in interfaceVersionManager
- Throws:
RepositoryException
-
createActivity
public Node createActivity(String title) throws RepositoryException
- Specified by:
createActivity
in interfaceVersionManager
- Throws:
RepositoryException
-
removeActivity
public void removeActivity(Node node) throws RepositoryException
- Specified by:
removeActivity
in interfaceVersionManager
- Throws:
RepositoryException
-
merge
public NodeIterator merge(Node activityNode) throws RepositoryException
- Specified by:
merge
in interfaceVersionManager
- Throws:
RepositoryException
-
-