Interface NodeEntry
-
- All Superinterfaces:
HierarchyEntry
- All Known Implementing Classes:
NodeEntryImpl
public interface NodeEntry extends HierarchyEntry
NodeEntry
...
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description NodeEntry
addNewNodeEntry(Name nodeName, String uniqueID, Name primaryNodeType, QNodeDefinition definition)
Adds a new, transient childNodeEntry
PropertyEntry
addNewPropertyEntry(Name propName, QPropertyDefinition definition, QValue[] values, int propertyType)
Add a new, transientPropertyEntry
to thisNodeEntry
and return thePropertyState
associated with the new entry.NodeEntry
getDeepNodeEntry(Path path)
Traverse the tree below this entry and return the child entry matching the given path.PropertyEntry
getDeepPropertyEntry(Path path)
Traverse the tree below this entry and return the child entry matching the given path.NodeId
getId()
int
getIndex()
Iterator<NodeEntry>
getNodeEntries()
Returns a unmodifiable iterator ofNodeEntry
objects denoting the the valid child NodeEntries present on thisNodeEntry
.List<NodeEntry>
getNodeEntries(Name nodeName)
Returns a unmodifiable List ofNodeEntry
s with the specified name.NodeEntry
getNodeEntry(Name nodeName, int index)
Returns the validNodeEntry
with the specified name and index ornull
if there's no matching entry.NodeEntry
getNodeEntry(Name nodeName, int index, boolean loadIfNotFound)
Returns the validNodeEntry
with the specified name and index ornull
if there's no matching entry.NodeState
getNodeState()
NodeEntry
getOrAddNodeEntry(Name nodeName, int index, String uniqueID)
Adds a child NodeEntry to this entry if it not yet present with this node entry.PropertyEntry
getOrAddPropertyEntry(Name propName)
Add an existingPropertyEntry
with the given name if it is not yet contained in thisNodeEntry
.Iterator<PropertyEntry>
getPropertyEntries()
Returns an unmodifiable Iterator over those children that represent valid PropertyEntries.PropertyEntry
getPropertyEntry(Name propName)
Returns the validPropertyEntry
with the specified name ornull
if no matching entry exists.PropertyEntry
getPropertyEntry(Name propName, boolean loadIfNotFound)
Returns the validPropertyEntry
with the specified name ornull
if no matching entry exists.String
getUniqueID()
NodeId
getWorkspaceId()
Returns the ID that must be used for resolving this entry OR loading its children entries from the persistent layer.boolean
hasNodeEntry(Name nodeName)
Determines if there is a validNodeEntry
with the specifiednodeName
.boolean
hasNodeEntry(Name nodeName, int index)
Determines if there is a validNodeEntry
with the specifiedname
andindex
.boolean
hasPropertyEntry(Name propName)
Determines if there is a property entry with the specifiedName
.boolean
isTransientlyMoved()
HierarchyEntry
lookupDeepEntry(Path workspacePath)
Traverse the tree below this entry and return the child entry matching the given 'workspacePath', i.e.NodeEntry
move(Name newName, NodeEntry newParent, boolean transientMove)
Moves thisNodeEntry
as new child entry of theNodeEntry
identified bynewParent
and/or renames it tonewName
.void
orderBefore(NodeEntry beforeEntry)
Reorders this NodeEntry before the sibling entry specified by the givenbeforeEntry
.void
refresh(Event childEvent)
The parent entry of a external event gets informed about the modification.void
setNodeEntries(Iterator<ChildInfo> childInfos)
Creates or updates theChildNodeEntries
of this node.void
setPropertyEntries(Collection<Name> propNames)
Adds property entries for the givenName
s.void
setUniqueID(String uniqueID)
-
Methods inherited from interface org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry
calculateStatus, complete, denotesNode, getGeneration, getItemState, getName, getParent, getPath, getStatus, getWorkspacePath, invalidate, isAvailable, reload, remove, revert, setItemState, transientRemove
-
-
-
-
Method Detail
-
getId
NodeId getId() throws InvalidItemStateException, RepositoryException
- Returns:
- the
NodeId
of this child node entry. - Throws:
InvalidItemStateException
RepositoryException
-
getWorkspaceId
NodeId getWorkspaceId() throws InvalidItemStateException, RepositoryException
Returns the ID that must be used for resolving this entry OR loading its children entries from the persistent layer. This is the same asgetId()
unless this entry or any of its ancestors has been transiently moved.- Returns:
- Throws:
InvalidItemStateException
RepositoryException
- See Also:
getId()
-
getUniqueID
String getUniqueID()
- Returns:
- the unique ID of the node state which is referenced by this
child node entry or
null
if the node state cannot be identified with a unique ID.
-
setUniqueID
void setUniqueID(String uniqueID)
- Parameters:
uniqueID
-
-
getIndex
int getIndex() throws InvalidItemStateException, RepositoryException
- Returns:
- the index of this child node entry to support same-name siblings.
If the index of this entry cannot be determined
Path.INDEX_UNDEFINED
is returned. - Throws:
InvalidItemStateException
RepositoryException
-
getNodeState
NodeState getNodeState() throws ItemNotFoundException, RepositoryException
- Returns:
- the referenced
NodeState
. - Throws:
ItemNotFoundException
- if theNodeState
does not exist.RepositoryException
- If an error occurs while retrieving theNodeState
.
-
getDeepNodeEntry
NodeEntry getDeepNodeEntry(Path path) throws PathNotFoundException, RepositoryException
Traverse the tree below this entry and return the child entry matching the given path. If that entry has not been loaded yet, try to do so. NOTE: In contrast to getNodeEntry, getNodeEntries this method may return invalid entries, i.e. entries connected to a removed or stale ItemState.- Parameters:
path
-- Returns:
- the entry at the given path.
- Throws:
PathNotFoundException
RepositoryException
-
getDeepPropertyEntry
PropertyEntry getDeepPropertyEntry(Path path) throws PathNotFoundException, RepositoryException
Traverse the tree below this entry and return the child entry matching the given path. If that entry has not been loaded yet, try to do so. NOTE: In contrast to getPropertyEntry and getPropertyEntries this method may return invalid entries, i.e. entries connected to a removed or stale ItemState.- Parameters:
path
-- Returns:
- the property entry at the given path.
- Throws:
PathNotFoundException
RepositoryException
-
lookupDeepEntry
HierarchyEntry lookupDeepEntry(Path workspacePath)
Traverse the tree below this entry and return the child entry matching the given 'workspacePath', i.e. transient modifications and new entries are ignored.If no matching entry can be found,
null
is return.- Parameters:
workspacePath
-- Returns:
- matching entry or
null
.
-
hasNodeEntry
boolean hasNodeEntry(Name nodeName)
Determines if there is a validNodeEntry
with the specifiednodeName
.- Parameters:
nodeName
-Name
object specifying a node name- Returns:
true
if there is aNodeEntry
with the specifiednodeName
.
-
hasNodeEntry
boolean hasNodeEntry(Name nodeName, int index)
Determines if there is a validNodeEntry
with the specifiedname
andindex
.- Parameters:
nodeName
-Name
object specifying a node name.index
- 1-based index if there are same-name child node entries.- Returns:
true
if there is aNodeEntry
with the specifiedname
andindex
.
-
getNodeEntry
NodeEntry getNodeEntry(Name nodeName, int index) throws RepositoryException
Returns the validNodeEntry
with the specified name and index ornull
if there's no matching entry.- Parameters:
nodeName
-Name
object specifying a node name.index
- 1-based index if there are same-name child node entries.- Returns:
- The
NodeEntry
with the specified name and index ornull
if there's no matching entry. - Throws:
RepositoryException
- If an unexpected error occurs.
-
getNodeEntry
NodeEntry getNodeEntry(Name nodeName, int index, boolean loadIfNotFound) throws RepositoryException
Returns the validNodeEntry
with the specified name and index ornull
if there's no matching entry. IfloadIfNotFound
is true, the implementation must make sure, that it's list of child entries is up to date and eventually try to load the node entry.- Parameters:
nodeName
-Name
object specifying a node name.index
- 1-based index if there are same-name child node entries.loadIfNotFound
-- Returns:
- The
NodeEntry
with the specified name and index ornull
if there's no matching entry. - Throws:
RepositoryException
- If an unexpected error occurs.
-
getNodeEntries
Iterator<NodeEntry> getNodeEntries() throws RepositoryException
Returns a unmodifiable iterator ofNodeEntry
objects denoting the the valid child NodeEntries present on thisNodeEntry
.- Returns:
- iterator of
NodeEntry
objects - Throws:
RepositoryException
- If an unexpected error occurs.
-
getNodeEntries
List<NodeEntry> getNodeEntries(Name nodeName) throws RepositoryException
Returns a unmodifiable List ofNodeEntry
s with the specified name.- Parameters:
nodeName
- name of the child node entries that should be returned- Returns:
- list of
NodeEntry
objects - Throws:
RepositoryException
- If an unexpected error occurs.
-
setNodeEntries
void setNodeEntries(Iterator<ChildInfo> childInfos) throws RepositoryException
Creates or updates theChildNodeEntries
of this node.- Parameters:
childInfos
-- Throws:
RepositoryException
-
getOrAddNodeEntry
NodeEntry getOrAddNodeEntry(Name nodeName, int index, String uniqueID) throws RepositoryException
Adds a child NodeEntry to this entry if it not yet present with this node entry.- Parameters:
nodeName
-index
-uniqueID
-- Returns:
- the
NodeEntry
. - Throws:
RepositoryException
- If an unexpected error occurs.
-
addNewNodeEntry
NodeEntry addNewNodeEntry(Name nodeName, String uniqueID, Name primaryNodeType, QNodeDefinition definition) throws RepositoryException
Adds a new, transient childNodeEntry
- Parameters:
nodeName
-uniqueID
-primaryNodeType
-definition
-- Returns:
- Throws:
RepositoryException
- If an error occurs.
-
hasPropertyEntry
boolean hasPropertyEntry(Name propName)
Determines if there is a property entry with the specifiedName
.- Parameters:
propName
-Name
object specifying a property name- Returns:
true
if there is a property entry with the specifiedName
.
-
getPropertyEntry
PropertyEntry getPropertyEntry(Name propName) throws RepositoryException
Returns the validPropertyEntry
with the specified name ornull
if no matching entry exists.- Parameters:
propName
-Name
object specifying a property name.- Returns:
- The
PropertyEntry
with the specified name ornull
if no matching entry exists. - Throws:
RepositoryException
- If an unexpected error occurs.
-
getPropertyEntry
PropertyEntry getPropertyEntry(Name propName, boolean loadIfNotFound) throws RepositoryException
Returns the validPropertyEntry
with the specified name ornull
if no matching entry exists. IfloadIfNotFound
is true, the implementation must make sure, that it's list of property entries is up to date and eventually try to load the property entry with the given name.- Parameters:
propName
-Name
object specifying a property name.loadIfNotFound
-- Returns:
- The
PropertyEntry
with the specified name ornull
if no matching entry exists. - Throws:
RepositoryException
- If an unexpected error occurs.
-
getPropertyEntries
Iterator<PropertyEntry> getPropertyEntries()
Returns an unmodifiable Iterator over those children that represent valid PropertyEntries.- Returns:
- an unmodifiable Iterator over those children that represent valid PropertyEntries.
-
getOrAddPropertyEntry
PropertyEntry getOrAddPropertyEntry(Name propName) throws ItemExistsException, RepositoryException
Add an existingPropertyEntry
with the given name if it is not yet contained in thisNodeEntry
. Please note the difference toaddNewPropertyEntry(Name, QPropertyDefinition, QValue[], int)
which adds a new, transient entry.- Parameters:
propName
-- Returns:
- the
PropertyEntry
- Throws:
ItemExistsException
- if a child item exists with the given nameRepositoryException
- if an unexpected error occurs.
-
setPropertyEntries
void setPropertyEntries(Collection<Name> propNames) throws ItemExistsException, RepositoryException
Adds property entries for the givenName
s. It depends on the status of thisNodeEntry
, how conflicts are resolved and whether or not existing entries that are missing in the iterator get removed.- Parameters:
propNames
-- Throws:
ItemExistsException
RepositoryException
- if an unexpected error occurs.
-
addNewPropertyEntry
PropertyEntry addNewPropertyEntry(Name propName, QPropertyDefinition definition, QValue[] values, int propertyType) throws ItemExistsException, RepositoryException
Add a new, transientPropertyEntry
to thisNodeEntry
and return thePropertyState
associated with the new entry.- Parameters:
propName
-definition
-values
-propertyType
-- Returns:
- the new entry.
- Throws:
ItemExistsException
RepositoryException
-
orderBefore
void orderBefore(NodeEntry beforeEntry) throws RepositoryException
Reorders this NodeEntry before the sibling entry specified by the givenbeforeEntry
.- Parameters:
beforeEntry
- the child node where to insert the node before. Ifnull
this entry is moved to the end of its parents child node entries.- Throws:
RepositoryException
- If an unexpected error occurs.
-
move
NodeEntry move(Name newName, NodeEntry newParent, boolean transientMove) throws RepositoryException
Moves thisNodeEntry
as new child entry of theNodeEntry
identified bynewParent
and/or renames it tonewName
. IftransientMove
is true, an implementation must make sure, that reverting this modification by callingHierarchyEntry.revert()
on the common ancestor of both parents moves this NodeEntry back and resets the name to its original value.- Parameters:
newName
-newParent
-- Returns:
- the moved entry
- Throws:
RepositoryException
- If the entry to be moved is not a child of this NodeEntry or if an unexpected error occurs.
-
isTransientlyMoved
boolean isTransientlyMoved()
- Returns:
- true if this
NodeEntry
is transiently moved.
-
refresh
void refresh(Event childEvent)
The parent entry of a external event gets informed about the modification. Note, thatEvent.getParentId()
of the given childEvent must point to thisNodeEntry
.- Parameters:
childEvent
-
-
-