org.apache.jackrabbit.core.version
Class VersionHistoryImpl

java.lang.Object
  extended byorg.apache.jackrabbit.core.ItemImpl
      extended byorg.apache.jackrabbit.core.NodeImpl
          extended byorg.apache.jackrabbit.core.version.VersionHistoryImpl
All Implemented Interfaces:
Item, ItemStateListener, Node, VersionHistory

public class VersionHistoryImpl
extends NodeImpl
implements VersionHistory

This Class implements a version history that extends a node.


Field Summary
 
Fields inherited from class org.apache.jackrabbit.core.NodeImpl
CREATED, definition, primaryTypeName
 
Fields inherited from class org.apache.jackrabbit.core.ItemImpl
id, itemMgr, listeners, rep, session, state, stateMgr, status, STATUS_DESTROYED, STATUS_INVALIDATED, STATUS_MODIFIED, STATUS_NORMAL
 
Constructor Summary
VersionHistoryImpl(ItemManager itemMgr, SessionImpl session, NodeId id, NodeState state, NodeDefinition definition, ItemLifeCycleListener[] listeners, InternalVersionHistory history)
          creates a new version history node.
 
Method Summary
 void addVersionLabel(String versionName, String label, boolean move)
           
 VersionIterator getAllVersions()
           
 InternalVersionHistory getInternalVersionHistory()
          Returns the internal version history
 Version getRootVersion()
           
 String getUUID()
          
 Version getVersion(String versionName)
           
 String getVersionableUUID()
          Returns the UUID of the node that was versioned.
 Version getVersionByLabel(String label)
           
 String[] getVersionLabels()
           
 String[] getVersionLabels(Version version)
           
 boolean hasVersionLabel(String label)
           
 boolean hasVersionLabel(Version version, String label)
           
 boolean isSame(Item otherItem)
          
 NodeIterator merge(String srcWorkspace, boolean bestEffort)
          Always throws a ConstraintViolationException since this node is protected.
 void removeVersion(String versionName)
           
 void removeVersionLabel(String label)
           
 void update(String srcWorkspaceName)
          Always throws a ConstraintViolationException since this node is protected.
 
Methods inherited from class org.apache.jackrabbit.core.NodeImpl
accept, addMixin, addMixin, addNode, addNode, addNode, canAddMixin, cancelMerge, checkin, checkLock, checkout, checkSetProperty, computeSystemGeneratedPropertyValues, createChildNode, createChildProperty, doneMerge, getApplicableChildNodeDefinition, getApplicablePropertyDefinition, getBaseVersion, getCorrespondingNodePath, getDefinition, getEffectiveNodeType, getIndex, getLock, getMixinNodeTypes, getMixinTypeNames, getName, getNode, getNode, getNode, getNodes, getNodes, getOrCreateProperty, getOrCreateProperty, getOrCreateTransientItemState, getParent, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperty, getProperty, getQName, getReferences, getVersionHistory, hasNode, hasNode, hasNode, hasNodes, hasPendingChanges, hasProperties, hasProperty, hasProperty, holdsLock, internalAddChildNode, internalAddChildNode, internalAddNode, internalAddNode, internalCopyPropertyFrom, internalGetUUID, internalIsCheckedOut, internalRestore, internalSetProperty, internalSetProperty, internalSetProperty, isCheckedOut, isLocked, isNode, isNodeType, isNodeType, lock, makePersistent, onRedefine, onRemove, orderBefore, removeChildNode, removeChildProperty, removeChildProperty, removeMixin, removeMixin, renameChildNode, resolveRelativeNodePath, resolveRelativePropertyPath, restore, restore, restore, restoreByLabel, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, unlock
 
Methods inherited from class org.apache.jackrabbit.core.ItemImpl
getAncestor, getDepth, getId, getOrCreateNodeReferences, getPath, getPrimaryPath, getSession, internalRemove, isModified, isNew, isTransactionalNew, isTransient, notifyDestroyed, notifyInvalidated, refresh, remove, safeGetJCRPath, sanityCheck, save, setRemoved, stateCreated, stateDestroyed, stateDiscarded, stateModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.Node
addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, doneMerge, getBaseVersion, getCorrespondingNodePath, getDefinition, getIndex, getLock, getMixinNodeTypes, getNode, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperty, getReferences, getVersionHistory, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, isCheckedOut, isLocked, isNodeType, lock, orderBefore, removeMixin, restore, restore, restore, restoreByLabel, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, unlock
 
Methods inherited from interface javax.jcr.Item
accept, getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isNode, refresh, remove, save
 

Constructor Detail

