org.apache.jackrabbit.jcr2spi.hierarchy
Interface NodeEntry

All Superinterfaces:
HierarchyEntry
All Known Implementing Classes:
NodeEntryImpl

public interface NodeEntry
extends HierarchyEntry

NodeEntry...


Method Summary
 NodeEntry addNewNodeEntry(Name nodeName, String uniqueID, Name primaryNodeType, QNodeDefinition definition)
          Adds a new, transient child NodeEntry
 PropertyEntry addNewPropertyEntry(Name propName, QPropertyDefinition definition, QValue[] values, int propertyType)
          Add a new, transient PropertyEntry to this NodeEntry and return the PropertyState 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 of NodeEntry objects denoting the the valid child NodeEntries present on this NodeEntry.
 List<NodeEntry> getNodeEntries(Name nodeName)
          Returns a unmodifiable List of NodeEntrys with the specified name.
 NodeEntry getNodeEntry(Name nodeName, int index)
          Returns the valid NodeEntry with the specified name and index or null if there's no matching entry.
 NodeEntry getNodeEntry(Name nodeName, int index, boolean loadIfNotFound)
          Returns the valid NodeEntry with the specified name and index or null 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 existing PropertyEntry with the given name if it is not yet contained in this NodeEntry.
 Iterator<PropertyEntry> getPropertyEntries()
          Returns an unmodifiable Iterator over those children that represent valid PropertyEntries.
 PropertyEntry getPropertyEntry(Name propName)
          Returns the valid PropertyEntry with the specified name or null if no matching entry exists.
 PropertyEntry getPropertyEntry(Name propName, boolean loadIfNotFound)
          Returns the valid PropertyEntry with the specified name or null 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 valid NodeEntry with the specified nodeName.
 boolean hasNodeEntry(Name nodeName, int index)
          Determines if there is a valid NodeEntry with the specified name and index.
 boolean hasPropertyEntry(Name propName)
          Determines if there is a property entry with the specified Name.
 boolean isTransientlyMoved()
           
 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.
 NodeEntry move(Name newName, NodeEntry newParent, boolean transientMove)
          Moves this NodeEntry as new child entry of the NodeEntry identified by newParent and/or renames it to newName.
 void orderBefore(NodeEntry beforeEntry)
          Reorders this NodeEntry before the sibling entry specified by the given beforeEntry.
 void refresh(Event childEvent)
          The parent entry of a external event gets informed about the modification.
 void setNodeEntries(Iterator<ChildInfo> childInfos)
          Creates or updates the ChildNodeEntries of this node.
 void setPropertyEntries(Collection<Name> propNames)
          Adds property entries for the given Names.
 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 as getId() 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 suppport 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 the NodeState does not exist.
RepositoryException - If an error occurs while retrieving the NodeState.

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 valid NodeEntry with the specified nodeName.

Parameters:
nodeName - Name object specifying a node name
Returns:
true if there is a NodeEntry with the specified nodeName.

hasNodeEntry

boolean hasNodeEntry(Name nodeName,
                     int index)
Determines if there is a valid NodeEntry with the specified name and index.

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 a NodeEntry with the specified name and index.

getNodeEntry

NodeEntry getNodeEntry(Name nodeName,
                       int index)
                       throws RepositoryException
Returns the valid NodeEntry with the specified name and index or null 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 or null 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 valid NodeEntry with the specified name and index or null if there's no matching entry. If loadIfNotFound 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 or null if there's no matching entry.
Throws:
RepositoryException - If an unexpected error occurs.

getNodeEntries

Iterator<NodeEntry> getNodeEntries()
                                   throws RepositoryException
Returns a unmodifiable iterator of NodeEntry objects denoting the the valid child NodeEntries present on this NodeEntry.

Returns:
iterator of NodeEntry objects
Throws:
RepositoryException - If an unexpected error occurs.

getNodeEntries

List<NodeEntry> getNodeEntries(Name nodeName)
                               throws RepositoryException
Returns a unmodifiable List of NodeEntrys 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 the ChildNodeEntries 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 child NodeEntry

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 specified Name.

Parameters:
propName - Name object specifying a property name
Returns:
true if there is a property entry with the specified Name.

getPropertyEntry

PropertyEntry getPropertyEntry(Name propName)
                               throws RepositoryException
Returns the valid PropertyEntry with the specified name or null if no matching entry exists.

Parameters:
propName - Name object specifying a property name.
Returns:
The PropertyEntry with the specified name or null if no matching entry exists.
Throws:
RepositoryException - If an unexpected error occurs.

getPropertyEntry

PropertyEntry getPropertyEntry(Name propName,
                               boolean loadIfNotFound)
                               throws RepositoryException
Returns the valid PropertyEntry with the specified name or null if no matching entry exists. If loadIfNotFound 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 or null 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 existing PropertyEntry with the given name if it is not yet contained in this NodeEntry. Please note the difference to addNewPropertyEntry(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 name
RepositoryException - if an unexpected error occurs.

setPropertyEntries

void setPropertyEntries(Collection<Name> propNames)
                        throws ItemExistsException,
                               RepositoryException
Adds property entries for the given Names. It depends on the status of this NodeEntry, 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, transient PropertyEntry to this NodeEntry and return the PropertyState 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 given beforeEntry.

Parameters:
beforeEntry - the child node where to insert the node before. If null 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 this NodeEntry as new child entry of the NodeEntry identified by newParent and/or renames it to newName. If transientMove is true, an implementation must make sure, that reverting this modification by calling HierarchyEntry.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, that Event.getParentId() of the given childEvent must point to this NodeEntry.

Parameters:
childEvent -


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.