public class VersionImpl extends NodeImpl<VersionDelegate> implements Version
Modifier and Type | Field and Description |
---|---|
protected T |
dlg |
static 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 org.apache.jackrabbit.oak.api.PropertyState |
createMultiState(String oakName,
List<Value> values,
org.apache.jackrabbit.oak.api.Type<?> type) |
protected org.apache.jackrabbit.oak.api.PropertyState |
createSingleState(String oakName,
Value value,
org.apache.jackrabbit.oak.api.Type<?> type) |
Item |
getAncestor(int depth) |
VersionHistory |
getContainingHistory() |
Calendar |
getCreated() |
int |
getDepth() |
Node |
getFrozenNode() |
Version |
getLinearPredecessor() |
Version |
getLinearSuccessor() |
String |
getName() |
String |
getPath() |
Version[] |
getPredecessors() |
Session |
getSession() |
Version[] |
getSuccessors() |
boolean |
isSame(Item otherItem) |
protected <U> U |
perform(SessionOperation<U> op)
Perform the passed
SessionOperation . |
void |
refresh(boolean keepChanges) |
void |
save()
|
String |
toString() |
accept, addMixin, addNode, addNode, canAddMixin, cancelMerge, checkin, checkout, createNode, createNodeOrNull, doneMerge, followLifecycleTransition, getAllowedLifecycleTransistions, getBaseVersion, getCorrespondingNodePath, getDefinition, getIdentifier, getIndex, getLock, getMixinNodeTypes, getNode, getNodes, getNodes, getNodes, getParent, getPrimaryItem, getPrimaryNodeType, getProperties, getProperties, getProperties, getProperty, 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 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 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
@Nonnull protected final <U> U perform(@Nonnull SessionOperation<U> op) throws RepositoryException
SessionOperation
.U
- return type of the operationop
- operation to performop.perform()
RepositoryException
- as thrown by op.perform()
.@Nonnull public String getName() throws RepositoryException
getName
in interface Item
RepositoryException
Item.getName()
@Nonnull public String getPath() throws RepositoryException
getPath
in interface Item
RepositoryException
Item.getPath()
@Nonnull public 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)
@Nonnull protected org.apache.jackrabbit.oak.api.PropertyState createSingleState(String oakName, Value value, org.apache.jackrabbit.oak.api.Type<?> type) throws RepositoryException
RepositoryException
@Nonnull protected org.apache.jackrabbit.oak.api.PropertyState createMultiState(String oakName, List<Value> values, org.apache.jackrabbit.oak.api.Type<?> type) throws RepositoryException
RepositoryException
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.