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 voidcancelMerge(String absPath, Version version)Versioncheckin(String absPath)Wrapper aroundcheckin(String, Calendar).Versioncheckin(String absPath, Calendar created)Creates a new version of the node at the given path.voidcheckout(String absPath)Versioncheckpoint(String absPath)NodecreateActivity(String title)NodecreateConfiguration(String absPath)voiddoneMerge(String absPath, Version version)NodegetActivity()VersiongetBaseVersion(String absPath)VersionHistorygetVersionHistory(String absPath)booleanisCheckedOut(String absPath)Wrapper aroundNode.isCheckedOut().NodeIteratormerge(String absPath, String srcWorkspace, boolean bestEffort)Wrapper aroundmerge(String, String, boolean, boolean).NodeIteratormerge(String absPath, String srcWorkspaceName, boolean bestEffort, boolean isShallow)NodeIteratormerge(Node activityNode)voidremoveActivity(Node node)voidrestore(String absPath, String versionName, boolean removeExisting)voidrestore(String absPath, Version version, boolean removeExisting)voidrestore(Version[] versions, boolean removeExisting)voidrestore(Version version, boolean removeExisting)Wrapper aroundrestore(Version[], boolean).protected voidrestore(NodeImpl node, Version version, boolean removeExisting)Same asrestore(String, String, boolean)but to ensure backward compatibility for Node.restore(Version, boolean).voidrestoreByLabel(String absPath, String versionLabel, boolean removeExisting)NodesetActivity(Node activity)voidupdate(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:
checkinin 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, ornullfor 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:
checkoutin interfaceVersionManager- Throws:
RepositoryException
-
checkpoint
public Version checkpoint(String absPath) throws RepositoryException
- Specified by:
checkpointin interfaceVersionManager- Throws:
RepositoryException
-
isCheckedOut
public boolean isCheckedOut(String absPath) throws RepositoryException
Wrapper aroundNode.isCheckedOut().- Specified by:
isCheckedOutin interfaceVersionManager- Throws:
RepositoryException
-
getVersionHistory
public VersionHistory getVersionHistory(String absPath) throws RepositoryException
- Specified by:
getVersionHistoryin interfaceVersionManager- Throws:
RepositoryException
-
getBaseVersion
public Version getBaseVersion(String absPath) throws RepositoryException
- Specified by:
getBaseVersionin interfaceVersionManager- Throws:
RepositoryException
-
restore
public void restore(Version version, boolean removeExisting) throws RepositoryException
Wrapper aroundrestore(Version[], boolean).- Specified by:
restorein interfaceVersionManager- Throws:
RepositoryException
-
restore
public void restore(Version[] versions, boolean removeExisting) throws RepositoryException
- Specified by:
restorein interfaceVersionManager- Throws:
RepositoryException
-
restore
public void restore(String absPath, String versionName, boolean removeExisting) throws RepositoryException
- Specified by:
restorein interfaceVersionManager- Throws:
RepositoryException
-
restore
public void restore(String absPath, Version version, boolean removeExisting) throws RepositoryException
- Specified by:
restorein 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:
restoreByLabelin 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:
mergein interfaceVersionManager- Throws:
RepositoryException
-
merge
public NodeIterator merge(String absPath, String srcWorkspaceName, boolean bestEffort, boolean isShallow) throws RepositoryException
- Specified by:
mergein interfaceVersionManager- Throws:
RepositoryException
-
doneMerge
public void doneMerge(String absPath, Version version) throws RepositoryException
- Specified by:
doneMergein interfaceVersionManager- Throws:
RepositoryException
-
cancelMerge
public void cancelMerge(String absPath, Version version) throws RepositoryException
- Specified by:
cancelMergein interfaceVersionManager- Throws:
RepositoryException
-
createConfiguration
public Node createConfiguration(String absPath) throws RepositoryException
- Specified by:
createConfigurationin interfaceVersionManager- Throws:
RepositoryException
-
setActivity
public Node setActivity(Node activity) throws RepositoryException
- Specified by:
setActivityin interfaceVersionManager- Throws:
RepositoryException
-
getActivity
public Node getActivity() throws RepositoryException
- Specified by:
getActivityin interfaceVersionManager- Throws:
RepositoryException
-
createActivity
public Node createActivity(String title) throws RepositoryException
- Specified by:
createActivityin interfaceVersionManager- Throws:
RepositoryException
-
removeActivity
public void removeActivity(Node node) throws RepositoryException
- Specified by:
removeActivityin interfaceVersionManager- Throws:
RepositoryException
-
merge
public NodeIterator merge(Node activityNode) throws RepositoryException
- Specified by:
mergein interfaceVersionManager- Throws:
RepositoryException
-
-