Class VersionHistoryImpl
java.lang.Object
org.apache.jackrabbit.oak.jcr.session.NodeImpl<VersionHistoryDelegate>
org.apache.jackrabbit.oak.jcr.version.VersionHistoryImpl
- All Implemented Interfaces:
Item
,Node
,VersionHistory
,JackrabbitNode
VersionHistoryImpl
...-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final VersionHistoryDelegate
static final String
static final int
static final boolean
The value of this flag determines the behaviour ofItem.save()
.protected final SessionContext
protected final SessionDelegate
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
ConstructorsConstructorDescriptionVersionHistoryImpl
(VersionHistoryDelegate dlg, SessionContext sessionContext) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addVersionLabel
(String versionName, String label, boolean moveLabel) protected @NotNull PropertyState
createMultiState
(String oakName, List<Value> values, Type<?> type) protected @NotNull PropertyState
createSingleState
(String oakName, Value value, Type<?> type) getAncestor
(int depth) int
getDepth()
@NotNull String
getName()
@NotNull String
getPath()
@NotNull Session
getVersion
(String versionName) getVersionByLabel
(String label) String[]
String[]
getVersionLabels
(Version version) boolean
hasVersionLabel
(String label) boolean
hasVersionLabel
(Version version, String label) boolean
protected final <U> U
perform
(@NotNull SessionOperation<U> op) Perform the passedSessionOperation
.void
refresh
(boolean keepChanges) void
removeVersion
(String versionName) void
removeVersionLabel
(String label) void
save()
toString()
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 Details
-
ITEM_SAVE_DOES_SESSION_SAVE
- See Also:
-
MV_PROPERTY_WARN_THRESHOLD
public static final int MV_PROPERTY_WARN_THRESHOLD- See Also:
-
SAVE_SESSION
public static final boolean SAVE_SESSIONThe value of this flag determines the behaviour ofItem.save()
. Iffalse
, save will throw aUnsupportedRepositoryOperationException
if the sub tree rooted at this item does not contain all transient changes. Iftrue
, save will delegate toSession.save()
. -
sessionContext
-
dlg
-
sessionDelegate
-
-
Constructor Details
-
VersionHistoryImpl
-
-
Method Details
-
getVersionableUUID
- Specified by:
getVersionableUUID
in interfaceVersionHistory
- Throws:
RepositoryException
-
getVersionableIdentifier
- Specified by:
getVersionableIdentifier
in interfaceVersionHistory
- Throws:
RepositoryException
-
getRootVersion
- Specified by:
getRootVersion
in interfaceVersionHistory
- Throws:
RepositoryException
-
getAllLinearVersions
- Specified by:
getAllLinearVersions
in interfaceVersionHistory
- Throws:
RepositoryException
-
getAllVersions
- Specified by:
getAllVersions
in interfaceVersionHistory
- Throws:
RepositoryException
-
getAllLinearFrozenNodes
- Specified by:
getAllLinearFrozenNodes
in interfaceVersionHistory
- Throws:
RepositoryException
-
getAllFrozenNodes
- Specified by:
getAllFrozenNodes
in interfaceVersionHistory
- Throws:
RepositoryException
-
getVersion
- Specified by:
getVersion
in interfaceVersionHistory
- Throws:
VersionException
RepositoryException
-
getVersionByLabel
- Specified by:
getVersionByLabel
in interfaceVersionHistory
- Throws:
VersionException
RepositoryException
-
addVersionLabel
public void addVersionLabel(String versionName, String label, boolean moveLabel) throws LabelExistsVersionException, VersionException, RepositoryException - Specified by:
addVersionLabel
in interfaceVersionHistory
- Throws:
LabelExistsVersionException
VersionException
RepositoryException
-
removeVersionLabel
- Specified by:
removeVersionLabel
in interfaceVersionHistory
- Throws:
VersionException
RepositoryException
-
hasVersionLabel
- Specified by:
hasVersionLabel
in interfaceVersionHistory
- Throws:
RepositoryException
-
hasVersionLabel
public boolean hasVersionLabel(Version version, String label) throws VersionException, RepositoryException - Specified by:
hasVersionLabel
in interfaceVersionHistory
- Throws:
VersionException
RepositoryException
-
getVersionLabels
- Specified by:
getVersionLabels
in interfaceVersionHistory
- Throws:
RepositoryException
-
getVersionLabels
- Specified by:
getVersionLabels
in interfaceVersionHistory
- Throws:
VersionException
RepositoryException
-
removeVersion
public void removeVersion(String versionName) throws ReferentialIntegrityException, AccessDeniedException, UnsupportedRepositoryOperationException, VersionException, RepositoryException - Specified by:
removeVersion
in interfaceVersionHistory
- Throws:
ReferentialIntegrityException
AccessDeniedException
UnsupportedRepositoryOperationException
VersionException
RepositoryException
-
perform
@NotNull protected final <U> U perform(@NotNull @NotNull SessionOperation<U> op) throws RepositoryException Perform 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
- Specified by:
getName
in interfaceItem
- Throws:
RepositoryException
- See Also:
-
getPath
- Specified by:
getPath
in interfaceItem
- Throws:
RepositoryException
- See Also:
-
getSession
- Specified by:
getSession
in interfaceItem
-
getAncestor
- Specified by:
getAncestor
in interfaceItem
- Throws:
RepositoryException
-
getDepth
- Specified by:
getDepth
in interfaceItem
- Throws:
RepositoryException
-
isSame
- Specified by:
isSame
in interfaceItem
- Throws:
RepositoryException
- See Also:
-
save
This implementation delegates toSession.save()
ifSAVE_SESSION
istrue
. 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:
save
in interfaceItem
- Throws:
RepositoryException
- See Also:
-
refresh
- Specified by:
refresh
in interfaceItem
- Throws:
RepositoryException
- See Also:
-
toString
-
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
-