Interface NodeEntry

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      NodeEntry addNewNodeEntry​(org.apache.jackrabbit.spi.Name nodeName, String uniqueID, org.apache.jackrabbit.spi.Name primaryNodeType, org.apache.jackrabbit.spi.QNodeDefinition definition)
      Adds a new, transient child NodeEntry
      PropertyEntry addNewPropertyEntry​(org.apache.jackrabbit.spi.Name propName, org.apache.jackrabbit.spi.QPropertyDefinition definition, org.apache.jackrabbit.spi.QValue[] values, int propertyType)
      Add a new, transient PropertyEntry to this NodeEntry and return the PropertyState associated with the new entry.
      NodeEntry getDeepNodeEntry​(org.apache.jackrabbit.spi.Path path)
      Traverse the tree below this entry and return the child entry matching the given path.
      PropertyEntry getDeepPropertyEntry​(org.apache.jackrabbit.spi.Path path)
      Traverse the tree below this entry and return the child entry matching the given path.
      org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.Name nodeName)
      Returns a unmodifiable List of NodeEntrys with the specified name.
      NodeEntry getNodeEntry​(org.apache.jackrabbit.spi.Name nodeName, int index)
      Returns the valid NodeEntry with the specified name and index or null if there's no matching entry.
      NodeEntry getNodeEntry​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.Name nodeName, int index, String uniqueID)
      Adds a child NodeEntry to this entry if it not yet present with this node entry.
      PropertyEntry getOrAddPropertyEntry​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.Name propName)
      Returns the valid PropertyEntry with the specified name or null if no matching entry exists.
      PropertyEntry getPropertyEntry​(org.apache.jackrabbit.spi.Name propName, boolean loadIfNotFound)
      Returns the valid PropertyEntry with the specified name or null if no matching entry exists.
      String getUniqueID()  
      org.apache.jackrabbit.spi.NodeId getWorkspaceId()
      Returns the ID that must be used for resolving this entry OR loading its children entries from the persistent layer.
      boolean hasNodeEntry​(org.apache.jackrabbit.spi.Name nodeName)
      Determines if there is a valid NodeEntry with the specified nodeName.
      boolean hasNodeEntry​(org.apache.jackrabbit.spi.Name nodeName, int index)
      Determines if there is a valid NodeEntry with the specified name and index.
      boolean hasPropertyEntry​(org.apache.jackrabbit.spi.Name propName)
      Determines if there is a property entry with the specified Name.
      boolean isTransientlyMoved()  
      HierarchyEntry lookupDeepEntry​(org.apache.jackrabbit.spi.Path workspacePath)
      Traverse the tree below this entry and return the child entry matching the given 'workspacePath', i.e.
      NodeEntry move​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.Event childEvent)
      The parent entry of a external event gets informed about the modification.
      void setNodeEntries​(Iterator<org.apache.jackrabbit.spi.ChildInfo> childInfos)
      Creates or updates the ChildNodeEntries of this node.
      void setPropertyEntries​(Collection<org.apache.jackrabbit.spi.Name> propNames)
      Adds property entries for the given Names.
      void setUniqueID​(String uniqueID)  
    • Method Detail

      • 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 -
      • getDeepNodeEntry

        NodeEntry getDeepNodeEntry​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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<org.apache.jackrabbit.spi.ChildInfo> childInfos)
                     throws RepositoryException
        Creates or updates the ChildNodeEntries of this node.
        Parameters:
        childInfos -
        Throws:
        RepositoryException
      • getOrAddNodeEntry

        NodeEntry getOrAddNodeEntry​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.Name nodeName,
                                  String uniqueID,
                                  org.apache.jackrabbit.spi.Name primaryNodeType,
                                  org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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.
      • setPropertyEntries

        void setPropertyEntries​(Collection<org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.Name propName,
                                          org.apache.jackrabbit.spi.QPropertyDefinition definition,
                                          org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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​(org.apache.jackrabbit.spi.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 -