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 NodeEntryaddNewNodeEntry(Name nodeName, String uniqueID, Name primaryNodeType, QNodeDefinition definition)Adds a new, transient childNodeEntryPropertyEntryaddNewPropertyEntry(Name propName, QPropertyDefinition definition, QValue[] values, int propertyType)Add a new, transientPropertyEntryto thisNodeEntryand return thePropertyStateassociated with the new entry.NodeEntrygetDeepNodeEntry(Path path)Traverse the tree below this entry and return the child entry matching the given path.PropertyEntrygetDeepPropertyEntry(Path path)Traverse the tree below this entry and return the child entry matching the given path.NodeIdgetId()intgetIndex()Iterator<NodeEntry>getNodeEntries()Returns a unmodifiable iterator ofNodeEntryobjects denoting the the valid child NodeEntries present on thisNodeEntry.List<NodeEntry>getNodeEntries(Name nodeName)Returns a unmodifiable List ofNodeEntrys with the specified name.NodeEntrygetNodeEntry(Name nodeName, int index)Returns the validNodeEntrywith the specified name and index ornullif there's no matching entry.NodeEntrygetNodeEntry(Name nodeName, int index, boolean loadIfNotFound)Returns the validNodeEntrywith the specified name and index ornullif there's no matching entry.NodeStategetNodeState()NodeEntrygetOrAddNodeEntry(Name nodeName, int index, String uniqueID)Adds a child NodeEntry to this entry if it not yet present with this node entry.PropertyEntrygetOrAddPropertyEntry(Name propName)Add an existingPropertyEntrywith 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.PropertyEntrygetPropertyEntry(Name propName)Returns the validPropertyEntrywith the specified name ornullif no matching entry exists.PropertyEntrygetPropertyEntry(Name propName, boolean loadIfNotFound)Returns the validPropertyEntrywith the specified name ornullif no matching entry exists.StringgetUniqueID()NodeIdgetWorkspaceId()Returns the ID that must be used for resolving this entry OR loading its children entries from the persistent layer.booleanhasNodeEntry(Name nodeName)Determines if there is a validNodeEntrywith the specifiednodeName.booleanhasNodeEntry(Name nodeName, int index)Determines if there is a validNodeEntrywith the specifiednameandindex.booleanhasPropertyEntry(Name propName)Determines if there is a property entry with the specifiedName.booleanisTransientlyMoved()HierarchyEntrylookupDeepEntry(Path workspacePath)Traverse the tree below this entry and return the child entry matching the given 'workspacePath', i.e.NodeEntrymove(Name newName, NodeEntry newParent, boolean transientMove)Moves thisNodeEntryas new child entry of theNodeEntryidentified bynewParentand/or renames it tonewName.voidorderBefore(NodeEntry beforeEntry)Reorders this NodeEntry before the sibling entry specified by the givenbeforeEntry.voidrefresh(Event childEvent)The parent entry of a external event gets informed about the modification.voidsetNodeEntries(Iterator<ChildInfo> childInfos)Creates or updates theChildNodeEntriesof this node.voidsetPropertyEntries(Collection<Name> propNames)Adds property entries for the givenNames.voidsetUniqueID(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
NodeIdof this child node entry. - Throws:
InvalidItemStateExceptionRepositoryException
-
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:
InvalidItemStateExceptionRepositoryException- See Also:
getId()
-
getUniqueID
String getUniqueID()
- Returns:
- the unique ID of the node state which is referenced by this
child node entry or
nullif 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_UNDEFINEDis returned. - Throws:
InvalidItemStateExceptionRepositoryException
-
getNodeState
NodeState getNodeState() throws ItemNotFoundException, RepositoryException
- Returns:
- the referenced
NodeState. - Throws:
ItemNotFoundException- if theNodeStatedoes 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:
PathNotFoundExceptionRepositoryException
-
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:
PathNotFoundExceptionRepositoryException
-
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,
nullis return.- Parameters:
workspacePath-- Returns:
- matching entry or
null.
-
hasNodeEntry
boolean hasNodeEntry(Name nodeName)
Determines if there is a validNodeEntrywith the specifiednodeName.- Parameters:
nodeName-Nameobject specifying a node name- Returns:
trueif there is aNodeEntrywith the specifiednodeName.
-
hasNodeEntry
boolean hasNodeEntry(Name nodeName, int index)
Determines if there is a validNodeEntrywith the specifiednameandindex.- Parameters:
nodeName-Nameobject specifying a node name.index- 1-based index if there are same-name child node entries.- Returns:
trueif there is aNodeEntrywith the specifiednameandindex.
-
getNodeEntry
NodeEntry getNodeEntry(Name nodeName, int index) throws RepositoryException
Returns the validNodeEntrywith the specified name and index ornullif there's no matching entry.- Parameters:
nodeName-Nameobject specifying a node name.index- 1-based index if there are same-name child node entries.- Returns:
- The
NodeEntrywith the specified name and index ornullif 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 validNodeEntrywith the specified name and index ornullif there's no matching entry. IfloadIfNotFoundis 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-Nameobject specifying a node name.index- 1-based index if there are same-name child node entries.loadIfNotFound-- Returns:
- The
NodeEntrywith the specified name and index ornullif there's no matching entry. - Throws:
RepositoryException- If an unexpected error occurs.
-
getNodeEntries
Iterator<NodeEntry> getNodeEntries() throws RepositoryException
Returns a unmodifiable iterator ofNodeEntryobjects denoting the the valid child NodeEntries present on thisNodeEntry.- Returns:
- iterator of
NodeEntryobjects - Throws:
RepositoryException- If an unexpected error occurs.
-
getNodeEntries
List<NodeEntry> getNodeEntries(Name nodeName) throws RepositoryException
Returns a unmodifiable List ofNodeEntrys with the specified name.- Parameters:
nodeName- name of the child node entries that should be returned- Returns:
- list of
NodeEntryobjects - Throws:
RepositoryException- If an unexpected error occurs.
-
setNodeEntries
void setNodeEntries(Iterator<ChildInfo> childInfos) throws RepositoryException
Creates or updates theChildNodeEntriesof 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-Nameobject specifying a property name- Returns:
trueif there is a property entry with the specifiedName.
-
getPropertyEntry
PropertyEntry getPropertyEntry(Name propName) throws RepositoryException
Returns the validPropertyEntrywith the specified name ornullif no matching entry exists.- Parameters:
propName-Nameobject specifying a property name.- Returns:
- The
PropertyEntrywith the specified name ornullif no matching entry exists. - Throws:
RepositoryException- If an unexpected error occurs.
-
getPropertyEntry
PropertyEntry getPropertyEntry(Name propName, boolean loadIfNotFound) throws RepositoryException
Returns the validPropertyEntrywith the specified name ornullif no matching entry exists. IfloadIfNotFoundis 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-Nameobject specifying a property name.loadIfNotFound-- Returns:
- The
PropertyEntrywith the specified name ornullif 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 existingPropertyEntrywith 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 givenNames. 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:
ItemExistsExceptionRepositoryException- if an unexpected error occurs.
-
addNewPropertyEntry
PropertyEntry addNewPropertyEntry(Name propName, QPropertyDefinition definition, QValue[] values, int propertyType) throws ItemExistsException, RepositoryException
Add a new, transientPropertyEntryto thisNodeEntryand return thePropertyStateassociated with the new entry.- Parameters:
propName-definition-values-propertyType-- Returns:
- the new entry.
- Throws:
ItemExistsExceptionRepositoryException
-
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. Ifnullthis 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 thisNodeEntryas new child entry of theNodeEntryidentified bynewParentand/or renames it tonewName. IftransientMoveis 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
NodeEntryis 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-
-
-