Class VersionImpl
- java.lang.Object
-
- org.apache.jackrabbit.oak.jcr.session.NodeImpl<VersionDelegate>
-
- org.apache.jackrabbit.oak.jcr.version.VersionImpl
-
- All Implemented Interfaces:
Item,Node,Version,JackrabbitNode
public class VersionImpl extends NodeImpl<VersionDelegate> implements Version
-
-
Field Summary
Fields Modifier and Type Field Description protected Tdlgstatic StringITEM_SAVE_DOES_SESSION_SAVEstatic intMV_PROPERTY_WARN_THRESHOLDstatic booleanSAVE_SESSIONThe value of this flag determines the behaviour ofItem.save().protected SessionContextsessionContextprotected SessionDelegatesessionDelegate-
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(VersionDelegate dlg, SessionContext sessionContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected @NotNull PropertyStatecreateMultiState(String oakName, List<Value> values, Type<?> type)protected @NotNull PropertyStatecreateSingleState(String oakName, Value value, Type<?> type)ItemgetAncestor(int depth)VersionHistorygetContainingHistory()CalendargetCreated()intgetDepth()NodegetFrozenNode()VersiongetLinearPredecessor()VersiongetLinearSuccessor()@NotNull StringgetName()@NotNull StringgetPath()Version[]getPredecessors()@NotNull SessiongetSession()Version[]getSuccessors()booleanisSame(Item otherItem)protected <U> Uperform(@NotNull SessionOperation<U> op)Perform the passedSessionOperation.voidrefresh(boolean keepChanges)voidsave()StringtoString()-
Methods inherited from class org.apache.jackrabbit.oak.jcr.session.NodeImpl
accept, addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, createNode, createNodeOrNull, doneMerge, followLifecycleTransition, getAllowedLifecycleTransistions, getBaseVersion, getCorrespondingNodePath, getDefinition, getIdentifier, getIndex, getLock, getMixinNodeTypes, getNode, getNodeOrNull, getNodes, getNodes, getNodes, getParent, getParentOrNull, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperties, getProperty, getPropertyOrNull, getReferences, getReferences, getSharedSet, getUUID, getVersionHistory, getWeakReferences, getWeakReferences, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, internalIsCheckedOut, isCheckedOut, isLocked, isModified, isNew, isNode, isNodeType, lock, merge, orderBefore, remove, removeMixin, removeShare, removeSharedSet, rename, restore, restore, restore, restoreByLabel, setMixins, setPrimaryType, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, unlock, update
-
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, isSame, 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
-
-
-
-
Field Detail
-
ITEM_SAVE_DOES_SESSION_SAVE
public static final String ITEM_SAVE_DOES_SESSION_SAVE
- See Also:
- Constant Field Values
-
MV_PROPERTY_WARN_THRESHOLD
public static final int MV_PROPERTY_WARN_THRESHOLD
- See Also:
- Constant Field Values
-
SAVE_SESSION
public static final boolean SAVE_SESSION
The value of this flag determines the behaviour ofItem.save(). Iffalse, save will throw aUnsupportedRepositoryOperationExceptionif the sub tree rooted at this item does not contain all transient changes. Iftrue, save will delegate toSession.save().
-
sessionContext
protected final SessionContext sessionContext
-
dlg
protected final T extends ItemDelegate dlg
-
sessionDelegate
protected final SessionDelegate sessionDelegate
-
-
Constructor Detail
-
VersionImpl
public VersionImpl(VersionDelegate dlg, SessionContext sessionContext)
-
-
Method Detail
-
getContainingHistory
public VersionHistory getContainingHistory() throws RepositoryException
- Specified by:
getContainingHistoryin interfaceVersion- Throws:
RepositoryException
-
getCreated
public Calendar getCreated() throws RepositoryException
- Specified by:
getCreatedin interfaceVersion- Throws:
RepositoryException
-
getLinearPredecessor
public Version getLinearPredecessor() throws RepositoryException
- Specified by:
getLinearPredecessorin interfaceVersion- Throws:
RepositoryException
-
getLinearSuccessor
public Version getLinearSuccessor() throws RepositoryException
- Specified by:
getLinearSuccessorin interfaceVersion- Throws:
RepositoryException
-
getPredecessors
public Version[] getPredecessors() throws RepositoryException
- Specified by:
getPredecessorsin interfaceVersion- Throws:
RepositoryException
-
getSuccessors
public Version[] getSuccessors() throws RepositoryException
- Specified by:
getSuccessorsin interfaceVersion- Throws:
RepositoryException
-
getFrozenNode
public Node getFrozenNode() throws RepositoryException
- Specified by:
getFrozenNodein interfaceVersion- Throws:
RepositoryException
-
perform
@NotNull protected final <U> U perform(@NotNull @NotNull SessionOperation<U> op) throws RepositoryExceptionPerform the passedSessionOperation.- Type Parameters:
U- return type of the operation- Parameters:
op- operation to perform- Returns:
- the result of
op.perform() - Throws:
RepositoryException- as thrown byop.perform().
-
getName
@NotNull public @NotNull String getName() throws RepositoryException
- Specified by:
getNamein interfaceItem- Throws:
RepositoryException- See Also:
Item.getName()
-
getPath
@NotNull public @NotNull String getPath() throws RepositoryException
- Specified by:
getPathin interfaceItem- Throws:
RepositoryException- See Also:
Item.getPath()
-
getSession
@NotNull public @NotNull Session getSession()
- Specified by:
getSessionin interfaceItem
-
getAncestor
public Item getAncestor(int depth) throws RepositoryException
- Specified by:
getAncestorin interfaceItem- Throws:
RepositoryException
-
getDepth
public int getDepth() throws RepositoryException- Specified by:
getDepthin interfaceItem- Throws:
RepositoryException
-
isSame
public boolean isSame(Item otherItem) throws RepositoryException
- Specified by:
isSamein interfaceItem- Throws:
RepositoryException- See Also:
Item.isSame(javax.jcr.Item)
-
save
public void save() throws RepositoryExceptionThis implementation delegates toSession.save()ifSAVE_SESSIONistrue. Otherwise it only performs the save if the subtree rooted at this item contains all transient changes. That is, if callingSession.save()would have the same effect as calling this method. In all other cases this method will throw anUnsupportedRepositoryOperationException- Specified by:
savein interfaceItem- Throws:
RepositoryException- See Also:
Item.save()
-
refresh
public void refresh(boolean keepChanges) throws RepositoryException- Specified by:
refreshin interfaceItem- Throws:
RepositoryException- See Also:
Item.refresh(boolean)
-
createSingleState
@NotNull protected @NotNull PropertyState createSingleState(String oakName, Value value, Type<?> type) throws RepositoryException
- Throws:
RepositoryException
-
createMultiState
@NotNull protected @NotNull PropertyState createMultiState(String oakName, List<Value> values, Type<?> type) throws RepositoryException
- Throws:
RepositoryException
-
-