Class VersionImpl
- java.lang.Object
-
- org.apache.jackrabbit.core.ItemImpl
-
- org.apache.jackrabbit.core.NodeImpl
-
- org.apache.jackrabbit.core.version.VersionImpl
-
-
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 VersionImpl(ItemManager itemMgr, SessionContext sessionContext, AbstractNodeData data)Create a new instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VersionHistorygetContainingHistory()CalendargetCreated()NodegetFrozenNode()InternalFrozenNodegetInternalFrozenNode()Returns the frozen node of this versionprotected InternalVersiongetInternalVersion()Returns the internal version.VersiongetLinearPredecessor()VersiongetLinearSuccessor()Version[]getPredecessors()Version[]getSuccessors()booleanisMoreRecent(VersionImpl v)Checks if this version is more recent than the given versionv.booleanisRootVersion()Checks if this is the root version.booleanisSame(Item otherItem)NodeIteratormerge(String srcWorkspace, boolean bestEffort)Always throws aConstraintViolationExceptionsince this node is protected.StringtoString()Return a string representation of this version node for diagnostic purposes.voidupdate(String srcWorkspaceName)Always throws aConstraintViolationExceptionsince this node is protected.-
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
-
VersionImpl
public VersionImpl(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
-
getInternalVersion
protected InternalVersion getInternalVersion() throws RepositoryException
Returns the internal version. Subclass responsibility.- Returns:
- internal version
- Throws:
RepositoryException- if the internal version is not available
-
getCreated
public Calendar getCreated() throws RepositoryException
- Specified by:
getCreatedin interfaceVersion- Throws:
RepositoryException
-
getSuccessors
public Version[] getSuccessors() throws RepositoryException
- Specified by:
getSuccessorsin interfaceVersion- Throws:
RepositoryException
-
getPredecessors
public Version[] getPredecessors() throws RepositoryException
- Specified by:
getPredecessorsin interfaceVersion- Throws:
RepositoryException
-
getLinearSuccessor
public Version getLinearSuccessor() throws RepositoryException
- Specified by:
getLinearSuccessorin interfaceVersion- Throws:
RepositoryException
-
getLinearPredecessor
public Version getLinearPredecessor() throws RepositoryException
- Specified by:
getLinearPredecessorin interfaceVersion- Throws:
RepositoryException
-
getContainingHistory
public VersionHistory getContainingHistory() throws RepositoryException
- Specified by:
getContainingHistoryin interfaceVersion- Throws:
RepositoryException
-
getInternalFrozenNode
public InternalFrozenNode getInternalFrozenNode() throws RepositoryException
Returns the frozen node of this version- Returns:
- the internal frozen node
- Throws:
RepositoryException- if an error occurs
-
getFrozenNode
public Node getFrozenNode() throws RepositoryException
- Specified by:
getFrozenNodein interfaceVersion- Throws:
RepositoryException
-
isSame
public boolean isSame(Item otherItem)
-
isMoreRecent
public boolean isMoreRecent(VersionImpl v) throws RepositoryException
Checks if this version is more recent than the given versionv. A version is more recent if and only if it is a successor (or a successor of a successor, etc., to any degree of separation) of the compared one.- Parameters:
v- the version to check- Returns:
trueif the version is more recent;falseotherwise.- Throws:
RepositoryException- if a repository error occurs
-
isRootVersion
public boolean isRootVersion() throws RepositoryExceptionChecks if this is the root version.- Returns:
trueif this version is the root version;falseotherwise.- Throws:
RepositoryException- if a repository error occurs
-
update
public void update(String srcWorkspaceName) throws ConstraintViolationException
Always throws aConstraintViolationExceptionsince this node is protected.- Specified by:
updatein interfaceNode- Overrides:
updatein classNodeImpl- Throws:
ConstraintViolationException
-
merge
public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws ConstraintViolationException
Always throws aConstraintViolationExceptionsince this node is protected.- Specified by:
mergein interfaceNode- Overrides:
mergein classNodeImpl- Throws:
ConstraintViolationException
-
-