VersionHistoryImpl

public VersionHistoryImpl(ItemManager itemMgr,
                          SessionImpl session,
                          NodeId id,
                          NodeState state,
                          NodeDefinition definition,
                          ItemLifeCycleListener[] listeners,
                          InternalVersionHistory history)
creates a new version history node.

Parameters:
itemMgr -
session -
id -
state -
definition -
listeners -
history -
Method Detail

getRootVersion

public Version getRootVersion()
                       throws RepositoryException
Specified by:
getRootVersion in interface VersionHistory
Throws:
RepositoryException
See Also:
VersionHistory.getRootVersion()

getAllVersions

public VersionIterator getAllVersions()
                               throws RepositoryException
Specified by:
getAllVersions in interface VersionHistory
Throws:
RepositoryException
See Also:
VersionHistory.getAllVersions()

getVersion

public Version getVersion(String versionName)
                   throws VersionException,
                          RepositoryException
Specified by:
getVersion in interface VersionHistory
Throws:
VersionException
RepositoryException
See Also:
VersionHistory.getVersion(String)

getVersionByLabel

public Version getVersionByLabel(String label)
                          throws RepositoryException
Specified by:
getVersionByLabel in interface VersionHistory
Throws:
RepositoryException
See Also:
VersionHistory.getVersionByLabel(String)

addVersionLabel

public void addVersionLabel(String versionName,
                            String label,
                            boolean move)
                     throws VersionException,
                            RepositoryException
Specified by:
addVersionLabel in interface VersionHistory
Throws:
VersionException
RepositoryException
See Also:
VersionHistory.addVersionLabel(String, String, boolean)

removeVersionLabel

public void removeVersionLabel(String label)
                        throws RepositoryException
Specified by:
removeVersionLabel in interface VersionHistory
Throws:
RepositoryException
See Also:
VersionHistory.removeVersionLabel(String)

getVersionLabels

public String[] getVersionLabels()
Specified by:
getVersionLabels in interface VersionHistory
See Also:
VersionHistory.getVersionLabels()

getVersionLabels

public String[] getVersionLabels(Version version)
                          throws VersionException,
                                 RepositoryException
Specified by:
getVersionLabels in interface VersionHistory
Throws:
VersionException
RepositoryException
See Also:
VersionHistory.getVersionLabels(Version)

hasVersionLabel

public boolean hasVersionLabel(String label)
Specified by:
hasVersionLabel in interface VersionHistory
See Also:
VersionHistory.hasVersionLabel(String)

hasVersionLabel

public boolean hasVersionLabel(Version version,
                               String label)
                        throws VersionException,
                               RepositoryException
Specified by:
hasVersionLabel in interface VersionHistory
Throws:
VersionException
RepositoryException
See Also:
VersionHistory.hasVersionLabel(Version, String)

removeVersion

public void removeVersion(String versionName)
                   throws UnsupportedRepositoryOperationException,
                          VersionException,
                          RepositoryException
Specified by:
removeVersion in interface VersionHistory
Throws:
UnsupportedRepositoryOperationException
VersionException
RepositoryException
See Also:
VersionHistory.removeVersion(String)

getUUID

public String getUUID()
               throws UnsupportedRepositoryOperationException,
                      RepositoryException
Description copied from class: NodeImpl

Specified by:
getUUID in interface Node
Overrides:
getUUID in class NodeImpl
Throws:
UnsupportedRepositoryOperationException
RepositoryException
See Also:
Node.getUUID()

isSame

public boolean isSame(Item otherItem)
Description copied from class: ItemImpl

Specified by:
isSame in interface Item
Overrides:
isSame in class ItemImpl
See Also:
Item.isSame(javax.jcr.Item)

getVersionableUUID

public String getVersionableUUID()
                          throws RepositoryException
Returns the UUID of the node that was versioned.

Specified by:
getVersionableUUID in interface VersionHistory
Returns:
Throws:
RepositoryException

getInternalVersionHistory

public InternalVersionHistory getInternalVersionHistory()
Returns the internal version history

Returns:

update

public void update(String srcWorkspaceName)
            throws ConstraintViolationException
Always throws a ConstraintViolationException since this node is protected.

Specified by:
update in interface Node
Overrides:
update in class NodeImpl
Throws:
ConstraintViolationException

merge

public NodeIterator merge(String srcWorkspace,
                          boolean bestEffort)
                   throws ConstraintViolationException
Always throws a ConstraintViolationException since this node is protected.

Specified by:
merge in interface Node
Overrides:
merge in class NodeImpl
Throws:
ConstraintViolationException


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