org.apache.jackrabbit.core
Class VersionManagerImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.version.VersionManagerImplBase
      extended by org.apache.jackrabbit.core.version.VersionManagerImplRestore
          extended by org.apache.jackrabbit.core.version.VersionManagerImplMerge
              extended by org.apache.jackrabbit.core.version.VersionManagerImplConfig
                  extended by org.apache.jackrabbit.core.VersionManagerImpl
All Implemented Interfaces:
VersionManager

public class VersionManagerImpl
extends VersionManagerImplConfig
implements VersionManager

Implementation of the VersionManager.

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
VersionManagerImpl(SessionContext context, UpdatableItemStateManager stateMgr, HierarchyManager hierMgr)
          Creates a new version manager
 
Method Summary
 void cancelMerge(String absPath, Version version)
          
 Version checkin(String absPath)
          Wrapper around checkin(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 around Node.isCheckedOut().
 NodeIterator merge(Node activityNode)
          
 NodeIterator merge(String absPath, String srcWorkspace, boolean bestEffort)
          Wrapper around merge(String, String, boolean, boolean).
 NodeIterator merge(String absPath, String srcWorkspaceName, boolean bestEffort, boolean isShallow)
          
 void removeActivity(Node node)
          
protected  void restore(NodeImpl node, Version version, boolean removeExisting)
          Same as restore(String, String, boolean) but to ensure backward compatibility for Node.restore(Version, boolean).
 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 around 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionManagerImpl

public VersionManagerImpl(SessionContext context,
                          UpdatableItemStateManager stateMgr,
                          HierarchyManager hierMgr)
Creates a new version manager

Parameters:
context - component context of the current session
stateMgr - the underlying state manager
hierMgr - local hierarchy manager
Method Detail

checkin

public Version checkin(String absPath)
                throws RepositoryException
Wrapper around checkin(String, Calendar).

Specified by:
checkin in interface VersionManager
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 path
created - create time of the new version, or null 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 interface VersionManager
Throws:
RepositoryException

checkpoint

public Version checkpoint(String absPath)
                   throws RepositoryException

Specified by:
checkpoint in interface VersionManager
Throws:
RepositoryException

isCheckedOut

public boolean isCheckedOut(String absPath)
                     throws RepositoryException
Wrapper around Node.isCheckedOut().

Specified by:
isCheckedOut in interface VersionManager
Throws:
RepositoryException

getVersionHistory

public VersionHistory getVersionHistory(String absPath)
                                 throws RepositoryException

Specified by:
getVersionHistory in interface VersionManager
Throws:
RepositoryException

getBaseVersion

public Version getBaseVersion(String absPath)
                       throws RepositoryException

Specified by:
getBaseVersion in interface VersionManager
Throws:
RepositoryException

restore

public void restore(Version version,
                    boolean removeExisting)
             throws RepositoryException
Wrapper around restore(Version[], boolean).

Specified by:
restore in interface VersionManager
Throws:
RepositoryException

restore

public void restore(Version[] versions,
                    boolean removeExisting)
             throws RepositoryException

Specified by:
restore in interface VersionManager
Throws:
RepositoryException

restore

public void restore(String absPath,
                    String versionName,
                    boolean removeExisting)
             throws RepositoryException

Specified by:
restore in interface VersionManager
Throws:
RepositoryException

restore

public void restore(String absPath,
                    Version version,
                    boolean removeExisting)
             throws RepositoryException

Specified by:
restore in interface VersionManager
Throws:
RepositoryException

restore

protected void restore(NodeImpl node,
                       Version version,
                       boolean removeExisting)
                throws RepositoryException
Same as restore(String, String, boolean) but to ensure backward compatibility for Node.restore(Version, boolean).

Parameters:
node - the node to restore
version - the version to restore
removeExisting - 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 interface VersionManager
Throws:
RepositoryException

update

public void update(NodeImpl node,
                   String srcWorkspaceName)
            throws RepositoryException
Does an update.

Parameters:
node - the node to update
srcWorkspaceName - 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 around merge(String, String, boolean, boolean).

Specified by:
merge in interface VersionManager
Throws:
RepositoryException

merge

public NodeIterator merge(String absPath,
                          String srcWorkspaceName,
                          boolean bestEffort,
                          boolean isShallow)
                   throws RepositoryException

Specified by:
merge in interface VersionManager
Throws:
RepositoryException

doneMerge

public void doneMerge(String absPath,
                      Version version)
               throws RepositoryException

Specified by:
doneMerge in interface VersionManager
Throws:
RepositoryException

cancelMerge

public void cancelMerge(String absPath,
                        Version version)
                 throws RepositoryException

Specified by:
cancelMerge in interface VersionManager
Throws:
RepositoryException

createConfiguration

public Node createConfiguration(String absPath)
                         throws RepositoryException

Specified by:
createConfiguration in interface VersionManager
Throws:
RepositoryException

setActivity

public Node setActivity(Node activity)
                 throws RepositoryException

Specified by:
setActivity in interface VersionManager
Throws:
RepositoryException

getActivity

public Node getActivity()
                 throws RepositoryException

Specified by:
getActivity in interface VersionManager
Throws:
RepositoryException

createActivity

public Node createActivity(String title)
                    throws RepositoryException

Specified by:
createActivity in interface VersionManager
Throws:
RepositoryException

removeActivity

public void removeActivity(Node node)
                    throws RepositoryException

Specified by:
removeActivity in interface VersionManager
Throws:
RepositoryException

merge

public NodeIterator merge(Node activityNode)
                   throws RepositoryException

Specified by:
merge in interface VersionManager
Throws:
RepositoryException


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