protected NodeCacheIterator nodes( String workspaceName,
                                       Path path ) {
        // Determine which filter we should use based upon the workspace name. For the system workspace,
        // all queryable nodes are included. For all other workspaces, all queryable nodes are included except
        // for those that are actually stored in the system workspace (e.g., the "/jcr:system" nodes).
        NodeFilter nodeFilterForWorkspace = nodeFilterForWorkspace(workspaceName);
        if (nodeFilterForWorkspace == null) return null;
        // always append a shared nodes filter to the end of the workspace filter,
        // JCR #14.16 -If a query matches a descendant node of a shared set, it appears in query results only once.
        NodeFilter compositeFilter = new CompositeNodeFilter(nodeFilterForWorkspace, sharedNodesFilter());

        // Then create an iterator over that workspace ...
        NodeCache cache = repo.getWorkspaceCache(workspaceName);
        NodeKey startingNode = null;
        if (path != null) {
            CachedNode node = getNodeAtPath(path, cache);
            if (node != null) startingNode = node.getKey();
        } else {
            startingNode = cache.getRootKey();
        }
        if (startingNode != null) {
            return new NodeCacheIterator(cache, startingNode, compositeFilter);
        }
        return null;
    }
protected NodeCacheIterator nodes ( String workspaceName , Path path ) { NodeFilter nodeFilterForWorkspace = nodeFilterForWorkspace ( workspaceName ) ; if ( nodeFilterForWorkspace == null ) return null ; NodeFilter compositeFilter = new CompositeNodeFilter ( nodeFilterForWorkspace , sharedNodesFilter ( ) ) ; NodeCache cache = repo . getWorkspaceCache ( workspaceName ) ; NodeKey startingNode = null ; if ( path != null ) { CachedNode node = getNodeAtPath ( path , cache ) ; if ( node != null ) startingNode = node . getKey ( ) ; } else { startingNode = cache . getRootKey ( ) ; } if ( startingNode != null ) { return new NodeCacheIterator ( cache , startingNode , compositeFilter ) ; } return null ; }
Return an iterator over all nodes at or below the specified path in the named workspace, using the supplied filter.

@param workspaceName the name of the workspace
@param path the path of the root node of the subgraph, or null if all nodes in the workspace are to be included
@return the iterator, or null if this workspace will return no nodes