Class VersionHistoryImpl
- java.lang.Object
-
- org.apache.jackrabbit.core.ItemImpl
-
- org.apache.jackrabbit.core.NodeImpl
-
- org.apache.jackrabbit.core.version.VersionHistoryImpl
-
- All Implemented Interfaces:
Item
,Node
,VersionHistory
,JackrabbitNode
public class VersionHistoryImpl extends NodeImpl implements VersionHistory
Base implementation of theVersionHistory
interface.
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.core.ItemImpl
id, itemMgr, sessionContext, stateMgr, STATUS_DESTROYED, STATUS_INVALIDATED, STATUS_MODIFIED, STATUS_NORMAL
-
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(ItemManager itemMgr, SessionContext sessionContext, AbstractNodeData data)
Create a new instance of this class.
-
Method Summary
-
Methods inherited from class org.apache.jackrabbit.core.NodeImpl
accept, addMixin, addMixin, addNode, addNode, addNode, addNodeWithUuid, addNodeWithUuid, assignLifecyclePolicy, canAddMixin, cancelMerge, checkin, checkin, checkLock, checkout, checkSetProperty, clone, createChildNode, createChildProperty, doneMerge, followLifecycleTransition, getAllowedLifecycleTransistions, getApplicableChildNodeDefinition, getApplicablePropertyDefinition, getBaseVersion, getCorrespondingNodePath, getDefinition, getEffectiveNodeType, getIdentifier, getIndex, getLock, getMixinNodeTypes, getMixinTypeNames, getName, getNode, getNode, getNode, getNodeId, getNodes, getNodes, getNodes, getOrCreateProperty, getOrCreateProperty, getOrCreateTransientItemState, getParent, getParentId, getPrimaryItem, getPrimaryNodeType, getPrimaryNodeTypeName, getPrimaryPath, getProperties, getProperties, getProperties, getProperty, getProperty, getQName, getReferences, getReferences, getSharedSet, getUUID, getVersionHistory, getWeakReferences, getWeakReferences, hasNode, hasNode, hasNode, hasNodes, hasPendingChanges, hasProperties, hasProperty, hasProperty, holdsLock, internalSetProperty, internalSetProperty, internalSetProperty, isAccessControllable, isCheckedOut, isLocked, isNode, isNodeType, isNodeType, lock, makePersistent, onRedefine, onRemove, orderBefore, orderBefore, removeChildNode, removeChildProperty, removeMixin, removeMixin, removeShare, removeSharedSet, rename, renameChildNode, renameChildNode, replaceChildNode, resolveRelativeNodePath, resolveRelativePropertyPath, restore, restore, restore, restoreByLabel, restoreTransient, setMixins, setPrimaryType, setProperty, setProperty, 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, getPath, getQName, getSession, getType, getValueFactory, getValues, isModified, isNew, isTransactionalNew, isTransient, itemSanityCheck, perform, refresh, remove, safeGetJCRPath, sanityCheck, save, setRemoved
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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 org.apache.jackrabbit.api.JackrabbitNode
getNodeOrNull, getPropertyOrNull
-
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, 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
-
-
-
-
Constructor Detail
-
VersionHistoryImpl
public VersionHistoryImpl(ItemManager itemMgr, SessionContext sessionContext, AbstractNodeData data)
Create a new instance of this class.- Parameters:
itemMgr
- item managersessionContext
- component context of the associated sessiondata
- node data
-
-
Method Detail
-
getInternalVersionHistory
protected InternalVersionHistory getInternalVersionHistory() throws RepositoryException
Returns the internal version history. Subclass responsibility.- Returns:
- internal version history
- Throws:
RepositoryException
- if the internal version history is not available
-
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()
-
getAllFrozenNodes
public NodeIterator getAllFrozenNodes() throws RepositoryException
- Specified by:
getAllFrozenNodes
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getAllFrozenNodes()
-
getAllLinearVersions
public VersionIterator getAllLinearVersions() throws RepositoryException
- Specified by:
getAllLinearVersions
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.getAllLinearVersions()
-
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 move) 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 RepositoryException
- Specified by:
removeVersionLabel
in interfaceVersionHistory
- Throws:
RepositoryException
- See Also:
VersionHistory.removeVersionLabel(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(javax.jcr.version.Version)
-
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(javax.jcr.version.Version, String)
-
removeVersion
public void removeVersion(String versionName) throws UnsupportedRepositoryOperationException, VersionException, RepositoryException
- Specified by:
removeVersion
in interfaceVersionHistory
- Throws:
UnsupportedRepositoryOperationException
VersionException
RepositoryException
- See Also:
VersionHistory.removeVersion(String)
-
removeVersionHistory
public void removeVersionHistory() throws RepositoryException
Removes this VersionHistory from storage.- Throws:
RepositoryException
- if an error occurs.
-
isSame
public boolean isSame(Item otherItem)
Description copied from class:ItemImpl
- Specified by:
isSame
in interfaceItem
- Overrides:
isSame
in classItemImpl
- See Also:
Item.isSame(javax.jcr.Item)
-
getVersionableUUID
public String getVersionableUUID() throws RepositoryException
- Specified by:
getVersionableUUID
in interfaceVersionHistory
- Throws:
RepositoryException
-
getVersionableIdentifier
public String getVersionableIdentifier() throws RepositoryException
- Specified by:
getVersionableIdentifier
in interfaceVersionHistory
- Throws:
RepositoryException
-
update
public void update(String srcWorkspaceName) throws ConstraintViolationException
Always throws aConstraintViolationException
since this node is protected.- Specified by:
update
in interfaceNode
- Overrides:
update
in classNodeImpl
- Throws:
ConstraintViolationException
-
merge
public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws ConstraintViolationException
Always throws aConstraintViolationException
since this node is protected.- Specified by:
merge
in interfaceNode
- Overrides:
merge
in classNodeImpl
- Throws:
ConstraintViolationException
-
-