Class VersionHistoryImpl
- java.lang.Object
-
- org.apache.jackrabbit.jcr2spi.ItemImpl
-
- org.apache.jackrabbit.jcr2spi.NodeImpl
-
- org.apache.jackrabbit.jcr2spi.version.VersionHistoryImpl
-
- All Implemented Interfaces:
Item
,Node
,VersionHistory
,ItemStateLifeCycleListener
public class VersionHistoryImpl extends NodeImpl implements VersionHistory
VersionHistoryImpl
...
-
-
Field Summary
-
Fields inherited from interface javax.jcr.Node
JCR_CHILD_NODE_DEFINITION, JCR_CONTENT, JCR_FROZEN_NODE, JCR_PROPERTY_DEFINITION, JCR_ROOT_VERSION, JCR_VERSION_LABELS
-
-
Constructor Summary
Constructors Constructor Description VersionHistoryImpl(SessionImpl session, NodeState state, ItemLifeCycleListener[] listeners)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.NodeIterator
getAllFrozenNodes()
NodeIterator
getAllLinearFrozenNodes()
VersionIterator
getAllLinearVersions()
VersionIterator
getAllVersions()
Version
getRootVersion()
Version
getVersion(String versionName)
String
getVersionableIdentifier()
String
getVersionableUUID()
Version
getVersionByLabel(String label)
String[]
getVersionLabels()
String[]
getVersionLabels(Version version)
boolean
hasVersionLabel(String label)
boolean
hasVersionLabel(Version version, String label)
boolean
isSame(Item otherItem)
protected boolean
isWritable()
Always returns falsevoid
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, followLifecycleTransition, getAllowedLifecycleTransistions, getBaseVersion, getCorrespondingNodePath, getDefinition, getIdentifier, getIndex, getLock, getMixinNodeTypes, getName, getNode, getNode, getNodes, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperties, getProperty, getProperty, getReferences, getReferences, getSharedSet, getUUID, getVersionHistory, getWeakReferences, getWeakReferences, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, isCheckedOut, isLocked, isNode, isNodeType, lock, lock, merge, merge, orderBefore, removeMixin, removeShare, removeSharedSet, restore, restore, restore, restoreByLabel, setPrimaryType, setProperty, setProperty, 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.Item
accept, getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isNode, refresh, remove, save
-
Methods inherited from interface javax.jcr.Node
addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, doneMerge, followLifecycleTransition, getAllowedLifecycleTransistions, getBaseVersion, getCorrespondingNodePath, getDefinition, getIdentifier, getIndex, getLock, getMixinNodeTypes, getNode, getNodes, getNodes, getNodes, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperties, getProperty, getReferences, getReferences, getSharedSet, getUUID, getVersionHistory, getWeakReferences, getWeakReferences, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, isCheckedOut, isLocked, isNodeType, lock, merge, orderBefore, removeMixin, removeShare, removeSharedSet, restore, restore, restore, restoreByLabel, setPrimaryType, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, unlock, update
-
-
-
-
Constructor Detail
-
VersionHistoryImpl
public VersionHistoryImpl(SessionImpl session, NodeState state, ItemLifeCycleListener[] listeners) throws VersionException, RepositoryException
- Throws:
VersionException
RepositoryException
-
-
Method Detail
-
getVersionableUUID
public String getVersionableUUID() throws RepositoryException
- Specified by:
getVersionableUUID
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getVersionableUUID()
-
getRootVersion
public Version getRootVersion() throws RepositoryException
- Specified by:
getRootVersion
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getRootVersion()
-
getAllVersions
public VersionIterator getAllVersions() throws RepositoryException
- Specified by:
getAllVersions
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getAllVersions()
-
getAllLinearVersions
public VersionIterator getAllLinearVersions() throws RepositoryException
- Specified by:
getAllLinearVersions
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getAllLinearVersions()
-
getAllFrozenNodes
public NodeIterator getAllFrozenNodes() throws RepositoryException
- Specified by:
getAllFrozenNodes
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getAllFrozenNodes()
-
getAllLinearFrozenNodes
public NodeIterator getAllLinearFrozenNodes() throws RepositoryException
- Specified by:
getAllLinearFrozenNodes
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getAllLinearFrozenNodes()
-
getVersion
public Version getVersion(String versionName) throws VersionException, RepositoryException
- Specified by:
getVersion
in interfaceVersionHistory
- Throws:
VersionException
RepositoryException
- See Also:
VersionHistory.getVersion(String)
-
getVersionByLabel
public Version getVersionByLabel(String label) throws RepositoryException
- Specified by:
getVersionByLabel
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getVersionByLabel(String)
-
addVersionLabel
public void addVersionLabel(String versionName, String label, boolean moveLabel) throws VersionException, RepositoryException
- Specified by:
addVersionLabel
in interfaceVersionHistory
- Throws:
VersionException
RepositoryException
- See Also:
VersionHistory.addVersionLabel(String, String, boolean)
-
removeVersionLabel
public void removeVersionLabel(String label) throws VersionException, RepositoryException
- Specified by:
removeVersionLabel
in interfaceVersionHistory
- Throws:
VersionException
RepositoryException
- See Also:
VersionHistory.removeVersionLabel(String)
-
hasVersionLabel
public boolean hasVersionLabel(String label) throws RepositoryException
- Specified by:
hasVersionLabel
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.hasVersionLabel(String)
-
hasVersionLabel
public boolean hasVersionLabel(Version version, String label) throws VersionException, RepositoryException
- Specified by:
hasVersionLabel
in interfaceVersionHistory
- Throws:
VersionException
RepositoryException
- See Also:
VersionHistory.hasVersionLabel(Version, String)
-
getVersionLabels
public String[] getVersionLabels() throws RepositoryException
- Specified by:
getVersionLabels
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getVersionLabels()
-
getVersionLabels
public String[] getVersionLabels(Version version) throws VersionException, RepositoryException
- Specified by:
getVersionLabels
in interfaceVersionHistory
- Throws:
VersionException
RepositoryException
- See Also:
VersionHistory.getVersionLabels(Version)
-
removeVersion
public void removeVersion(String versionName) throws ReferentialIntegrityException, AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException
- Specified by:
removeVersion
in interfaceVersionHistory
- Throws:
ReferentialIntegrityException
AccessDeniedException
UnsupportedRepositoryOperationException
VersionException
RepositoryException
- See Also:
VersionHistory.removeVersion(String)
-
getVersionableIdentifier
public String getVersionableIdentifier() throws RepositoryException
- Specified by:
getVersionableIdentifier
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getVersionableIdentifier()
-
isSame
public boolean isSame(Item otherItem) throws RepositoryException
- Specified by:
isSame
in interfaceItem
- Overrides:
isSame
in classItemImpl
- Parameters:
otherItem
-- Returns:
- Throws:
RepositoryException
- See Also:
Item.isSame(Item)
-
checkIsWritable
protected void checkIsWritable() throws UnsupportedRepositoryOperationException, ConstraintViolationException, 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 classItemImpl
- Throws:
UnsupportedRepositoryOperationException
ConstraintViolationException
RepositoryException
- See Also:
ItemStateValidator
-
isWritable
protected boolean isWritable() throws RepositoryException
Always returns false- Overrides:
isWritable
in classItemImpl
- Throws:
RepositoryException
UnsupportedRepositoryOperationException
- See Also:
ItemImpl.isWritable()
-
-