Class VersionManagerImplRestore
- java.lang.Object
-
- org.apache.jackrabbit.core.version.VersionManagerImplBase
-
- org.apache.jackrabbit.core.version.VersionManagerImplRestore
-
- Direct Known Subclasses:
VersionManagerImplMerge
public abstract class VersionManagerImplRestore extends VersionManagerImplBase
The JCR Version Manager implementation is split in several classes in order to group related methods together.this class provides methods for the restore operations.
Implementation note: methods starting with "internal" are considered to be executed within a "write operations" block.
-
-
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 Modifier Constructor Description protected
VersionManagerImplRestore(SessionContext context, UpdatableItemStateManager stateMgr, HierarchyManager hierMgr)
Creates a new version manager for the given session
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Set<InternalVersion>
internalRestore(NodeStateEx state, InternalVersion version, VersionSelector vsel, boolean removeExisting)
Internal method to restore a version.protected void
internalRestore(VersionSet versions, boolean removeExisting)
protected void
internalRestoreFrozen(NodeStateEx state, InternalFrozenNode freeze, VersionSelector vsel, Set<InternalVersion> restored, boolean removeExisting, boolean copy)
Restores the properties and child nodes from the frozen state.protected void
restore(NodeStateEx state, InternalVersion v, boolean removeExisting)
protected void
restore(NodeStateEx state, Name versionName, boolean removeExisting)
protected void
restore(NodeStateEx parent, Name name, InternalVersion v, boolean removeExisting)
Restores theversion
below theparent
node using the indicatedname
protected void
restoreByLabel(NodeStateEx state, Name versionLabel, boolean removeExisting)
-
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
-
VersionManagerImplRestore
protected VersionManagerImplRestore(SessionContext context, UpdatableItemStateManager stateMgr, HierarchyManager hierMgr)
Creates a new version manager for the given session- Parameters:
context
- component context of the current sessionstateMgr
- the underlying state managerhierMgr
- local hierarchy manager
-
-
Method Detail
-
restore
protected void restore(NodeStateEx state, InternalVersion v, boolean removeExisting) throws RepositoryException
- Parameters:
state
- the state to restorev
- the version to restoreremoveExisting
- remove existing flag- Throws:
RepositoryException
- if an error occurs- See Also:
VersionManager.restore(String, Version, boolean)
-
restore
protected void restore(NodeStateEx state, Name versionName, boolean removeExisting) throws RepositoryException
- Parameters:
state
- the state to restoreversionName
- the name of the version to restoreremoveExisting
- remove existing flag- Throws:
RepositoryException
- if an error occurs- See Also:
VersionManager.restore(String, String, boolean)
-
restoreByLabel
protected void restoreByLabel(NodeStateEx state, Name versionLabel, boolean removeExisting) throws RepositoryException
- Parameters:
state
- the state to restoreversionLabel
- the name of the version to restoreremoveExisting
- remove existing flag- Throws:
RepositoryException
- if an error occurs- See Also:
VersionManager.restoreByLabel(String, String, boolean)
-
restore
protected void restore(NodeStateEx parent, Name name, InternalVersion v, boolean removeExisting) throws RepositoryException
Restores theversion
below theparent
node using the indicatedname
- Parameters:
parent
- parent nodename
- desired namev
- version to restoreremoveExisting
- remove exiting flag- Throws:
RepositoryException
- if an error occurs
-
internalRestore
protected void internalRestore(VersionSet versions, boolean removeExisting) throws RepositoryException, ItemStateException
- Parameters:
versions
- Versions to restoreremoveExisting
- remove existing flag- Throws:
RepositoryException
- if an error occursItemStateException
- if an error occurs- See Also:
VersionManager.restore(Version[], boolean)
,VersionManager.restore(Version, boolean)
-
internalRestore
protected Set<InternalVersion> internalRestore(NodeStateEx state, InternalVersion version, VersionSelector vsel, boolean removeExisting) throws RepositoryException, ItemStateException
Internal method to restore a version.- Parameters:
state
- the state to restoreversion
- version to restorevsel
- the version selector that will select the correct version for OPV=Version child nodes.removeExisting
- remove existing flag- Returns:
- set of restored versions
- Throws:
RepositoryException
- if an error occursItemStateException
- if an error occurs
-
internalRestoreFrozen
protected void internalRestoreFrozen(NodeStateEx state, InternalFrozenNode freeze, VersionSelector vsel, Set<InternalVersion> restored, boolean removeExisting, boolean copy) throws RepositoryException, ItemStateException
Restores the properties and child nodes from the frozen state.- Parameters:
state
- state to restorefreeze
- the frozen nodevsel
- version selectorrestored
- set of restored versionsremoveExisting
- remove existing flagcopy
- iftrue
a pure copy is performed- Throws:
RepositoryException
- if an error occursItemStateException
- if an error occurs
-
-