org.apache.jackrabbit.jcr2spi.version
Class VersionHistoryImpl

java.lang.Object
  extended by org.apache.jackrabbit.jcr2spi.ItemImpl
      extended by org.apache.jackrabbit.jcr2spi.NodeImpl
          extended by org.apache.jackrabbit.jcr2spi.version.VersionHistoryImpl
All Implemented Interfaces:
javax.jcr.Item, javax.jcr.Node, javax.jcr.version.VersionHistory, ItemStateLifeCycleListener

public class VersionHistoryImpl
extends NodeImpl
implements javax.jcr.version.VersionHistory

VersionHistoryImpl...


Field Summary
 
Fields inherited from class org.apache.jackrabbit.jcr2spi.ItemImpl
listeners, session
 
Constructor Summary
VersionHistoryImpl(SessionImpl session, NodeState state, ItemLifeCycleListener[] listeners)
           
 
Method Summary
 void addVersionLabel(String versionName, String label, boolean moveLabel)
           
protected  void checkIsWritable()
          Checks if the repository supports level 2 (writing) and the status of this item.
 javax.jcr.version.VersionIterator getAllVersions()
           
 javax.jcr.version.Version getRootVersion()
           
 javax.jcr.version.Version getVersion(String versionName)
           
 String getVersionableUUID()
           
 javax.jcr.version.Version getVersionByLabel(String label)
           
 String[] getVersionLabels()
           
 String[] getVersionLabels(javax.jcr.version.Version version)
           
 boolean hasVersionLabel(String label)
           
 boolean hasVersionLabel(javax.jcr.version.Version version, String label)
           
 boolean isSame(javax.jcr.Item otherItem)
           
protected  boolean isWritable()
          Always returns false
 void removeVersion(String versionName)
           
 void removeVersionLabel(String label)
           
 
Methods inherited from class org.apache.jackrabbit.jcr2spi.NodeImpl
accept, addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, doneMerge, getBaseVersion, getCorrespondingNodePath, getDefinition, getIndex, getLock, getMixinNodeTypes, getName, getNode, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperty, getProperty, getReferences, getUUID, getVersionHistory, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, isCheckedOut, isLocked, isNode, isNodeType, lock, merge, orderBefore, removeMixin, restore, restore, restore, restoreByLabel, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, unlock, update
 
Methods inherited from class org.apache.jackrabbit.jcr2spi.ItemImpl
checkStatus, getAncestor, getDepth, getItemManager, getItemState, getParent, getPath, getSession, isModified, isNew, refresh, remove, save, statusChanged
 
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, getUUID, getVersionHistory, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, isCheckedOut, isLocked, isNodeType, lock, merge, orderBefore, removeMixin, restore, restore, restore, restoreByLabel, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, unlock, update
 
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(SessionImpl session,
                          NodeState state,
                          ItemLifeCycleListener[] listeners)
                   throws javax.jcr.version.VersionException,
                          javax.jcr.RepositoryException
Throws:
javax.jcr.version.VersionException
javax.jcr.RepositoryException
Method Detail

getVersionableUUID

public String getVersionableUUID()
                          throws javax.jcr.RepositoryException
Specified by:
getVersionableUUID in interface javax.jcr.version.VersionHistory
Returns:
Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.getVersionableUUID()

getRootVersion

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

getAllVersions

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

getVersion

public javax.jcr.version.Version getVersion(String versionName)
                                     throws javax.jcr.version.VersionException,
                                            javax.jcr.RepositoryException
Specified by:
getVersion in interface javax.jcr.version.VersionHistory
Parameters:
versionName -
Returns:
Throws:
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
VersionHistory.getVersion(String)

getVersionByLabel

public javax.jcr.version.Version getVersionByLabel(String label)
                                            throws javax.jcr.RepositoryException
Specified by:
getVersionByLabel in interface javax.jcr.version.VersionHistory
Parameters:
label -
Returns:
Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.getVersionByLabel(String)

addVersionLabel

public void addVersionLabel(String versionName,
                            String label,
                            boolean moveLabel)
                     throws javax.jcr.version.VersionException,
                            javax.jcr.RepositoryException
Specified by:
addVersionLabel in interface javax.jcr.version.VersionHistory
Parameters:
versionName -
label -
moveLabel -
Throws:
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
VersionHistory.addVersionLabel(String, String, boolean)

removeVersionLabel

public void removeVersionLabel(String label)
                        throws javax.jcr.version.VersionException,
                               javax.jcr.RepositoryException
Specified by:
removeVersionLabel in interface javax.jcr.version.VersionHistory
Parameters:
label -
Throws:
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
VersionHistory.removeVersionLabel(String)

hasVersionLabel

public boolean hasVersionLabel(String label)
                        throws javax.jcr.RepositoryException
Specified by:
hasVersionLabel in interface javax.jcr.version.VersionHistory
Parameters:
label -
Returns:
Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.hasVersionLabel(String)

hasVersionLabel

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

getVersionLabels

public String[] getVersionLabels()
                          throws javax.jcr.RepositoryException
Specified by:
getVersionLabels in interface javax.jcr.version.VersionHistory
Returns:
Throws:
javax.jcr.RepositoryException
See Also:
VersionHistory.getVersionLabels()

getVersionLabels

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

removeVersion

public void removeVersion(String versionName)
                   throws javax.jcr.ReferentialIntegrityException,
                          javax.jcr.AccessDeniedException,
                          javax.jcr.UnsupportedRepositoryOperationException,
                          javax.jcr.version.VersionException,
                          javax.jcr.RepositoryException
Specified by:
removeVersion in interface javax.jcr.version.VersionHistory
Parameters:
versionName -
Throws:
javax.jcr.ReferentialIntegrityException
javax.jcr.AccessDeniedException
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.version.VersionException
javax.jcr.RepositoryException
See Also:
VersionHistory.removeVersion(String)

isSame

public boolean isSame(javax.jcr.Item otherItem)
               throws javax.jcr.RepositoryException
Specified by:
isSame in interface javax.jcr.Item
Overrides:
isSame in class ItemImpl
Parameters:
otherItem -
Returns:
Throws:
javax.jcr.RepositoryException
See Also:
Item.isSame(Item)

checkIsWritable

protected void checkIsWritable()
                        throws javax.jcr.UnsupportedRepositoryOperationException,
                               javax.jcr.nodetype.ConstraintViolationException,
                               javax.jcr.RepositoryException
Description copied from class: ItemImpl
Checks if the repository supports level 2 (writing) and the status of this item. Note, that this method does not perform any additional validation checks such as access restrictions, locking, checkin status or protection that affect the writing to nodes and properties.

Overrides:
checkIsWritable in class ItemImpl
Throws:
javax.jcr.UnsupportedRepositoryOperationException
javax.jcr.nodetype.ConstraintViolationException
javax.jcr.RepositoryException
See Also:
ItemStateValidator

isWritable

protected boolean isWritable()
                      throws javax.jcr.RepositoryException
Always returns false

Overrides:
isWritable in class ItemImpl
Throws:
javax.jcr.RepositoryException
javax.jcr.UnsupportedRepositoryOperationException
See Also:
ItemImpl.isWritable()


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.