public class VersionImpl extends NodeImpl<VersionDelegate> implements Version
Modifier and Type | Field and Description |
---|---|
protected T |
dlg |
static java.lang.String |
ITEM_SAVE_DOES_SESSION_SAVE |
static int |
MV_PROPERTY_WARN_THRESHOLD |
static boolean |
SAVE_SESSION
The value of this flag determines the behaviour of
save() . |
protected SessionContext |
sessionContext |
protected SessionDelegate |
sessionDelegate |
JCR_CHILD_NODE_DEFINITION, JCR_CONTENT, JCR_FROZEN_NODE, JCR_PROPERTY_DEFINITION, JCR_ROOT_VERSION, JCR_VERSION_LABELS
Constructor and Description |
---|
VersionImpl(VersionDelegate dlg,
SessionContext sessionContext) |
Modifier and Type | Method and Description |
---|---|
protected @NotNull PropertyState |
createMultiState(java.lang.String oakName,
java.util.List<Value> values,
Type<?> type) |
protected @NotNull PropertyState |
createSingleState(java.lang.String oakName,
Value value,
Type<?> type) |
Item |
getAncestor(int depth) |
VersionHistory |
getContainingHistory() |
java.util.Calendar |
getCreated() |
int |
getDepth() |
Node |
getFrozenNode() |
Version |
getLinearPredecessor() |
Version |
getLinearSuccessor() |
@NotNull java.lang.String |
getName() |
@NotNull java.lang.String |
getPath() |
Version[] |
getPredecessors() |
@NotNull Session |
getSession() |
Version[] |
getSuccessors() |
boolean |
isSame(Item otherItem) |
protected <U> U |
perform(@NotNull SessionOperation<U> op)
Perform the passed
SessionOperation . |
void |
refresh(boolean keepChanges) |
void |
save()
|
java.lang.String |
toString() |
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, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperties, getProperty, getPropertyOrNull, getReferences, getReferences, getSharedSet, getUUID, getVersionHistory, getWeakReferences, getWeakReferences, hasNode, hasNodes, hasProperties, hasProperty, holdsLock, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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
accept, getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isNode, isSame, refresh, remove, save
public static final java.lang.String ITEM_SAVE_DOES_SESSION_SAVE
public static final int MV_PROPERTY_WARN_THRESHOLD
public static final boolean SAVE_SESSION
save()
. If false
,
save will throw a UnsupportedRepositoryOperationException
if the
sub tree rooted at this item does not contain all transient changes. If
true
, save will delegate to Session.save()
.protected final SessionContext sessionContext
protected final T extends ItemDelegate dlg
protected final SessionDelegate sessionDelegate
public VersionImpl(VersionDelegate dlg, SessionContext sessionContext)
public VersionHistory getContainingHistory() throws RepositoryException
getContainingHistory
in interface Version
RepositoryException
public java.util.Calendar getCreated() throws RepositoryException
getCreated
in interface Version
RepositoryException
public Version getLinearPredecessor() throws RepositoryException
getLinearPredecessor
in interface Version
RepositoryException
public Version getLinearSuccessor() throws RepositoryException
getLinearSuccessor
in interface Version
RepositoryException
public Version[] getPredecessors() throws RepositoryException
getPredecessors
in interface Version
RepositoryException
public Version[] getSuccessors() throws RepositoryException
getSuccessors
in interface Version
RepositoryException
public Node getFrozenNode() throws RepositoryException
getFrozenNode
in interface Version
RepositoryException
@NotNull protected final <U> U perform(@NotNull @NotNull SessionOperation<U> op) throws RepositoryException
SessionOperation
.U
- return type of the operationop
- operation to performop.perform()
RepositoryException
- as thrown by op.perform()
.@NotNull public @NotNull java.lang.String getName() throws RepositoryException
getName
in interface Item
RepositoryException
Item.getName()
@NotNull public @NotNull java.lang.String getPath() throws RepositoryException
getPath
in interface Item
RepositoryException
Item.getPath()
@NotNull public @NotNull Session getSession()
getSession
in interface Item
public Item getAncestor(int depth) throws RepositoryException
getAncestor
in interface Item
RepositoryException
public int getDepth() throws RepositoryException
getDepth
in interface Item
RepositoryException
public boolean isSame(Item otherItem) throws RepositoryException
isSame
in interface Item
RepositoryException
Item.isSame(javax.jcr.Item)
public void save() throws RepositoryException
Session.save()
if SAVE_SESSION
is
true
. Otherwise it only performs the save if the subtree rooted at this item contains
all transient changes. That is, if calling Session.save()
would have the same effect
as calling this method. In all other cases this method will throw an
UnsupportedRepositoryOperationException
save
in interface Item
RepositoryException
Item.save()
public void refresh(boolean keepChanges) throws RepositoryException
refresh
in interface Item
RepositoryException
Item.refresh(boolean)
public java.lang.String toString()
toString
in class java.lang.Object
@NotNull protected @NotNull PropertyState createSingleState(java.lang.String oakName, Value value, Type<?> type) throws RepositoryException
RepositoryException
@NotNull protected @NotNull PropertyState createMultiState(java.lang.String oakName, java.util.List<Value> values, Type<?> type) throws RepositoryException
RepositoryException
Copyright © 2012–2022 The Apache Software Foundation. All rights reserved.