org.apache.jackrabbit.core.version
Class VersionManagerImplRestore

java.lang.Object
  extended by org.apache.jackrabbit.core.version.VersionManagerImplBase
      extended by 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
protected VersionManagerImplRestore(SessionContext context, UpdatableItemStateManager stateMgr, HierarchyManager hierMgr)
          Creates a new version manager for the given session
 
Method Summary
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 the version below the parent node using the indicated name
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 session
stateMgr - the underlying state manager
hierMgr - local hierarchy manager
Method Detail

restore

protected void restore(NodeStateEx state,
                       InternalVersion v,
                       boolean removeExisting)
                throws RepositoryException
Parameters:
state - the state to restore
v - the version to restore
removeExisting - 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 restore
versionName - the name of the version to restore
removeExisting - 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 restore
versionLabel - the name of the version to restore
removeExisting - 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 the version below the parent node using the indicated name

Parameters:
parent - parent node
name - desired name
v - version to restore
removeExisting - remove exiting flag
Throws:
RepositoryException - if an error occurs

internalRestore

protected void internalRestore(VersionSet versions,
                               boolean removeExisting)
                        throws RepositoryException,
                               ItemStateException
Parameters:
versions - Versions to restore
removeExisting - remove existing flag
Throws:
RepositoryException - if an error occurs
ItemStateException - 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 restore
version - version to restore
vsel - 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 occurs
ItemStateException - 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 restore
freeze - the frozen node
vsel - version selector
restored - set of restored versions
removeExisting - remove existing flag
copy - if true a pure copy is performed
Throws:
RepositoryException - if an error occurs
ItemStateException - if an error occurs


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.